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.
30 31 32 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 30 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.
34 35 36 37 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 34 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.
44 45 46 47 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 44 def context_click(element = nil) move_if_needed element @bridge.contextClick 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.
39 40 41 42 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 39 def double_click(element = nil) move_if_needed element @bridge.doubleClick 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.
49 50 51 52 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 49 def down(element = nil) move_if_needed element @bridge.mouseDown 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.
74 75 76 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 74 def move_by(right_by, down_by) @bridge.mouseMoveTo 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)
68 69 70 71 72 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 68 def move_to(element, right_by = nil, down_by = nil) assert_element element @bridge.mouseMoveTo 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.
54 55 56 57 |
# File 'lib/selenium/webdriver/common/mouse.rb', line 54 def up(element = nil) move_if_needed element @bridge.mouseUp end |