Method: Webdrone::XPath#link

Defined in:
lib/webdrone/xpath.rb

Match an a link element.

Parameters:

  • locator (String)

    Text, id, title, or image alt attribute of the link



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

def link(locator)
  locator = locator.to_s
  link = descendant(:a)[attr(:href)]
  link[attr(:id).equals(locator) | string.n.is(locator) | attr(:title).is(locator) | descendant(:img)[attr(:alt).is(locator)]]
end