Method: Webdrone::XPath#fillable_field

Defined in:
lib/webdrone/xpath.rb

#fillable_field(locator) ⇒ Object

Match any input or textarea element that can be filled with text. This excludes any inputs with a type of submit, image, radio, checkbox, hidden, or file.

Parameters:

  • locator (String)

    Label, id, or name of field to match



71
72
73
74
75
# File 'lib/webdrone/xpath.rb', line 71

def fillable_field(locator)
  locator = locator.to_s
  xpath = descendant(:input, :textarea)[~attr(:type).one_of('submit', 'image', 'radio', 'checkbox', 'hidden', 'file')]
  locate_field(xpath, locator)
end