{"record":{"id":"1a7453a7df8ad728","repo":"SeleniumHQ/selenium","slug":"num-is-not-greater-than-or-equal-to-min","errorCode":null,"errorMessage":"#{num} is not greater than or equal to #{min}","messagePattern":"#(.+?) is not greater than or equal to #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb","lineNumber":54,"sourceCode":"\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\n          raise ArgumentError, \"#{num} is not greater than or equal to #{min}\" if num < min\n\n          raise ArgumentError, \"#{num} is not less than or equal to #{max}\" if max && num > max\n\n          num\n        end\n      end # PointerEventProperties\n    end # Interactions\n  end # WebDriver\nend # Selenium\n","sourceCodeStart":36,"sourceCodeEnd":64,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb#L36-L64","documentation":"Raised as ArgumentError by PointerEventProperties.assert_number when a property value (after passing the type check) is below the property's documented minimum in the VALID map. The min per property: width/height 0.0, pressure 0.0, tangential_pressure -1.0, tilt_x/tilt_y -90, twist 0, altitude_angle 0.0, azimuth_angle 0.0.","triggerScenarios":"Passing an out-of-range-low value: pressure: -0.1, tilt_x: -91, twist: -1, width: -5, tangential_pressure: -1.5.","commonSituations":"Pen/stylus automation where tilt/pressure are computed and can exceed physical limits; sign errors (negative pressure); defaulting a missing value to -1 as a sentinel.","solutions":["Clamp the value to the property's min: e.g. [val, min_val].max, using the min from the VALID table.","Correct the source of the value — a negative pressure or below-zero width usually means a sign or unit error upstream.","Pass nil to omit the property entirely (assert_number returns early on nil)."],"exampleFix":"# before\ndriver.action.pointer_down(:pen_contact, tilt_x: -95).perform # => ArgumentError: -95 is not greater than or equal to -90\n\n# after\nval = [-95, -90].max\ndriver.action.pointer_down(:pen_contact, tilt_x: val).perform","handlingStrategy":"validation","validationCode":"VALID = Selenium::WebDriver::Interactions::PointerEventProperties::VALID\ndef clamped(prop, val)\n  return nil if val.nil?\n  min = VALID[prop].values.first[:min]\n  val < min ? min : val\nend\n\ndriver.action.pointer_down(:pen_contact, tilt_x: clamped(:tilt_x, computed)).perform","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp computed stylus values to each property's documented min before passing.","Pass nil to omit a property rather than using a negative sentinel like -1."],"tags":["interactions","pointer-properties","range-validation","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}