Method: Selenium::WebDriver::Options#as_json
- Defined in:
- lib/selenium/webdriver/common/options.rb
#as_json ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/selenium/webdriver/common/options.rb', line 116 def as_json(*) = @options.dup downloads = .delete(:enable_downloads) ['se:downloadsEnabled'] = downloads unless downloads.nil? = () = self.class::CAPABILITIES.each_with_object({}) do |(capability_alias, capability_name), hash| capability_value = .delete(capability_alias) hash[capability_name] = capability_value unless capability_value.nil? end raise Error::WebDriverError, "These options are not w3c compliant: #{}" unless .empty? = {self.class::KEY => } if defined?(self.class::KEY) () generate_as_json(.merge()) end |