Class: Selenium::TextField

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/text_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser, locator) ⇒ TextField

Returns a new instance of TextField.



5
6
7
8
# File 'lib/selenium/text_field.rb', line 5

def initialize(browser, locator)
  @browser = browser
  @locator = locator
end

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



3
4
5
# File 'lib/selenium/text_field.rb', line 3

def browser
  @browser
end

Instance Method Details

#type(value) ⇒ Object



10
11
12
# File 'lib/selenium/text_field.rb', line 10

def type(value)
  @browser.type(@locator, value)
end

#valueObject



14
15
16
# File 'lib/selenium/text_field.rb', line 14

def value
  @browser.get_value(@locator)
end