lib/selenium/client/selenese_client.rb in selenium-client-1.1 vs lib/selenium/client/selenese_client.rb in selenium-client-1.2
- old
+ new
@@ -5,18 +5,18 @@
module SeleneseClient
attr_reader :session_id
def do_command(verb, args)
- timeout(@timeout) do
+ timeout(default_timeout_in_seconds) do
status, response = http_post(http_request_for(verb, args))
raise SeleniumCommandError, response unless status == "OK"
response
end
end
- def get_string(verb, args)
+ def get_string(verb, args=[])
do_command(verb, args)
end
def get_string_array(verb, args)
csv = get_string(verb, args)
@@ -51,11 +51,11 @@
def get_number_array(verb, args)
# Is there something I need to do here?
return get_string_array(verb, args)
end
- def get_boolean(verb, args)
+ def get_boolean(verb, args=[])
parse_boolean_value get_string(verb, args)
end
def get_boolean_array(verb, args)
get_string_array(verb, args).collect {|value| parse_boolean_value(value)}
@@ -80,13 +80,13 @@
data << "&sessionId=#{session_id}" unless session_id.nil?
data
end
def http_post(data)
- #print "Requesting --->" + command_string + "\n"
+ # puts "Requesting ---> #{data.inspect}"
http = Net::HTTP.new(@server_host, @server_port)
response = http.post('/selenium-server/driver/', data, HTTP_HEADERS)
- #print "RESULT: " + response.body + "\n\n"å
+ # puts "RESULT: #{response.inspect}\n"
[ response.body[0..1], response.body[3..-1] ]
end
end