Class: Browse

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

Overview

Browse class is awrapper fow watir gem

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent, port) ⇒ Browse

Returns a new instance of Browse.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rubyfu/browse.rb', line 16

def initialize(agent, port)
  
  # Set Page load timeout
  client = Selenium::WebDriver::Remote::Http::Default.new
  client.timeout = 1
  
  # Browser Settings 
  @port = port
  @browser = Watir::Browser.new agent, :http_client => client
  @browser.window.resize_to(1300, 950)
  @browser.window.move_to(0, 0)
#       screen_width  = (@browser.execute_script("return screen.width;")/2)
#       screen_height = (@browser.execute_script("return screen.height;")/2)
#       @browser.window.move_to(screen_height, screen_width)
end

Instance Attribute Details

#runObject

Returns the value of attribute run.



14
15
16
# File 'lib/rubyfu/browse.rb', line 14

def run
  @run
end