Class: AutomationObject::Driver::Element
- Defined in:
- lib/automation_object/driver/element.rb
Overview
Element adapter interface
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#attribute(key, value = nil) ⇒ String?
Set or Get attribute.
-
#box_coordinates ⇒ BoxCoordinates
:x1, :x2, :y1, :y2 coordinates of a box.
-
#clear ⇒ void
Clear the element field.
-
#click ⇒ void
Perform a click action on the element.
-
#collides_with_element?(second_element_object, collision_tolerance = false) ⇒ Boolean
Element collides with other.
-
#content ⇒ String?
Content attribute.
-
#element_center ⇒ Point
:x, :y coordinates.
-
#height ⇒ Numeric
Height of element.
-
#hover ⇒ void
Hover over element.
-
#href ⇒ String
Href of element.
-
#id ⇒ String
Id of element.
- #invisible? ⇒ Boolean
-
#location ⇒ Point
Get the location.
-
#scroll_into_view ⇒ void
Scroll the element into view.
-
#send_keys(string) ⇒ void
Type into an element.
-
#size ⇒ Dimension
Get the size of an element.
-
#submit ⇒ void
Perform a submit action on an element.
-
#switch_to_iframe ⇒ void
Helper method to switch to this element's iframe.
-
#text ⇒ String?
Text of element.
- #visible? ⇒ Boolean
-
#width ⇒ Numeric
Width of element.
-
#x ⇒ Numeric
X position of element.
-
#y ⇒ Numeric
Y position of element.
Methods inherited from Base
Constructor Details
This class inherits a constructor from AutomationObject::Driver::Base
Instance Method Details
#attribute(key, value = nil) ⇒ String?
Set or Get attribute
13 14 15 |
# File 'lib/automation_object/driver/element.rb', line 13 def attribute(key, value = nil) adapter.attribute(key, value) end |
#box_coordinates ⇒ BoxCoordinates
Returns :x1, :x2, :y1, :y2 coordinates of a box
116 117 118 |
# File 'lib/automation_object/driver/element.rb', line 116 def box_coordinates adapter.box_coordinates end |
#clear ⇒ void
This method returns an undefined value.
Clear the element field
41 42 43 |
# File 'lib/automation_object/driver/element.rb', line 41 def clear adapter.clear end |
#click ⇒ void
This method returns an undefined value.
Perform a click action on the element
81 82 83 |
# File 'lib/automation_object/driver/element.rb', line 81 def click adapter.click end |
#collides_with_element?(second_element_object, collision_tolerance = false) ⇒ Boolean
Returns element collides with other
123 124 125 |
# File 'lib/automation_object/driver/element.rb', line 123 def collides_with_element?(second_element_object, collision_tolerance = false) adapter.collides_with_element?(second_element_object, collision_tolerance) end |
#content ⇒ String?
Returns content attribute
106 107 108 |
# File 'lib/automation_object/driver/element.rb', line 106 def content adapter.content end |
#element_center ⇒ Point
Returns :x, :y coordinates
111 112 113 |
# File 'lib/automation_object/driver/element.rb', line 111 def element_center adapter.element_center end |
#height ⇒ Numeric
Returns height of element
101 102 103 |
# File 'lib/automation_object/driver/element.rb', line 101 def height adapter.height end |
#hover ⇒ void
This method returns an undefined value.
Hover over element
129 130 131 |
# File 'lib/automation_object/driver/element.rb', line 129 def hover adapter.hover end |
#href ⇒ String
Returns href of element
23 24 25 |
# File 'lib/automation_object/driver/element.rb', line 23 def href adapter.href end |
#id ⇒ String
Returns id of element
18 19 20 |
# File 'lib/automation_object/driver/element.rb', line 18 def id adapter.id end |
#invisible? ⇒ Boolean
51 52 53 |
# File 'lib/automation_object/driver/element.rb', line 51 def invisible? adapter.invisible? end |
#location ⇒ Point
Get the location
57 58 59 |
# File 'lib/automation_object/driver/element.rb', line 57 def location adapter.location end |
#scroll_into_view ⇒ void
This method returns an undefined value.
Scroll the element into view
75 76 77 |
# File 'lib/automation_object/driver/element.rb', line 75 def scroll_into_view adapter.scroll_into_view end |
#send_keys(string) ⇒ void
This method returns an undefined value.
Type into an element
35 36 37 |
# File 'lib/automation_object/driver/element.rb', line 35 def send_keys(string) adapter.send_keys(string) end |
#size ⇒ Dimension
Get the size of an element
63 64 65 |
# File 'lib/automation_object/driver/element.rb', line 63 def size adapter.size end |
#submit ⇒ void
This method returns an undefined value.
Perform a submit action on an element
69 70 71 |
# File 'lib/automation_object/driver/element.rb', line 69 def submit adapter.submit end |
#switch_to_iframe ⇒ void
This method returns an undefined value.
Helper method to switch to this element's iframe
135 136 137 |
# File 'lib/automation_object/driver/element.rb', line 135 def switch_to_iframe adapter.switch_to_iframe end |
#text ⇒ String?
Text of element
29 30 31 |
# File 'lib/automation_object/driver/element.rb', line 29 def text adapter.text end |
#visible? ⇒ Boolean
46 47 48 |
# File 'lib/automation_object/driver/element.rb', line 46 def visible? adapter.visible? end |
#width ⇒ Numeric
Returns width of element
96 97 98 |
# File 'lib/automation_object/driver/element.rb', line 96 def width adapter.width end |
#x ⇒ Numeric
Returns x position of element
86 87 88 |
# File 'lib/automation_object/driver/element.rb', line 86 def x adapter.x end |
#y ⇒ Numeric
Returns y position of element
91 92 93 |
# File 'lib/automation_object/driver/element.rb', line 91 def y adapter.y end |