MAXIMIZE the Browser Automaticaly

K

King Maker

I try Many thing but not find the best solution to maximize the window.
i run the script every time window open in the normal size.

........................ Help me ..........................

require 'watir'
include Watir

ie=Watir::IE.start("http://www.google.co.in")

#~ie.maximize

# Minimize the window
def maximize
set_window_state :SW_MAXIMIZE
end
def set_window_state(state)
autoit.WinSetState title, '', autoit.send(state)
end
def autoit
Watir::autoit
end

def self.autoit
unless @@autoit
begin
@@autoit = WIN32OLE.new('AutoItX3.Control')
rescue WIN32OLERuntimeError
_register('AutoItX3.dll')
@@autoit = WIN32OLE.new('AutoItX3.Control')
end
end
@@autoit
end

Version:
gem 0.9.4
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top