Module: SeleniumRecord::Html

Included in:
Base
Defined in:
lib/selenium_record/html.rb

Overview

Helpers for getting html related info to selenium objects

Instance Method Summary collapse

Instance Method Details

#tag_nameString

Returns the tag name for the DOM element at the root of the object. Used to define xpath locators.

Returns:

  • (String)

    the tag name for the DOM element at the root of the object. Used to define xpath locators.

See Also:

  • preceding_sibling_locator


13
14
15
# File 'lib/selenium_record/html.rb', line 13

def tag_name
  @tag_name ||= root_el.attribute('tagName')
end

#to_htmlString

Returns the html content for the root element.

Returns:

  • (String)

    the html content for the root element



5
6
7
8
# File 'lib/selenium_record/html.rb', line 5

def to_html
  return root_el.attribute('innerHTML') if exist?
  nil
end