驱动程序信息:driver.version:使用ChromeDriver v78.0.3904.70和Chrome浏览器v78.0.3904.97未知

时间:2019-11-18 12:15:30

标签: java selenium google-chrome webdriver selenium-chromedriver

我正在将Java 1.8与Chrome浏览器版本78.0.3904.97一起使用。我正在尝试使用chrome驱动程序版本78.0.3904.70执行我的Selenium脚本代码。但是在执行过程中,我面临下面的问题,镀铬层会立即出现

Picked up JAVA_TOOL_OPTIONS: -Djdk.http.auth.tunneling.disabledSchemes=""
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

如果您查看下面的日志,那么您将了解我正在传递版本为chrome的78.0.3904.70,并尝试启动创建问题的chrome浏览器78.0.3904.97。另外,如果您选中https://chromedriver.chromium.org/downloads链接,则会了解到chrome驱动程序的78.0.3904.97版本不可用

错误日志

Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}) on port 22844
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Nov 18, 2019 12:06:32 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
12:06:32.350 [main] DEBUG net.serenitybdd.core.photography.Darkroom - Opening darkroom
12:06:32.360 [Darkroom Processing Line] DEBUG net.serenitybdd.core.photography.DarkroomProcessingLine - Darkroom processing line starting up
12:06:33.613 [main] DEBUG net.serenitybdd.core.photography.Darkroom - Send negative for processing for target\site\serenity\c5e0d5f762dd0408b347b1b56ece2682cce0d422c500276e3f33c78c87fadcf6.png
12:06:35.280 [main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - 


12:06:35.825 [main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - TEST FAILED AT STEP Launch browser and navigate to  URL
12:06:35.825 [main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - invalid argument



org.openqa.selenium.remote.UnreachableBrowserException: invalid argument
  (Session info: chrome=78.0.3904.97)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 78.0.3904.97, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: C:\Users\DIPAK~1.BAC\AppDat...}, goog:chromeOptions: {debuggerAddress: localhost:52359}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 22ece16d3a54371674e778dca702876b
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: unknown

    at webapplication.contactlenses.pages.Homepage.navigateToBaseUrlNL(Homepage.java:530)
    at webapplication.contactlenses.steplib.ContactLensSteplib.navigate_to_baseUrlNL(ContactLensSteplib.java:28)
    at webapplication.contactlenses.steplib.ContactLensSteplib$$EnhancerByCGLIB$$916d3a70.CGLIB$navigate_to_baseUrlNL$16(<generated>)
    at webapplication.contactlenses.steplib.ContactLensSteplib$$EnhancerByCGLIB$$916d3a70$$FastClassByCGLIB$$c8d6c80f.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:461)
    at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:446)
    at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:421)
    at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:176)
    at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:163)
    at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:69)
    at webapplication.contactlenses.steplib.ContactLensSteplib$$EnhancerByCGLIB$$916d3a70.navigate_to_baseUrlNL(<generated>)

我已经检查了chrome驱动程序版本78.0.3904.97,但不可用。有人可以指导我解决此问题。

2 个答案:

答案 0 :(得分:0)

Chromedriver版本应显示在日志中

 Driver info: driver.version: unknown 

您是否为chromedriver.exe设置了正确的路径。验证。

System.setProperty("webdriver.chrome.driver", "C:/PathToChromeDriver/chromedriver.exe");

答案 1 :(得分:-1)

此错误消息...

org.openqa.selenium.remote.UnreachableBrowserException: invalid argument
  (Session info: chrome=78.0.3904.97)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 78.0.3904.97, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: C:\Users\DIPAK~1.BAC\AppDat...}, goog:chromeOptions: {debuggerAddress: localhost:52359}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 22ece16d3a54371674e778dca702876b
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: unknown

...表示 ChromeDriver 无法启动/产生新的 WebBrowser ,即 Chrome浏览器会话。

您的主要问题是所使用的二进制版本之间的不兼容性

  • 尽管您使用的是 chromedriver = 78.0.3904.97
  • 您还使用了 chrome = 78.0.3904.97
  • 您的 Selenium Client 版本也是 3.141.59
  • 您的 JDK版本 1.8.0_131 ,这很古老。

因此 JDK v8u131 Selenium Client v3.141.59 ChromeDriver v78.0.3904.97 和< em> Chrome浏览器v78.0.3904.97


解决方案

确保:

  • JDK 已升级到当前级别JDK 8u222
  • 通过您的 IDE
  • 清理您的项目工作区重建您的项目,并且仅具有必需的依赖项。
  • 如果您的基本 Web客户端版本太旧,则将其卸载并安装最新版本的 Web客户端 GA。
  • 进行系统重启
  • 非root用户用户的身份执行@Test