Closed GoogleCodeExporter closed 8 years ago
You can do it via javascript execution from WebDriver. See the code in
https://github.com/daluu/php-webdriver-bindings/blob/master/phpwebdriver/WebDriv
erBackedSelenium.php
see these functions on that page:
windowMaximize()
windowFocus()
Original comment by manga...@gmail.com
on 12 Jun 2012 at 7:47
Am using the pure webdriver,this code is not working for window maximize.
Please send the steps todo windowmaximize in pure php-webdriver
public function windowMaximize(){
print "\n".__FUNCTION__.":\n"; //log commands called like SeleniumTestCase
$this->seleniumSpeedDelay();
$winMaxScript = <<<WINMAXSCRIPT
if (window.screen){
window.moveTo(0, 0);
window.resizeTo(window.screen.availWidth,window.screen.availHeight);
}
WINMAXSCRIPT;
$this->webdriver->execute($winMaxScript,array());
}
Thanks in advance
chelladurai.A
Original comment by chelladu...@photoninfotech.net
on 14 Jun 2012 at 5:01
Hmm...I'll have to look into that then, to confirm the code works or not, in
theory it should.
Original comment by manga...@gmail.com
on 14 Dec 2012 at 8:25
Original comment by manga...@gmail.com
on 9 Mar 2013 at 6:46
Has anyone figured this out yet? It is a bummer that I can not get the browser
to maximize using the above JavaScript.
Original comment by afung...@gmail.com
on 8 Apr 2013 at 5:15
Curious to know, the suggested javascript mentioned fails for all browsers or
just some? As I recall, Firefox stopped supporting that type of javascript
code, but not sure about other browsers.
I haven't looked at the PHP WebDriver bindings in a while, but as I recall the
current codebase didn't have support for window maximize, the suggested code in
my fork was a javascript workaround. The proper workaround is to implement the
JSONWireProtocol request/command to perform the action instead of javascript,
but I haven't the time to look into that yet.
A sort of example of how you would make the JSONWireProtocol request via PHP is
presented in the Facebook PHP WebDriver bindings home page
(under text "Set size of window that has $window_handle with 'POST'")
https://github.com/facebook/php-webdriver
you would then have to implement/port the equivalent code to this project's
version of the PHP bindings. A code patch from the community is welcome.
Original comment by manga...@gmail.com
on 9 Apr 2013 at 6:19
I've now implemented the JSONWireProtocol command for this feature rather than
using the javascript workaround. Give it a try and see if it works.
Fixed in revision 68, with a webdriver->windowMaximize() method.
Original comment by manga...@gmail.com
on 9 Jun 2013 at 3:16
Original issue reported on code.google.com by
chelladu...@photoninfotech.net
on 25 May 2012 at 2:09