我正在使用TestNG框架编写一个硒脚本。在selenium抛出NoSuchElement异常之前,我已经将显式等待定义为20秒。但脚本在执行期间不等待20秒,并在41毫秒内抛出异常。 我希望此脚本等待(仅使用显式等待)或在抛出任何异常之前搜索web元素20秒。 以下是执行结果后面的脚本。 public class para {
WebDriver driver;
@BeforeClass
import java.util.Scanner;
public class fmax
{
public static void main(String[] args)
{
int max;
max = maxnum();
System.out.println("The max number is: " + max);
}
public static int maxnum()