Method: Selenium::WebDriver::Options#add_cookie
- Defined in:
- lib/selenium/webdriver/common/options.rb
#add_cookie(opts = {}) ⇒ Object
Add a cookie to the browser
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/selenium/webdriver/common/options.rb', line 26 def (opts = {}) raise ArgumentError, "name is required" unless opts[:name] raise ArgumentError, "value is required" unless opts[:value] opts[:path] ||= "/" opts[:secure] ||= false if obj = opts[:expires] opts[:expiry] = seconds_from(obj) end @bridge.addCookie opts end |