问题描述
我已经编写了适用于 ChromeDriver() 驱动程序的代码,但是当我尝试对 HtmlUnitDriver() 执行相同操作时,它显示了一个错误
预期条件失败:等待元素可点击:
奇怪的是,我在这里没有做任何新的事情,我已经打电话了
wait_var.until(ExpectedConditions.elementToBeClickable(By.name("registration.license_country_id")));
Select drpLicenseCountry = new Select(driver.findElement(By.name("registration.license_country_id")));
drpLicenseCountry.selectByValue(country);
之前和下一行是
Select drpLicenseRegion = new Select(driver.findElement(By.id("registration_license_region_id")));
drpLicenseRegion.selectByValue("1125");
它在第二行显示错误。它确实适用于 registration.license_country_id
元素,但不适用于 registration_license_region_id
当我尝试使用 driver = ChromeDriver()
时它成功了
仅当我使用 driver = HtmlUnitDriver()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)