简体   繁体   English

线程“ main” org.openqa.selenium.WebDriverException中的异常:未知错误:Chrome无法启动:正常退出

[英]Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally

I am trying to Automate a regular procedure using Java with Selenium. 我正在尝试使用带有Selenium的Java自动执行常规过程。 I tried to use Chrome as my browser. 我试图使用Chrome浏览器。 But I am getting an error and can't able to load the browser. 但是我遇到错误,无法加载浏览器。

Below is the error: 下面是错误:

Starting ChromeDriver (v2.3) on port 52793 Exception in thread "main"
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally (Driver info:  chromedriver=2.3,platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 22.50 seconds Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:03:00'

Chrome version used : Version 63.0.3239.132 (Official Build) (64-bit) 使用的Chrome版本 :63.0.3239.132版(官方内部版本)(64位)

Code used: 使用的代码:

public static void main(String[] args) throws Throwable {   
System.setProperty("webdriver.chrome.driver", "D:\\Automation\\Thomas_Auto\\Driver\\chromedriver.exe");

ChromeDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://vrijuit.nl/nl/vakanties");
driver.findElement(By.cssSelector("i.basic-sprite.date")).click();
driver.findElement(By.xpath("(//a[contains(text(),'1')])[56]")).click();
driver.findElement(By.cssSelector("a.ui-state-default.ui-state-active.ui-state-hover")).click();
driver.findElement(By.linkText("info & prijs")).click();
driver.findElement(By.cssSelector("input.btn.btn-select")).click();
driver.findElement(By.cssSelector("button.btn-call-to-action")).click();

enter image description here 在此处输入图片说明

It seems your ChromeDriver doesn't support driver.manage().window().maximize(); 看来您的ChromeDriver不支持driver.manage().window().maximize();

Try ChromeOptions to achieve the same ...eg 尝试使用ChromeOptions实现相同的效果...例如

System.setProperty("webdriver.chrome.driver","D://Automation/Thomas_Auto/Driver/chromedriver.exe");
        ChromeOptions chromeOptions = new ChromeOptions();
        chromeOptions.addArguments("disable-infobars");
        chromeOptions.addArguments("start-maximized");
        driver = new ChromeDriver(chromeOptions);

Update your ChromeDriver and chrome to latest version and try again. 将您的ChromeDriver和Chrome更新到最新版本,然后重试。

I ran your code with ChromeDriver version 2.35 and chrome Version 64.0.3282.140 (Official Build) (64-bit) on my environment and there was no issue. 我在我的环境中使用ChromeDriver 2.35版和chrome 64.0.3282.140版(正式版本)(64位)运行了您的代码,没有任何问题。

You can disable extensions via chromeoptions. 您可以通过chromeoptions禁用扩展名。

    ChromeOptions options = new ChromeOptions();
    options.addArguments("chrome.switches","--disable-extensions");
    ChromeDriver driver=new ChromeDriver(options);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 线程“主” org.openqa.selenium.WebDriverException中的异常:无法访问Chrome - Exception in thread “main” org.openqa.selenium.WebDriverException: chrome not reachable org.openqa.selenium.WebDriverException:未知错误:chrome 无法通过 Java 开始使用 Selenium ChromeDriver 和 Chrome - org.openqa.selenium.WebDriverException: unknown error: chrome failed to start using Selenium ChromeDriver and Chrome through Java 线程“主”org.openqa.selenium.WebDriverException 中的异常:未知错误:使用 Selenium Java 的意外命令响应 - Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: unexpected command response using Selenium Java org.openqa.selenium.WebDriverException:未知错误:Chrome无法启动:崩溃(无头Chrome) - org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed (headless chrome) 线程“主” org.openqa.selenium.WebDriverException中的异常:未知错误:无法聚焦元素 - Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: cannot focus element 线程“main” org.openqa.selenium.WebDriverException 中的异常:未知错误:无法获得自动化扩展 - Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension Chrome 浏览器中的 Selenium 在线程“main”org.openqa.selenium.WebDriverException 中显示异常:等待驱动程序服务器启动超时 - Selenium in Chrome browser shows Exception in thread “main” org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start 线程“主”org.openqa.selenium.WebDriverException 中的异常:未知错误:使用 Selenium 单击时无法确定加载状态错误 - Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status error while clicking using Selenium 线程“主” org.openqa.selenium.WebDriverException中的异常:未定义$ - Exception in thread “main” org.openqa.selenium.WebDriverException: $ is not defined 线程“主”org.openqa.selenium.WebDriverException 中的异常:权限被拒绝 - Exception in thread “main” org.openqa.selenium.WebDriverException: permission denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM