Class: Selenium::WebDriver::Mouse Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Mouse
- Defined in:
- lib/selenium/webdriver/common/mouse.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #click(element = nil) ⇒ Object private
- #context_click(element = nil) ⇒ Object private
- #double_click(element = nil) ⇒ Object private
- #down(element = nil) ⇒ Object private
-
#initialize(bridge) ⇒ Mouse
constructor
private
A new instance of Mouse.
- #move_by(right_by, down_by) ⇒ Object private
-
#move_to(element, right_by = nil, down_by = nil) ⇒ Object
private
Move the mouse.
- #up(element = nil) ⇒ Object private
Constructor Details
#initialize(bridge) ⇒ Mouse
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Mouse.
28 29 30 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 28 def initialize(bridge) @bridge = bridge end |
Instance Method Details
#click(element = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 35 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 32 def click(element = nil) move_if_needed element @bridge.click end |
#context_click(element = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 45 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 42 def context_click(element = nil) move_if_needed element @bridge.context_click end |
#double_click(element = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 40 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 37 def double_click(element = nil) move_if_needed element @bridge.double_click end |
#down(element = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 47 def down(element = nil) move_if_needed element @bridge.mouse_down end |
#move_by(right_by, down_by) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
72 73 74 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 72 def move_by(right_by, down_by) @bridge.mouse_move_to nil, Integer(right_by), Integer(down_by) end |
#move_to(element, right_by = nil, down_by = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Move the mouse.
Examples:
driver.mouse.move_to(element)
driver.mouse.move_to(element, 5, 5)
66 67 68 69 70 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 66 def move_to(element, right_by = nil, down_by = nil) assert_element element @bridge.mouse_move_to element.ref, right_by, down_by end |
#up(element = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 55 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 52 def up(element = nil) move_if_needed element @bridge.mouse_up end |