0

我是 Selenium 独立码头工人的新手。使用 selenium webdriver、testng、java 在 docker 容器中运行 selenium 测试。

我正在尝试启动 selenium 独立浏览器并尝试在该实例上使用 driver.get(url)

docker-compose 文件如下所示 -

version: "3"
services:
      
  firefox:
    image: selenium/standalone-firefox:4.1.0
    hostname: firefox
    privileged: true
    shm_size: 2g
    ports:
      - "4444:4444"
      - "7900:7900"

在终端上我运行以下命令 -

sudo docker-compose -f docker-compose-frontend.yml up --build
Starting seleniumtestsrepo_firefox_1 ... done
Attaching to seleniumtestsrepo_firefox_1
firefox_1  | 2022-02-28 14:54:59,051 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
firefox_1  | 2022-02-28 14:54:59,052 INFO supervisord started with pid 9
firefox_1  | 2022-02-28 14:55:00,055 INFO spawned: 'xvfb' with pid 11
firefox_1  | 2022-02-28 14:55:00,056 INFO spawned: 'vnc' with pid 12
firefox_1  | 2022-02-28 14:55:00,058 INFO spawned: 'novnc' with pid 13
firefox_1  | 2022-02-28 14:55:00,059 INFO spawned: 'selenium-standalone' with pid 15
firefox_1  | Setting up SE_NODE_GRID_URL...
firefox_1  | 2022-02-28 14:55:00,064 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefox_1  | 2022-02-28 14:55:00,064 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefox_1  | 2022-02-28 14:55:00,064 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefox_1  | 2022-02-28 14:55:00,064 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefox_1  | Selenium Grid Standalone configuration: 
firefox_1  | [network]
firefox_1  | relax-checks = true
firefox_1  | 
firefox_1  | [node]
firefox_1  | session-timeout = "300"
firefox_1  | override-max-sessions = false
firefox_1  | detect-drivers = false
firefox_1  | max-sessions = 1
firefox_1  | 
firefox_1  | [[node.driver-configuration]]
firefox_1  | display-name = "firefox"
firefox_1  | stereotype = '{"browserName": "firefox", "browserVersion": "95.0", "platformName": "Linux"}'
firefox_1  | max-sessions = 1
firefox_1  | 
firefox_1  | Starting Selenium Grid Standalone...
firefox_1  | 14:55:00.367 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
firefox_1  | 14:55:00.371 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
firefox_1  | 14:55:00.795 INFO [NodeOptions.getSessionFactories] - Detected 8 available processors
firefox_1  | 14:55:00.825 INFO [NodeOptions.report] - Adding firefox for {"browserVersion": "95.0","browserName": "firefox","platformName": "Linux","se:vncEnabled": true} 1 times
firefox_1  | 14:55:00.839 INFO [Node.<init>] - Binding additional locator mechanisms: name, id, relative
firefox_1  | 14:55:00.854 INFO [LocalDistributor.add] - Added node ffa47ea8-5f21-40cf-bb6c-e0d42240dc99 at http://172.18.0.2:4444. Health check every 120s
firefox_1  | 14:55:00.855 INFO [GridModel.setAvailability] - Switching node ffa47ea8-5f21-40cf-bb6c-e0d42240dc99 (uri: http://172.18.01.2:4444) from DOWN to UP
firefox_1  | 14:55:00.954 INFO [Standalone.execute] - Started Selenium Standalone 4.1.0 (revision 87802e897b): http://172.18.01.2:4444

当我打开 -http://172.18.01.2:4444在 firefox 浏览器上,我看到 firefox selenium 已打开。

现在我尝试将以下代码作为 Run as Testng 测试运行 -

package com.vertica.mc.tests.common;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.Test;

public class LoginTests {

    @Test
    public void test() throws MalformedURLException
    {   
        WebDriver driver;
        String property = System.getProperty("browser","firefox");
        if(property.contains("firefox")) {
            FirefoxOptions fo = new FirefoxOptions();
            driver = new RemoteWebDriver(new URL("http://172.18.01.2:4444/"), fo);
            driver.get("www.google.com");
        }
    }
}

我得到以下两个错误 -

RemoteTestNG] detected TestNG version 7.5.0
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Feb 28, 2022 8:20:48 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
28.02.2022 20:20:49,005 DEBUG InternalLoggerFactory:76 - Using Log4J2 as the default logging framework
28.02.2022 20:20:49,021 DEBUG ResourceLeakDetector:129 - -Dio.netty.leakDetection.level: simple
28.02.2022 20:20:49,021 DEBUG ResourceLeakDetector:130 - -Dio.netty.leakDetection.targetRecords: 4
28.02.2022 20:20:49,024 DEBUG ResourceLeakDetectorFactory:196 - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@11ee02f8
28.02.2022 20:20:49,038 DEBUG PlatformDependent0:460 - -Dio.netty.noUnsafe: false
28.02.2022 20:20:49,039 DEBUG PlatformDependent0:954 - Java version: 11
28.02.2022 20:20:49,040 DEBUG PlatformDependent0:135 - sun.misc.Unsafe.theUnsafe: available
28.02.2022 20:20:49,040 DEBUG PlatformDependent0:159 - sun.misc.Unsafe.copyMemory: available
28.02.2022 20:20:49,041 DEBUG PlatformDependent0:202 - java.nio.Buffer.address: available
28.02.2022 20:20:49,041 DEBUG PlatformDependent0:282 - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
    at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:253) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:247) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:88) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:114) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:251) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:224) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:203) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at org.asynchttpclient.DefaultAsyncHttpClient.newNettyTimer(DefaultAsyncHttpClient.java:111) ~[async-http-client-2.12.3.jar:?]
    at org.asynchttpclient.DefaultAsyncHttpClient.<init>(DefaultAsyncHttpClient.java:90) ~[async-http-client-2.12.3.jar:?]
    at org.asynchttpclient.Dsl.asyncHttpClient(Dsl.java:32) ~[async-http-client-2.12.3.jar:?]
    at org.openqa.selenium.remote.http.netty.NettyClient.createHttpClient(NettyClient.java:105) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.http.netty.NettyClient.<clinit>(NettyClient.java:50) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.http.netty.NettyClient$Factory.createClient(NettyClient.java:146) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.tracing.TracedHttpClient$Factory.createClient(TracedHttpClient.java:77) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:107) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.createExecutor(RemoteWebDriver.java:188) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143) ~[selenium-remote-driver-4.1.2.jar:?]
    at com.vertica.mc.tests.common.LoginTests.test(LoginTests.java:20) ~[test-classes/:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:673) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128) ~[testng-7.5.jar:7.5]
    at java.util.ArrayList.forEach(ArrayList.java:1541) [?:?]
    at org.testng.TestRunner.privateRun(TestRunner.java:808) [testng-7.5.jar:7.5]
    at org.testng.TestRunner.run(TestRunner.java:603) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:429) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:423) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:383) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.run(SuiteRunner.java:326) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95) [testng-7.5.jar:7.5]
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1249) [testng-7.5.jar:7.5]
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) [testng-7.5.jar:7.5]
    at org.testng.TestNG.runSuites(TestNG.java:1092) [testng-7.5.jar:7.5]
    at org.testng.TestNG.run(TestNG.java:1060) [testng-7.5.jar:7.5]
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) [testng-remote.jar:?]
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) [testng-remote.jar:?]
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) [testng-remote.jar:?]
28.02.2022 20:20:49,051 DEBUG PlatformDependent0:350 - java.nio.Bits.unaligned: available, true
28.02.2022 20:20:49,052 DEBUG PlatformDependent0:414 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @45f45fa1
    at jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361) ~[?:?]
    at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:558) ~[?:?]
    at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:375) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:366) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:88) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:114) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:251) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:224) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:203) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
    at org.asynchttpclient.DefaultAsyncHttpClient.newNettyTimer(DefaultAsyncHttpClient.java:111) ~[async-http-client-2.12.3.jar:?]
    at org.asynchttpclient.DefaultAsyncHttpClient.<init>(DefaultAsyncHttpClient.java:90) ~[async-http-client-2.12.3.jar:?]
    at org.asynchttpclient.Dsl.asyncHttpClient(Dsl.java:32) ~[async-http-client-2.12.3.jar:?]
    at org.openqa.selenium.remote.http.netty.NettyClient.createHttpClient(NettyClient.java:105) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.http.netty.NettyClient.<clinit>(NettyClient.java:50) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.http.netty.NettyClient$Factory.createClient(NettyClient.java:146) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.tracing.TracedHttpClient$Factory.createClient(TracedHttpClient.java:77) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:107) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.createExecutor(RemoteWebDriver.java:188) ~[selenium-remote-driver-4.1.2.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143) ~[selenium-remote-driver-4.1.2.jar:?]
    at com.vertica.mc.tests.common.LoginTests.test(LoginTests.java:20) ~[test-classes/:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:673) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146) ~[testng-7.5.jar:7.5]
    at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128) ~[testng-7.5.jar:7.5]
    at java.util.ArrayList.forEach(ArrayList.java:1541) [?:?]
    at org.testng.TestRunner.privateRun(TestRunner.java:808) [testng-7.5.jar:7.5]
    at org.testng.TestRunner.run(TestRunner.java:603) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:429) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:423) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:383) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunner.run(SuiteRunner.java:326) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [testng-7.5.jar:7.5]
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95) [testng-7.5.jar:7.5]
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1249) [testng-7.5.jar:7.5]
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) [testng-7.5.jar:7.5]
    at org.testng.TestNG.runSuites(TestNG.java:1092) [testng-7.5.jar:7.5]
    at org.testng.TestNG.run(TestNG.java:1060) [testng-7.5.jar:7.5]
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) [testng-remote.jar:?]
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) [testng-remote.jar:?]
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) [testng-remote.jar:?]
    

