简体   繁体   English

当我将等待时间定为10秒时,自动化将等待网页加载10分钟

[英]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.

相关问题 如何为我的(字符串)时间添加 10 分钟? - How to add 10 minutes to my (String) time? 等待 10 秒后销毁 Firefox 进程时出现问题 - Problem in Destroying Firefox Process after some wait of 10 Seconds 等待输入的字符10秒钟,或者如果按下某个键,则更早进行? - Wait for a character from input for 10 seconds or proceed earlier if a key was pressed? 单击屏幕后10分钟后,如何使计时器结束? - How can I make my timer end after 10 minutes from when I click on the screen? 当我关闭 RDP 连接时,基于 WinAppDriver 的自动化停止在 windows 10 VM 上工作 - WinAppDriver based automation stops working on windows 10 VM when I close the RDP connection 每个线程应运行10分钟,然后在超时后中断该线程 - Each thread should run for 10 minutes and then interrupt the thread if the time is over 如何使Timer类在Java中每10秒加载一次jfreechart? - How to make Timer class to load a jfreechart every 10 seconds in Java? 滑动 window 10 秒? - Sliding window of 10 seconds? 包含时间(1H4M10S)的字符串转换为秒 - String containing time (1H4M10S) converted to seconds 高峰请求到达时频繁且长时间运行Java GC,这会使应用程序停止响应10分钟 - Frequently and long-time Java GC when peak requests arrives, which makes application stop response for 10 minutes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM