How to set screen/window size when using GhostDriver

霸气de小男生 提交于 2019-12-01 08:48:16

Have you tried setSize() method from WebDriver.Window? Here is the documentation.

// untested Java code, only provides the logic
// please debug and refer to the documentation

import org.openqa.selenium.Dimension;

WebDriver driver = new PhantomJSDriver();

driver.manage().window().setSize(new Dimension(1920, 1080));
// or driver.manage().window().maximize();

driver.get("http://stackoverflow.com/questions/21743350/how-to-set-screen-window-size-when-using-ghostdriver");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!