我的代码中有多种方法需要使用WebDriverWait。通常我们在main方法中声明它,如下所示:
WebDriverWait mywait = new WebDriverWait(driver, 25)
在Selify中使用JUnit时,没有任何Main方法。如何在代码中的各种方法中使用WebDriverWait for Webelements?
我的代码中有多种方法需要使用WebDriverWait。通常我们在main方法中声明它,如下所示:
WebDriverWait mywait = new WebDriverWait(driver, 25)
在Selify中使用JUnit时,没有任何Main方法。如何在代码中的各种方法中使用WebDriverWait for Webelements?
1条答案
按热度按时间t5zmwmid1#
从Main调用JUnit函数的方式
以下是关于如何:*How do I run JUnit tests from inside my Java application?*的一些帮助
也可以简单添加Thread.sleep(毫秒)
它必须在Java(Eclipse)中工作。
但您也可以使用(我认为它更适合测试):
来源:如何让它等到元素出现在 selenium 中?