Class: Async::Webdriver::Element
- Inherits:
-
Object
- Object
- Async::Webdriver::Element
- Defined in:
- lib/async/webdriver/element.rb
Instance Method Summary collapse
-
#initialize(json:, connection:) ⇒ Element
constructor
A new instance of Element.
- #tag_name ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(json:, connection:) ⇒ Element
Returns a new instance of Element.
5 6 7 8 |
# File 'lib/async/webdriver/element.rb', line 5 def initialize(json:, connection:) @id = json.fetch "ELEMENT" @element_connection = ConnectionPath.new "element/#{@id}", connection: connection end |
Instance Method Details
#tag_name ⇒ Object
10 11 12 13 |
# File 'lib/async/webdriver/element.rb', line 10 def tag_name @element_connection.call method: "get", path: "name" value end |
#text ⇒ Object
15 16 17 |
# File 'lib/async/webdriver/element.rb', line 15 def text @element_connection.call method: "get", path: "text" end |