selenium-selenese 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/selenium/client/base.rb +22 -24
- metadata +1 -1
data/lib/selenium/client/base.rb
CHANGED
@@ -119,6 +119,28 @@ module Selenium
|
|
119
119
|
|
120
120
|
#goto method added by Priya
|
121
121
|
|
122
|
+
def exec_selenese_script(file)
|
123
|
+
f = File.new(file,"r")
|
124
|
+
string = ""
|
125
|
+
f.readlines.each { |line|
|
126
|
+
line.strip!
|
127
|
+
string = string + line.to_s
|
128
|
+
}
|
129
|
+
str_arr = string.partition("<tbody>")
|
130
|
+
str_arr.shift(2)
|
131
|
+
arr = str_arr[0].split("</tr>")
|
132
|
+
arr.pop
|
133
|
+
commands = []
|
134
|
+
arr.each{|ele| commands << ele.gsub("<tr><td>","").gsub("</td><td>",",").gsub("</td>","").split(",")}
|
135
|
+
@browser = Selenium::Client::Driver.new(:browser=>"*firefox", :timeout_in_second=> 15000, :url => "http://www.google.com")
|
136
|
+
@browser.start_new_browser_session
|
137
|
+
commands.each do |command|
|
138
|
+
args = []
|
139
|
+
args << command[1]
|
140
|
+
args << command[2]
|
141
|
+
@browser.remote_control_command(command[0],args)
|
142
|
+
end
|
143
|
+
end
|
122
144
|
#def goto(url)
|
123
145
|
# start_new_browser_session
|
124
146
|
# open "/"
|
@@ -137,28 +159,4 @@ module Selenium
|
|
137
159
|
end
|
138
160
|
|
139
161
|
end
|
140
|
-
|
141
|
-
def exec_selenese_script(file)
|
142
|
-
f = File.new(file,"r")
|
143
|
-
string = ""
|
144
|
-
f.readlines.each { |line|
|
145
|
-
line.strip!
|
146
|
-
string = string + line.to_s
|
147
|
-
}
|
148
|
-
str_arr = string.partition("<tbody>")
|
149
|
-
str_arr.shift(2)
|
150
|
-
arr = str_arr[0].split("</tr>")
|
151
|
-
arr.pop
|
152
|
-
commands = []
|
153
|
-
arr.each{|ele| commands << ele.gsub("<tr><td>","").gsub("</td><td>",",").gsub("</td>","").split(",")}
|
154
|
-
@browser = Selenium::Client::Driver.new(:browser=>"*firefox", :timeout_in_second=> 15000, :url => "http://www.google.com")
|
155
|
-
@browser.start_new_browser_session
|
156
|
-
commands.each do |command|
|
157
|
-
args = []
|
158
|
-
args << command[1]
|
159
|
-
args << command[2]
|
160
|
-
@browser.remote_control_command(command[0],args)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
162
|
end
|