{"record":{"id":"93cd1e5265f2532d","repo":"SeleniumHQ/selenium","slug":"expected-point-inspect-point-class-to-respon","errorCode":null,"errorMessage":"expected #{point.inspect}:#{point.class} to respond to #x and #y","messagePattern":"expected #(.+?):#(.+?) to respond to #x and #y","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/window.rb","lineNumber":64,"sourceCode":"      #\n      # Get the size of the current window.\n      #\n      # @return [Selenium::WebDriver::Dimension] The size.\n      #\n\n      def size\n        @bridge.window_size\n      end\n\n      #\n      # Move the current window to the given position.\n      #\n      # @param [Selenium::WebDriver::Point, #x and #y] point The new position.\n      #\n\n      def position=(point)\n        unless point.respond_to?(:x) && point.respond_to?(:y)\n          raise ArgumentError, \"expected #{point.inspect}:#{point.class} \" \\\n                               'to respond to #x and #y'\n        end\n\n        @bridge.reposition_window point.x, point.y\n      end\n\n      #\n      # Get the position of the current window.\n      #\n      # @return [Selenium::WebDriver::Point] The position.\n      #\n\n      def position\n        @bridge.window_position\n      end\n\n      #\n      # Sets the current window rect to the given point and position.","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/window.rb#L46-L82","documentation":"Raised by Window#position= (ArgumentError) when the point argument does not respond to both #x and #y. The setter validates via respond_to? then calls bridge.reposition_window with point.x, point.y.","triggerScenarios":"Calling driver.manage.window.position = [0, 0] (Array), a hash {x:, y:}, an integer pair, or nil instead of a Point/object with x and y methods.","commonSituations":"Passing a coordinate array as with other windowing libraries; using a struct or OpenStruct that defines different accessor names; passing nil from a computation that returned no value.","solutions":["Pass Selenium::WebDriver::Point.new(x, y), or any object exposing x and y readers.","Use driver.manage.window.move_to(x, y) if available, which takes positional integers.","Ensure any custom geometry object defines attr_reader :x, :y."],"exampleFix":"// before\ndriver.manage.window.position = [100, 200]\n\n// after\ndriver.manage.window.position = Selenium::WebDriver::Point.new(100, 200)","handlingStrategy":"type-guard","validationCode":"def point_like?(obj)\n  obj.respond_to?(:x) && obj.respond_to?(:y)\nend\n\nraise ArgumentError, 'invalid point' unless point_like?(pt)\ndriver.manage.window.position = pt","typeGuard":"def point_like?(obj)\n  obj.respond_to?(:x) && obj.respond_to?(:y)\nend","tryCatchPattern":null,"preventionTips":["Pass Selenium::WebDriver::Point.new(x, y) instead of arrays or hashes.","Use positional move_to(x, y) if you only have integer coordinates.","Verify any custom geometry object defines x and y readers."],"tags":["window","argument-error","duck-typing"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}