lib/selenium/client/idiomatic.rb in selenium-client-1.2.15 vs lib/selenium/client/idiomatic.rb in selenium-client-1.2.16
- old
+ new
@@ -364,13 +364,13 @@
#
# 'nameValuePair' is name and value of the cookie in a format "name=value"
# 'optionsString' is options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'.
# the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.
def create_cookie(name_value_pair, options="")
- if options.kind_of? Hash
+ if options.kind_of? Hash
options = options.keys.collect {|key| "#{key}=#{options[key]}" }.sort.join(", ")
- end
+ end
remote_control_command "createCookie", [name_value_pair,options,]
end
# Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you
# need to delete it using the exact same path and domain that were used to create the cookie.
@@ -384,14 +384,14 @@
# name and m is the number of slashes in the path.
#
# 'name' is the name of the cookie to be deleted
# 'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail.
def delete_cookie(name, options="")
- if options.kind_of? Hash
+ if options.kind_of? Hash
ordered_keys = options.keys.sort {|a,b| a.to_s <=> b.to_s }
options = ordered_keys.collect {|key| "#{key}=#{options[key]}" }.join(", ")
- end
+ end
remote_control_command "deleteCookie", [name,options,]
end
# Returns the IDs of all windows that the browser knows about.
def all_window_ids
@@ -440,9 +440,33 @@
raise "library name must be :ajaxslt, :javascript-xpath, or :default" \
unless [:ajaxslt, :'javascript-xpath', :default].include?(library_name)
remote_control_command "useXpathLibrary", [library_name.to_s]
end
+ #
+ # Turn on/off the automatic hightlighting of the element driven or
+ # inspected by Selenium core. Useful when recording videos
+ #
+ def highlight_located_element=(enabled)
+ boolean = (true == enabled)
+ js_eval "selenium.browserbot.shouldHighlightLocatedElement = #{boolean}"
+ end
+
+ # Get execution delay in milliseconds, i.e. a pause delay following
+ # each selenium operation. By default, there is no such delay
+ # (value is 0).
+ def execution_delay
+ string_command "getSpeed"
+ end
+
+ # Set the execution delay in milliseconds, i.e. a pause delay following
+ # each selenium operation. By default, there is no such delay.
+ #
+ # Setting an execution can be useful to troubleshoot of capture videos
+ def execution_delay=(delay_in_milliseconds)
+ remote_control_command "setSpeed", [delay_in_milliseconds]
+ end
+
end
-
+
end
end