Selenium Web驱动程序等待很长时间 [英] Selenium Web driver wait for long time
问题描述
我可以长时间等待Selenium Web Driver吗?
Can I wait with Selenium Web Driver for a long time period?
即使我可以像下面那样设置隐式等待命令,它也不会等待我给出的时间.
Even though I can set implicitlywait command like below, it doesn't wait the time that I've given.
driver.manage().timeouts().implicitlyWait(5, TimeUnit.MINUTES);
这里有什么问题吗?
在我的情况下,我需要执行一个测试用例并等待4分钟,然后再执行下一个测试用例.
In my case, I need to execute one test case and wait for 4 minutes and then execute the next test case.
我在这里使用Java.
I use Java here.
推荐答案
实际上这不是我的答案,两天前我在这里看到了这个答案,但是我没有时间应用它.我想要.
Actually this is not my answer, Two days ago I saw this answer here, But I had no time to apply it.Today I tried it and that's what exact I wanted.
不幸的是,现在我在这里看不到该答案.因此,我添加了此答案,所有功劳应该归功于在此处发布此答案的用户.
Unfortunately Now I can not see that answer here.So I added this answer and all credits should go to the user who posted this answer here.
在这种情况下,我要等待驱动程序5分钟,以便执行定期的cron作业.
In this case what I wanted to do is to wait the driver for 5 mins so that until execute the periodical cron job.
Thread.sleep(4000);
暂停执行程序.
这篇关于Selenium Web驱动程序等待很长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!