Class: Owrb::Browser
- Inherits:
-
Object
- Object
- Owrb::Browser
- Defined in:
- lib/owrb.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
Instance Method Summary collapse
- #click(expression) ⇒ Object
- #document ⇒ Object
- #go(url) ⇒ Object
- #html ⇒ Object
-
#initialize(type = :phantomjs) ⇒ Browser
constructor
A new instance of Browser.
- #quit ⇒ Object
Constructor Details
#initialize(type = :phantomjs) ⇒ Browser
Returns a new instance of Browser.
141 142 143 |
# File 'lib/owrb.rb', line 141 def initialize( type = :phantomjs ) @browser = Watir::Browser.new( type ) end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
139 140 141 |
# File 'lib/owrb.rb', line 139 def browser @browser end |
Instance Method Details
#click(expression) ⇒ Object
153 154 155 |
# File 'lib/owrb.rb', line 153 def click( expression ) @browser.element( :xpath, expression ).click end |
#document ⇒ Object
161 162 163 |
# File 'lib/owrb.rb', line 161 def document HTML.parse( @browser.html ) end |
#go(url) ⇒ Object
149 150 151 |
# File 'lib/owrb.rb', line 149 def go( url ) @browser.goto( url ) end |
#html ⇒ Object
145 146 147 |
# File 'lib/owrb.rb', line 145 def html @browser.html end |
#quit ⇒ Object
157 158 159 |
# File 'lib/owrb.rb', line 157 def quit @browser.quit end |