SeleniumHQ/selenium · error · ArgumentError
Unknown options found: #{@opts.inspect}
Error message
Unknown options found: #{@opts.inspect} What it means
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.
Source
Thrown at rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb:35
# specific language governing permissions and limitations
# under the License.
module Selenium
module WebDriver
module Interactions
module PointerEventProperties
VALID = {width: {'width' => {min: 0.0}},
height: {'height' => {min: 0.0}},
pressure: {'pressure' => {min: 0.0, max: 1.0}},
tangential_pressure: {'tangentialPressure' => {min: -1.0, max: 1.0}},
tilt_x: {'tiltX' => {min: -90, max: 90}},
tilt_y: {'tiltY' => {min: -90, max: 90}},
twist: {'twist' => {min: 0, max: 359}},
altitude_angle: {'altitudeAngle' => {min: 0.0, max: (Math::PI / 2)}},
azimuth_angle: {'azimuthAngle' => {min: 0.0, max: (Math::PI * 2)}}}.freeze
def process_opts
raise ArgumentError, "Unknown options found: #{@opts.inspect}" unless (@opts.keys - VALID.keys).empty?
VALID.each_with_object({}) do |(key, val), hash|
next unless @opts.key?(key)
name = val.keys.first
values = val.values.first
hash[name] = assert_number(@opts[key], values[:min], values[:max])
end
end
private
def assert_number(num, min, max = nil)
return if num.nil?
klass = min.is_a?(Integer) ? Integer : Numeric
raise TypeError, "#{num} is not a #{klass}" unless num.is_a?(klass)
View on GitHub (pinned to aa36b38e69)
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.
Example fix
# before
driver.action.pointer_down(:left, origin: el, presure: 0.5).perform # => ArgumentError: Unknown options found: {:origin=>.., :presure=>..}
# after
driver.action.move_to(el).pointer_down(:left, pressure: 0.5).perform Defensive patterns
Strategy: validation
Validate before calling
VALID = Selenium::WebDriver::Interactions::PointerEventProperties::VALID.keys
opts = { pressure: 0.5, origin: el } # example user input
unknown = opts.keys - VALID
raise "unknown pointer opts: #{unknown}" unless unknown.empty?
driver.action.pointer_down(:left, **opts.slice(*VALID)).perform Prevention
- 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.
When it happens
Trigger: 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:.
Common situations: 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.
Related errors
- #{num} is not a #{klass}
- #{num} is not greater than or equal to #{min}
- #{num} is not less than or equal to #{max}
- #{button} is not a valid button!
- Button number cannot be negative!
AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14).
Data as JSON: /api/errors/0e74ec4b43855657.
Report an issue: GitHub.