gpt4 book ai didi

java - WebDriver异常: The process has not exited yet therefore no result is available

转载 作者:行者123 更新时间:2023-11-30 06:43:00 25 4
gpt4 key购买 nike

我在几次测试中遇到了这个异常:

org.openqa.selenium.WebDriverException: The process has not exited yet therefore no result is available ... Command duration or timeout: 39.78 seconds Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09' System info: host: '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' Driver info: 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);

我更改了 Chrome 驱动程序和 Selenium 版本,但没有成功。请提前提供帮助并致谢。

最佳答案

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

  1. 您在何处以及如何初始化 WebDriver?
  2. 您正在定义哪些选项或功能?它们有效吗?
  3. 您如何以及何时关闭 WebDriver 实例?

在问题中,您仅提到了有关第 2 点的详细信息。如果有更新的问题提及有关第 1 点和第 3 点的详细信息,那就太好了。

尽管如此,必须通过使用 .close() 对于 Activity 实例或 .quit() 来终止 Web 驱动程序的实例对于所有情况。

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

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

TASKKILL/IM“chromedriver.exe”/F

关于java - WebDriver异常: The process has not exited yet therefore no result is available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44106724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com