phpunit-selenium
phpunit-selenium copied to clipboard
Maximise window of browser
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.
You can maximize the browser window like this : this->prepareSession()->currentWindow()->maximize();
Hope this helps
It doesn't work with Chromedriver.
This worked for me. $this->currentWindow()->size(array( 'width' => 1920, 'height' => 1080, ));
$this->currentWindow()->maximize(); This worked for me!