Class: Selenium::Link
- Inherits:
-
HtmlElement
- Object
- HtmlElement
- Selenium::Link
- Defined in:
- lib/selenium/link.rb
Overview
Link class that models the behavior of a link
Instance Attribute Summary
Attributes inherited from HtmlElement
Class Method Summary collapse
Instance Method Summary collapse
-
#go ⇒ Object
click the link, wait for the page to load, and asserts the target that was passed in during initialization.
-
#initialize(webpage, locator, target = nil) ⇒ Link
constructor
A new instance of Link.
- #with_target(target) ⇒ Object
Methods inherited from HtmlElement
#browser, #click, #click_wait, #double_click, #key_press, #present?, #text
Constructor Details
#initialize(webpage, locator, target = nil) ⇒ Link
Returns a new instance of Link.
13 14 15 16 |
# File 'lib/selenium/link.rb', line 13 def initialize(webpage, locator, target = nil) super(webpage, locator) @target = target end |
Class Method Details
Instance Method Details
#go ⇒ Object
click the link, wait for the page to load, and asserts the target that was passed in during initialization
24 25 26 27 28 29 |
# File 'lib/selenium/link.rb', line 24 def go raise "target page not defined for link #{@locator}" unless @target click_wait @target.ensure_present @target end |