phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

Maximise window of browser

Open djjohnjosephuk opened this issue 9 years ago • 4 comments

Hi,

I'm running my selenium tests under a headless IE browser on windows, and am taking screenshots on error/failures. One thing with this is the browser window that is being opened is a half minimised window, and the currentScreenshot method only seems to take the visible screen rather than the full browser page - this leaves the error screenshot I have as a small fraction of the actual viewport.

Is there any plan or way to implement the Driver.Manage.Window.Maximise function in web driver, or can this be done already somehow? I did dig through the codebase but couldn't find anything.

djjohnjosephuk avatar Aug 14 '15 14:08 djjohnjosephuk

You can maximize the browser window like this : this->prepareSession()->currentWindow()->maximize();

Hope this helps

paulbriton avatar Aug 17 '15 09:08 paulbriton

It doesn't work with Chromedriver.

techhemant avatar Sep 18 '18 05:09 techhemant

This worked for me. $this->currentWindow()->size(array( 'width' => 1920, 'height' => 1080, ));

techhemant avatar Sep 19 '18 20:09 techhemant

$this->currentWindow()->maximize(); This worked for me!

oldFuryBird avatar Oct 04 '18 08:10 oldFuryBird