[英]Not able to maximize browser after using the command “driver.manage().window().setPosition(new Point(0,-1000));” in Selenium
I used the following command to minimize chrome browser: 我使用以下命令最小化了chrome浏览器:
driver.manage().window().setPosition(new Point(0,-1000));
But later when I clicked on chrome browser in toolbar to maximize, its not maximizing. 但是后来当我单击工具栏上的chrome浏览器最大化时,它没有最大化。
Can anybody help on this one please, why its not working? 有人可以帮忙吗,为什么它不起作用?
The reason is that the command you're using doesn't Minimize the window, it moves its position off screen. 原因是您使用的命令不会最小化窗口,而是将其位置移出屏幕。 So when you're clicking in the toolbar it will be minimizing/maximizing as you click, but you just can't see it.
因此,当您在工具栏中单击时,单击时它将最小化/最大化,但看不到它。
If you wish to make the window visible again later in your code you can just reset the window position with 如果您希望稍后在代码中再次显示该窗口,则可以使用
driver.manage().window().setPosition(new Point(0,0))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.