Method: XPath::HTML#button

Defined in:
lib/xpath/html.rb

#button(locator) ⇒ Object



15
16
17
18
19
# File 'lib/xpath/html.rb', line 15

def button(locator)
  button = descendant(:input)[attr(:type).one_of('submit', 'image', 'button')][attr(:id).equals(locator) | attr(:value).is(locator)]
  button += descendant(:button)[attr(:id).equals(locator) | attr(:value).is(locator) | string.n.is(locator)]
  button += descendant(:input)[attr(:type).equals('image')][attr(:alt).is(locator)]
end