Class: Owrb::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/owrb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#browserObject (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

#documentObject



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

#htmlObject



145
146
147
# File 'lib/owrb.rb', line 145

def html
  @browser.html
end

#quitObject



157
158
159
# File 'lib/owrb.rb', line 157

def quit
  @browser.quit
end