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