It's RAutomation::Window#maximize and it would work only under Windows. Also, i'd use window handle instead of title: RAutomation::Window.new(:hwnd => hwnd).minimize RAutomation::Window.new(:hwnd => hwnd).maximize
Jarmo Pertman ----- IT does really matter - http://itreallymatters.net On Feb 10, 12:15 am, Anthony <kabl.halle...@gmail.com> wrote: > you could try > > gem install rautomation > > monkey patch: > class Watir::Browser > def minimise > RAutomation::Window.new(:title => /#{self.title}/).minimize > end > def maximise > RAutomation::Window.new(:title => /#{self.title}/).maximise > end > end > > On Jan 5, 4:03 am, Super Kevy <kpe...@scholarshipamerica.org> wrote: > > > > > > > > > I'm using webdriver to automate for the big 3 browsers and have the > > snippet below to set the screen size to maximum, Chrome works perfect > > with the swtiches option, IE and FF are kind of acceptable hacks. > > > A) Does anyone have a better way to maximize FF & IE with Webdriver? > > B) In Chrome I always get the inline-popup Do you want google chrome > > to save your password?. Is there an elegant way to get rid of that? > > Its not a great problem just an annoyance. > > > def Method_Login(ie,sURL,sBrowserType,sUserName,sPassword) > > puts ' * Method_Login' > > puts ' - Browser type: ' + sBrowserType.to_s > > puts ' - Login: ' + sUserName.to_s > > case sBrowserType > > when 'firefox' > > ie = Watir::Browser.new(:firefox) > > ie.window.move_to(0,0) > > ie.window.resize_to(1024,700) > > when 'chrome' > > ie = Watir::Browser.new(:chrome, :switches => %w[--start- > > maximized] ) > > when 'ie' > > ie = Watir::Browser.new(:ie) > > ie.window.move_to(0,0) > > ie.window.resize_to(1024,700) > > else > > puts ' - FAIL. Browser type not found [ '+sBrowserType+' ]' > > puts ' - Valid browser types: firefox, chrome, ie' > > puts ' - ABORT. ' > > stop > > end > > ie.goto(sURL) > > .... etc... > > end -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com