Java 指定的超时类型无效:页面加载

Java 指定的超时类型无效:页面加载,java,selenium-webdriver,Java,Selenium Webdriver,我是Selenium和自动化测试的新手,面临以下错误消息: org.openqa.selenium.InvalidArgumentException: Invalid timeout type specified: page load 当运行测试/登录/用户和通过时,输入速度非常慢,比如每10-15秒输入1个符号。我可以登录,但测试失败,出现了上面提到的错误消息。 我如何修复它,使测试运行更快,我认为这就是问题所在 视窗10 IE 11 ie驱动程序32位3.5.0 以及守则: @Before

我是Selenium和自动化测试的新手,面临以下错误消息:

org.openqa.selenium.InvalidArgumentException: Invalid timeout type specified: page load
当运行测试/登录/用户和通过时,输入速度非常慢,比如每10-15秒输入1个符号。我可以登录,但测试失败,出现了上面提到的错误消息。 我如何修复它,使测试运行更快,我认为这就是问题所在

视窗10 IE 11 ie驱动程序32位3.5.0

以及守则:

@Before
public void setUp() throws Exception {

    System.setProperty("webdriver.ie.driver", "D:\\Documents\\SeleniumDriver\\IEDriverServer.exe");

    this.driver = new InternetExplorerDriver();
    this.driver.manage().window().maximize();
    driver.manage().timeouts().implicitlyWait(4000, TimeUnit.MINUTES);
    driver.get(Constant.URL);

    ExcelUtils.setExcelFile(Constant.Path_TestData + Constant.File_TestData, "Sheet1");

}

@SuppressWarnings("deprecation")
@Test
public void Activation() throws Exception {

    LoginModel.LoginAdminCredentials(driver);

    driver.manage().timeouts().pageLoadTimeout(4000, TimeUnit.MINUTES);

    String currentURL = driver.getCurrentUrl();

    Assert.assertEquals("expectedURL", currentURL);

} 
你应该摆脱它

driver.manage().timeouts().pageLoadTimeout(4000, TimeUnit.MINUTES); 
@Test
方法中,由于
driver.manage().timeout()
值在驱动程序实例处于活动状态之前一直有效,因此它是默认值还是用户设置的自定义值


另外,为了减少执行所花费的时间,您可以尝试通过替换来更新
@Before
方法

driver.manage().timeouts().implicitlyWait(4000, TimeUnit.MINUTES);


可能要去掉
driver.manage().timeout().pageLoadTimeout(4000,TimeUnit.MINUTES)在TestThank中,它工作正常,错误不可见。即使是那个测试也运行得太慢了。有没有办法解决速度问题?完成!!但再次测试需要109322秒。有没有办法让它运行10秒?@evitta15您确定没有其他与上述相关的代码需要时间吗。如驱动程序初始化、设置功能等?是的,我的故障只指向测试。有一个类可以读取用户并从excel+常量数据中传递:是的,有,我的错误只指向测试。但我认为问题在于IE,因为同样的测试使用chrome运行了大约10秒。我使用32位驱动程序查看了IE安全设置+,如:抱歉,我没有15分投票支持你的答案:(但真的非常感谢你的帮助。这对我帮助很大:)
driver.manage().timeouts().implicitlyWait(4000, TimeUnit.SECONDS);