Method: Selenium::WebDriver::PointerActions#move_to
- Defined in:
- lib/selenium/webdriver/common/interactions/pointer_actions.rb
#move_to(element, right_by = nil, down_by = nil, **opts) ⇒ ActionBuilder
Moves the pointer to the in-view center point of the given element. Then the pointer is moved to optional offset coordinates.
The element is not scrolled into view. MoveTargetOutOfBoundsError will be raised if element with offset is outside the viewport
When using offsets, both coordinates need to be passed.
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/selenium/webdriver/common/interactions/pointer_actions.rb', line 97 def move_to(element, right_by = nil, down_by = nil, **opts) pointer = pointer_input(opts.delete(:device)) pointer.create_pointer_move(duration: opts.delete(:duration) || default_move_duration, x: right_by || 0, y: down_by || 0, origin: element, **opts) tick(pointer) self end |