class FireWatir::Link

Description:

Class for Link element.

Constants

TAG

Attributes

element_name[RW]

Public Class Methods

new(container, how, what) click to toggle source

Description:

Initializes the instance of link element.

Input:

- how - Attribute to identify the link element.
- what - Value of that attribute.
# File lib/firewatir/elements/link.rb, line 17
def initialize(container, how, what)
  @how = how
  @what = what
  @container = container
end

Public Instance Methods

locate() click to toggle source

Description:

Locate the link element on the page.
# File lib/firewatir/elements/link.rb, line 27
def locate
  case @how
  when :jssh_name
    @element_name = @what
  when :xpath
    @element_name = element_by_xpath(@container, @what)
  else
    @element_name = locate_tagged_element('A', @how, @what)
  end
  @o = self
end
to_s() click to toggle source

returns a textual description of the link

# File lib/firewatir/elements/link.rb, line 70
def to_s
  assert_exists
  super({"href" => "href","inner text" => "text"})
end