{"record":{"id":"0e74ec4b43855657","repo":"SeleniumHQ/selenium","slug":"unknown-options-found-opts-inspect","errorCode":null,"errorMessage":"Unknown options found: #{@opts.inspect}","messagePattern":"Unknown options found: #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb","lineNumber":35,"sourceCode":"# specific language governing permissions and limitations\n# under the License.\n\nmodule Selenium\n  module WebDriver\n    module Interactions\n      module PointerEventProperties\n        VALID = {width: {'width' => {min: 0.0}},\n                 height: {'height' => {min: 0.0}},\n                 pressure: {'pressure' => {min: 0.0, max: 1.0}},\n                 tangential_pressure: {'tangentialPressure' => {min: -1.0, max: 1.0}},\n                 tilt_x: {'tiltX' => {min: -90, max: 90}},\n                 tilt_y: {'tiltY' => {min: -90, max: 90}},\n                 twist: {'twist' => {min: 0, max: 359}},\n                 altitude_angle: {'altitudeAngle' => {min: 0.0, max: (Math::PI / 2)}},\n                 azimuth_angle: {'azimuthAngle' => {min: 0.0, max: (Math::PI * 2)}}}.freeze\n\n        def process_opts\n          raise ArgumentError, \"Unknown options found: #{@opts.inspect}\" unless (@opts.keys - VALID.keys).empty?\n\n          VALID.each_with_object({}) do |(key, val), hash|\n            next unless @opts.key?(key)\n\n            name = val.keys.first\n            values = val.values.first\n            hash[name] = assert_number(@opts[key], values[:min], values[:max])\n          end\n        end\n\n        private\n\n        def assert_number(num, min, max = nil)\n          return if num.nil?\n\n          klass = min.is_a?(Integer) ? Integer : Numeric\n          raise TypeError, \"#{num} is not a #{klass}\" unless num.is_a?(klass)\n","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb#L17-L53","documentation":"Raised as ArgumentError by PointerEventProperties#process_opts when @opts contains keys not present in the VALID map. VALID permits exactly: width, height, pressure, tangential_pressure, tilt_x, tilt_y, twist, altitude_angle, azimuth_angle. Any other keyword is rejected before encoding.","triggerScenarios":"Passing unsupported kwargs to a pointer action that mixes in PointerEventProperties (PointerPress via pointer_down/pointer_up, and PointerMove). E.g. driver.action.pointer_down(:left, force: true), or a typo like origin: written as origen:.","commonSituations":"Typos in option names; copying example code from a different library (Appium/Puppeteer) whose option names differ; passing origin/element/duration into pointer_down where only pointer-event properties are accepted.","solutions":["Remove or correct the offending key — the message prints @opts.inspect, so compare each key against VALID (width, height, pressure, tangential_pressure, tilt_x, tilt_y, twist, altitude_angle, azimuth_angle).","Move non-property kwargs to the right method: origin/element belong to move_to / pointer_move (Scroll/PointerMove), not pointer_down/pointer_up.","Use Symbols (not Strings) for keys — the VALID map is keyed by Symbols, so 'pressure:' in a hash literal works but passing a string-keyed Hash will show up as unknown."],"exampleFix":"# before\ndriver.action.pointer_down(:left, origin: el, presure: 0.5).perform # => ArgumentError: Unknown options found: {:origin=>.., :presure=>..}\n\n# after\ndriver.action.move_to(el).pointer_down(:left, pressure: 0.5).perform","handlingStrategy":"validation","validationCode":"VALID = Selenium::WebDriver::Interactions::PointerEventProperties::VALID.keys\nopts = { pressure: 0.5, origin: el } # example user input\nunknown = opts.keys - VALID\nraise \"unknown pointer opts: #{unknown}\" unless unknown.empty?\n\ndriver.action.pointer_down(:left, **opts.slice(*VALID)).perform","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict pointer-event property kwargs to: width, height, pressure, tangential_pressure, tilt_x, tilt_y, twist, altitude_angle, azimuth_angle.","Pass origin/element to move_to/pointer_move, not to pointer_down/pointer_up.","Use Symbol keys, never string keys, for these options."],"tags":["interactions","pointer-properties","argument-validation","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}