[英]How to move the browser window in Selenium 3?
The following code worked under older versions of Selenium but results in a timeout under Selenium 3:以下代码在旧版本的 Selenium 下工作,但在 Selenium 3 下导致超时:
WebDriver driver = new ChromeDriver();
driver.manage().window().setPosition(new Point(1315, 0));
What is the correct way of moving the browser window in Selenium 3?在 Selenium 3 中移动浏览器 window 的正确方法是什么?
I believe there is no way native way to resize, or manipulate browser windows in Selenium. 我相信没有任何方法可以在Selenium中调整或调整浏览器窗口的大小。
Source: https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/1750 来源: https : //github.com/seleniumhq/selenium-google-code-issue-archive/issues/1750
The only simple way that I have seen it done in the past is what you did, using a point and setting the position. 我过去看到它完成的唯一简单方法就是您所做的,使用一个点并设置位置。
For python it is driver.set_window_position(-1920,0)
对于 python 它是
driver.set_window_position(-1920,0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.