Skip to content

Instantly share code, notes, and snippets.

@aderyabin
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aderyabin/9808970 to your computer and use it in GitHub Desktop.
Save aderyabin/9808970 to your computer and use it in GitHub Desktop.
#
# Returns outer (inner + element itself) HTML code of element.
#
# @example
# browser.div(:id => "foo").html
# #=> "<div id=\"foo\"><a>Click</a></div>"
#
# @return [String]
#
def outer_html
assert_exists
execute_atom(:getOuterHtml, @element).strip
end
alias_method :html, :outer_html
#
# Returns inner HTML code of element.
#
# @example
# browser.div(:id => "foo").html
# #=> "<a>Click</a>"
#
# @return [String]
#
def inner_html
assert_exists
execute_atom(:getInnerHtml, @element).strip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment