Maximizing the Browser in Watir-WebDriver

Maximize the Watir-WebDriver Web Page :

require 'rubygems'

requier ‘watir-webdriver’

browser= Watir::Browser.new :ie

width = browser.execute_script(“return screen.width;”)
height = browser.execute_script(“return screen.height;”)
browser.driver.manage.window.move_to(0,0)
browser.driver.manage.window.resize_to(width,height)

Advertisements

2 thoughts on “Maximizing the Browser in Watir-WebDriver

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s