Just trying out Selenium's feasibility against Silverlight apps UI.
Inspector for Silverlight's object ID, controls etc is still under R&D...
more post to follow...
This is just a sample code:
1 require 'selenium/client'
2 require 'selenium/rspec/spec_helper'
3 require 'spec'
4
5 describe "test" do
6 attr_reader :browser
7 alias :page :browser
8
9 before :all do
10 @browser = Selenium::Client::Driver.new(
11 :host => 'localhost',
12 :port => 4444,
13 :browser => '*firefox',
14 :url => 'http://localhost:8080/',
15 :timeout_in_second => 90)
16 end
17
18 before(:each) do
19 page.start_new_browser_session
20 end
21
22 append_after(:each) do
23 page.close_current_browser_session
24 end
25
26 it "test" do
27 page.open("TestPage.html")
28 sleep(2)
29
30 code = "var control = window.document.getElementById('silverlightControl');
31 control.Content.MainView.test('it works!!!');"
32
33 page.get_eval(code)
34 end
35 end
Tuesday, February 1, 2011
Subscribe to:
Comments (Atom)