[英]Automation waits for the webpage to load for 10 minutes when i have given wait time as 10 seconds
I have a java selenium project .I have used implicit wait of 10 seconds using 我有一个Java硒项目。我使用了10秒的隐式等待
driver.manage()
.timeouts()
.implicitlyWait(10, TimeUnit.SECONDS);
Still the automation scripts wait for 10 minutes for the webpage to load. 自动化脚本仍然需要等待10分钟才能加载网页。 Here is the image that will be there 10 minutes and then it will fail. 这是将在此处显示10分钟的图像,然后它将失败。
What is the possible reason for it? 可能的原因是什么?
As already mentioned in the comments you need to set the page load timeout as well. 正如评论中已经提到的,您还需要设置页面加载超时。 The implicit wait timeout does not have any effect in this case. 隐式等待超时在这种情况下不起作用。 Try following line: 尝试以下行:
driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
In Selenium you have three different timeouts which all have different default values. 在Selenium中,您有三个不同的超时,它们都有不同的默认值。 Take a look at this answer which IMHO explains them quite good. 看看这个答案,恕我直言解释他们很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.