另一个是——

8.02.2022 20:20:57,468 DEBUG Brotli:38 - brotli4j not in the classpath; Brotli support will be unavailable.
Feb 28, 2022 8:20:57 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
FAILED: test
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: 'ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.13.0-30-generic', java.version: '11.0.13'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}}]
Capabilities {}
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:576)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:161)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
    at com.vertica.mc.tests.common.LoginTests.test(LoginTests.java:20)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
    at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:673)
    at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220)
    at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
    at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945)
    at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193)
    at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
    at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.testng.TestRunner.privateRun(TestRunner.java:808)
    at org.testng.TestRunner.run(TestRunner.java:603)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:429)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:423)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:383)
    at org.testng.SuiteRunner.run(SuiteRunner.java:326)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1249)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
    at org.testng.TestNG.runSuites(TestNG.java:1092)
    at org.testng.TestNG.run(TestNG.java:1060)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap.of(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'
    at org.openqa.selenium.chrome.AddHasCasting.getAdditionalCommands(AddHasCasting.java:38)
    at org.openqa.selenium.remote.Dialect.lambda$bindAdditionalCommands$1(Dialect.java:80)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.openqa.selenium.remote.Dialect.bindAdditionalCommands(Dialect.java:79)
    at org.openqa.selenium.remote.Dialect.access$100(Dialect.java:29)
    at org.openqa.selenium.remote.Dialect$2.getCommandCodec(Dialect.java:54)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:51)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:558)
    ... 32 more


===============================================
    Default test
    Tests run: 1, Failures: 1, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Passes: 0, Failures: 1, Skips: 0
=========================

4

0 回答 0