Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium webdriver HtmlUnitDriver未识别google登录电子邮件文本化_Selenium Webdriver_Htmlunit Driver - Fatal编程技术网

Selenium webdriver HtmlUnitDriver未识别google登录电子邮件文本化

Selenium webdriver HtmlUnitDriver未识别google登录电子邮件文本化,selenium-webdriver,htmlunit-driver,Selenium Webdriver,Htmlunit Driver,嗨,我已经通过谷歌功能自动登录,它在谷歌浏览器中运行良好,但当我不得不运行到无头模式时,相同的代码不起作用 org.openqa.selenium.NoSuchElementException:无法找到ID为identifierId的元素 driver = new HtmlUnitDriver(true); wait = new WebDriverWait(driver, 60); wc = new WebDriverWait(driver, 3); driver.manage().timeou

嗨,我已经通过谷歌功能自动登录,它在谷歌浏览器中运行良好,但当我不得不运行到无头模式时,相同的代码不起作用

org.openqa.selenium.NoSuchElementException:无法找到ID为identifierId的元素

driver = new HtmlUnitDriver(true);
wait = new WebDriverWait(driver, 60);
wc = new WebDriverWait(driver, 3);
driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
driver.get(baseUrl);
driver.findElement(By.id("identifierId")).click();

我也尝试了等待命令,但没有成功。请给我一个解决方案

请使用最新版本并发布您的完整案例和URL。您能给我URL吗?可能与此答案中给出的信息相关:使用无头chrome而不是HTMLUnitDriver请使用最新版本并发布您的完整案例,你能给我一个URL吗?这个URL可能与这个答案中给出的信息有关:使用无头chrome而不是htmunitdriver