Class: Async::Webdriver::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/async/webdriver/element.rb

Instance Method Summary collapse

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_nameObject



10
11
12
13
# File 'lib/async/webdriver/element.rb', line 10

def tag_name
  @element_connection.call method: "get", path: "name"
  value
end

#textObject



15
16
17
# File 'lib/async/webdriver/element.rb', line 15

def text
  @element_connection.call method: "get", path: "text"
end