Java WebDriverException:进程尚未退出,因此没有可用的结果

Java WebDriverException:进程尚未退出,因此没有可用的结果,java,selenium,selenium-webdriver,selenium-chromedriver,Java,Selenium,Selenium Webdriver,Selenium Chromedriver,我在一些测试中遇到了这个异常: org.openqa.selenium.WebDriverException:进程尚未退出 因此,没有可用的结果。。。 命令持续时间或超时:39.78秒 构建信息:版本:“2.53.1”,版本:“A36B8B1CD57277168E54B817830ADCE9B0158D”,时间:“2016-06-30” 19:26:09' 系统信息:主机:“WIN-08RDCDUO0CH”,ip:“xx.xx.xx.xx”,os.name:“Windows Server 201

我在一些测试中遇到了这个异常:

org.openqa.selenium.WebDriverException:进程尚未退出 因此,没有可用的结果。。。 命令持续时间或超时:39.78秒 构建信息:版本:“2.53.1”,版本:“A36B8B1CD57277168E54B817830ADCE9B0158D”,时间:“2016-06-30” 19:26:09' 系统信息:主机:“WIN-08RDCDUO0CH”,ip:“xx.xx.xx.xx”,os.name:“Windows Server 2012 R2”,os.arch:“amd64”,os.version:“6.3”, java.version:'1.8.0_121' 驱动程序信息:org.openqa.selenium.remote.RemoteWebDriver

Chrome驱动程序功能:

chromeOptions = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("profile.default_content_settings.popups", 0);
prefs.put("download.default_directory", 
System.getProperty("user.dir") + "\\resources\\downloads");
chromeOptions.setExperimentalOption("prefs", prefs);
chromeOptions.addArguments("--start-maximized");
webCapabilities = DesiredCapabilities.chrome();
webCapabilities.setCapability(ChromeOptions.CAPABILITY, 
chromeOptions);
chromeOptions=新的chromeOptions();
Map prefs=新的HashMap();
prefs.put(“profile.default\u content\u settings.popups”,0);
prefs.put(“download.default_目录”,
System.getProperty(“user.dir”)+“\\resources\\downloads”);
设置实验选项(“prefs”,prefs);
addArguments(“--start最大化”);
webCapabilities=DesiredCapabilities.chrome();
webCapabilities.setCapability(ChromeOptions.CAPABILITY,
铬离子);
我更改了Chrome驱动程序和Selenium版本,但运气不好。
请提前给予帮助和感谢。

使用任何WebDriver时,如果遇到任何问题,您需要重新访问3个地方:

  • 您在何处以及如何初始化WebDriver
  • 您定义了哪些选项或功能?它们有效吗
  • 如何以及何时关闭WebDriver实例
  • 在问题中,你只提到了第2点的细节。最好有一个更新的问题,提到关于第1点和第3点的细节

    尽管如此,对于活动实例,必须使用
    .close()
    终止web驱动程序实例,对于所有实例,必须使用
    .quit()
    终止。

    在Windows任务管理器进程部分可以看到chrome驱动程序无效故障终止的迹象,在该部分中,您将看到多个
    chromedriver.exe
    进程正在运行,即使没有浏览器处于活动/打开状态

    在这种情况下,您可以执行一个shell脚本来终止所有
    chromedriver.exe
    进程:


    TASKKILL/IM“chromedriver.exe”/F

    有时会发生这种情况。再次加载库并重新启动eclipse,如果可能,也重新启动计算机。我做了同样的事情,效果也不错。嗨@SiddheshKalgaonkar,谢谢你的评论。对我来说,每次运行后重启机器不是一个理想的解决方案。要重新启动AWS实例,需要很长时间才能准备好实例并启动服务。