Top Level Namespace
Defined Under Namespace
Modules: Nautilus, Selenium, Spec Classes: TCPSocket
Constant Summary collapse
- SeleniumHelper =
Backward compatibility
Selenium::Client::SeleniumHelper
- SeleniumCommandError =
Selenium::CommandError
Instance Method Summary collapse
Instance Method Details
#exec_selenese_script(file) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/selenium/selenese.rb', line 25 def exec_selenese_script(file) f = File.new(file,"r") string = "" f.readlines.each { |line| line.strip! string = string + line.to_s } str_arr = string.partition("<tbody>") str_arr.shift(2) arr = str_arr[0].split("</tr>") arr.pop commands = [] arr.each{|ele| commands << ele.gsub("<tr><td>","").gsub("</td><td>",",").gsub("</td>","").split(",")} @browser = Selenium::Client::Driver.new(:browser=>"*firefox", :timeout_in_second=> 15000, :url => "http://www.google.com") @browser.start_new_browser_session commands.each do |command| args = [] args << command[1] args << command[2] @browser.remote_control_command(command[0],args) end end |