SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.18k stars 8.11k forks source link

[šŸ› Bug]: Unable to establish websocket connection to http://x.x.x.x:4444/session/{sessionId}/se/cdp #11534

Closed jaca786 closed 1 year ago

jaca786 commented 1 year ago

What happened?

My objective is: to intract with Devtool API on Docker Selenium Grid

1) When running the script on Local system browser , My Approach is working fine 2) But when trying to execute my script on Remote, it is throwing below exception

Exception in thread "main" org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://localhost:4444/session/fc81683b-4a2c-405c-aa61-d17afa3ae011/se/cdp

Process finished with exit code 1

How can we reproduce the issue?

Created the Selenium Grid via docker-compose-v2.yml file
Triggered the Test script

Docker compose yaml file
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v2.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v2.yml down`
version: '2'
services:

  firefox:
    image: selenium/node-firefox:4.7.2-20221219
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_GRID_URL=http://localhost:4444/
    ports:
      - "6902:5900"

  selenium-hub:
    image: selenium/hub:4.7.2-20221219
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"

------------------------------------------------------

Test script

package io.invideo;

import org.openqa.selenium.ImmutableCapabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.v108.browser.Browser;
import org.openqa.selenium.devtools.v108.browser.model.Bounds;
import org.openqa.selenium.devtools.v108.browser.model.WindowID;
import org.openqa.selenium.devtools.v108.browser.model.WindowState;
import org.openqa.selenium.devtools.v108.log.Log;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Optional;

public class Test {

    public static void main(String[] args) throws MalformedURLException, InterruptedException {
        ImmutableCapabilities capabilities = new ImmutableCapabilities("browserName", "firefox");
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444"), capabilities);

        driver = new Augmenter().augment(driver);

        driver.get("https://www.duckduckgo.com");
        Thread.sleep(30000);
        DevTools devTools = ((HasDevTools) driver).getDevTools();
        devTools.createSession();

        devTools.send(Log.enable());
        devTools.send(Browser.setWindowBounds(new WindowID(1), new Bounds(
                Optional.of(20),
                Optional.of(20),
                Optional.of(20),
                Optional.of(20),
                Optional.of(WindowState.NORMAL))));

        driver.close();
        driver.quit();
    }
}

Relevant log output

/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=62413:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/abhisheshsingh/Documents/InvideoWorkspace/invideo-webAutomationFramework/target/classes:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-java/4.7.1/selenium-java-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-api/4.7.1/selenium-api-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-chrome-driver/4.7.1/selenium-chrome-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1.jar:/Users/abhisheshsingh/.m2/repository/com/google/auto/service/auto-service/1.0.1/auto-service-1.0.1.jar:/Users/abhisheshsingh/.m2/repository/com/google/auto/auto-common/1.2/auto-common-1.2.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-chromium-driver/4.7.1/selenium-chromium-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-json/4.7.1/selenium-json-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-devtools-v106/4.7.1/selenium-devtools-v106-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-devtools-v107/4.7.1/selenium-devtools-v107-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-devtools-v108/4.7.1/selenium-devtools-v108-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-devtools-v85/4.7.1/selenium-devtools-v85-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-edge-driver/4.7.1/selenium-edge-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-firefox-driver/4.7.1/selenium-firefox-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-http/4.7.1/selenium-http-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/dev/failsafe/failsafe/3.3.0/failsafe-3.3.0.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-ie-driver/4.7.1/selenium-ie-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-remote-driver/4.7.1/selenium-remote-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-buffer/4.1.84.Final/netty-buffer-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-codec-http/4.1.84.Final/netty-codec-http-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-codec/4.1.84.Final/netty-codec-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-handler/4.1.84.Final/netty-handler-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-common/4.1.84.Final/netty-common-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-classes-epoll/4.1.84.Final/netty-transport-classes-epoll-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-classes-kqueue/4.1.84.Final/netty-transport-classes-kqueue-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-native-epoll/4.1.84.Final/netty-transport-native-epoll-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-native-kqueue/4.1.84.Final/netty-transport-native-kqueue-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-native-unix-common/4.1.84.Final/netty-transport-native-unix-common-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport/4.1.84.Final/netty-transport-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-resolver/4.1.84.Final/netty-resolver-4.1.84.Final.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-api/1.19.0/opentelemetry-api-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-context/1.19.0/opentelemetry-context-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-exporter-logging/1.19.0/opentelemetry-exporter-logging-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk-metrics/1.19.0/opentelemetry-sdk-metrics-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk-logs/1.19.0-alpha/opentelemetry-sdk-logs-1.19.0-alpha.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-api-logs/1.19.0-alpha/opentelemetry-api-logs-1.19.0-alpha.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk-common/1.19.0/opentelemetry-sdk-common-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi/1.19.0/opentelemetry-sdk-extension-autoconfigure-spi-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk-extension-autoconfigure/1.19.0-alpha/opentelemetry-sdk-extension-autoconfigure-1.19.0-alpha.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-exporter-common/1.19.0/opentelemetry-exporter-common-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk-trace/1.19.0/opentelemetry-sdk-trace-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-sdk/1.19.0/opentelemetry-sdk-1.19.0.jar:/Users/abhisheshsingh/.m2/repository/io/opentelemetry/opentelemetry-semconv/1.19.0-alpha/opentelemetry-semconv-1.19.0-alpha.jar:/Users/abhisheshsingh/.m2/repository/io/ous/jtoml/2.0.0/jtoml-2.0.0.jar:/Users/abhisheshsingh/.m2/repository/net/bytebuddy/byte-buddy/1.12.18/byte-buddy-1.12.18.jar:/Users/abhisheshsingh/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar:/Users/abhisheshsingh/.m2/repository/org/asynchttpclient/async-http-client/2.12.3/async-http-client-2.12.3.jar:/Users/abhisheshsingh/.m2/repository/org/asynchttpclient/async-http-client-netty-utils/2.12.3/async-http-client-netty-utils-2.12.3.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-codec-socks/4.1.60.Final/netty-codec-socks-4.1.60.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-handler-proxy/4.1.60.Final/netty-handler-proxy-4.1.60.Final.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-native-epoll/4.1.60.Final/netty-transport-native-epoll-4.1.60.Final-linux-x86_64.jar:/Users/abhisheshsingh/.m2/repository/io/netty/netty-transport-native-kqueue/4.1.60.Final/netty-transport-native-kqueue-4.1.60.Final-osx-x86_64.jar:/Users/abhisheshsingh/.m2/repository/com/typesafe/netty/netty-reactive-streams/2.0.4/netty-reactive-streams-2.0.4.jar:/Users/abhisheshsingh/.m2/repository/com/sun/activation/jakarta.activation/1.2.2/jakarta.activation-1.2.2.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-manager/4.7.1/selenium-manager-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-safari-driver/4.7.1/selenium-safari-driver-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/seleniumhq/selenium/selenium-support/4.7.1/selenium-support-4.7.1.jar:/Users/abhisheshsingh/.m2/repository/org/testng/testng/7.7.0/testng-7.7.0.jar:/Users/abhisheshsingh/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:/Users/abhisheshsingh/.m2/repository/com/beust/jcommander/1.82/jcommander-1.82.jar:/Users/abhisheshsingh/.m2/repository/org/webjars/jquery/3.6.1/jquery-3.6.1.jar:/Users/abhisheshsingh/.m2/repository/com/aventstack/extentreports/5.0.9/extentreports-5.0.9.jar:/Users/abhisheshsingh/.m2/repository/io/reactivex/rxjava3/rxjava/3.0.4/rxjava-3.0.4.jar:/Users/abhisheshsingh/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar:/Users/abhisheshsingh/.m2/repository/org/freemarker/freemarker/2.3.30/freemarker-2.3.30.jar:/Users/abhisheshsingh/.m2/repository/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar:/Users/abhisheshsingh/.m2/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar:/Users/abhisheshsingh/.m2/repository/ru/yandex/qatools/ashot/ashot/1.5.4/ashot-1.5.4.jar:/Users/abhisheshsingh/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/abhisheshsingh/.m2/repository/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:/Users/abhisheshsingh/.m2/repository/org/apache/poi/poi-ooxml/3.10-FINAL/poi-ooxml-3.10-FINAL.jar:/Users/abhisheshsingh/.m2/repository/org/apache/poi/poi-ooxml-schemas/3.10-FINAL/poi-ooxml-schemas-3.10-FINAL.jar:/Users/abhisheshsingh/.m2/repository/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar:/Users/abhisheshsingh/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar:/Users/abhisheshsingh/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/abhisheshsingh/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/abhisheshsingh/.m2/repository/org/apache/poi/poi/3.10-FINAL/poi-3.10-FINAL.jar:/Users/abhisheshsingh/.m2/repository/commons-codec/commons-codec/1.5/commons-codec-1.5.jar:/Users/abhisheshsingh/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar:/Users/abhisheshsingh/.m2/repository/junit/junit/4.10/junit-4.10.jar:/Users/abhisheshsingh/.m2/repository/org/openpnp/opencv/4.5.5-0/opencv-4.5.5-0.jar:/Users/abhisheshsingh/.m2/repository/net/sf/sociaal/freetts/1.2.2/freetts-1.2.2.jar:/Users/abhisheshsingh/.m2/repository/org/mobicents/external/freetts/cmu_us_kal/1.0/cmu_us_kal-1.0.jar:/Users/abhisheshsingh/.m2/repository/io/github/automationreddy/java-slack-notify/1.2.0/java-slack-notify-1.2.0.jar:/Users/abhisheshsingh/.m2/repository/com/slack/api/slack-api-client/1.13.0/slack-api-client-1.13.0.jar:/Users/abhisheshsingh/.m2/repository/com/slack/api/slack-api-model/1.13.0/slack-api-model-1.13.0.jar:/Users/abhisheshsingh/.m2/repository/com/squareup/okhttp3/okhttp/4.9.2/okhttp-4.9.2.jar:/Users/abhisheshsingh/.m2/repository/com/squareup/okio/okio/2.8.0/okio-2.8.0.jar:/Users/abhisheshsingh/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.0/kotlin-stdlib-common-1.4.0.jar:/Users/abhisheshsingh/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.4.10/kotlin-stdlib-1.4.10.jar:/Users/abhisheshsingh/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Users/abhisheshsingh/.m2/repository/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar:/Users/abhisheshsingh/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/Users/abhisheshsingh/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/Users/abhisheshsingh/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/abhisheshsingh/.m2/repository/org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.jar:/Users/abhisheshsingh/.m2/repository/com/google/errorprone/error_prone_annotations/2.7.1/error_prone_annotations-2.7.1.jar:/Users/abhisheshsingh/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:/Users/abhisheshsingh/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/abhisheshsingh/.m2/repository/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar:/Users/abhisheshsingh/.m2/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar:/Users/abhisheshsingh/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/abhisheshsingh/.m2/repository/org/apache/httpcomponents/httpmime/4.5.13/httpmime-4.5.13.jar:/Users/abhisheshsingh/.m2/repository/com/aventstack/klov-reporter/5.0.9/klov-reporter-5.0.9.jar:/Users/abhisheshsingh/.m2/repository/org/mongodb/mongodb-driver/3.6.4/mongodb-driver-3.6.4.jar:/Users/abhisheshsingh/.m2/repository/org/mongodb/mongodb-driver-core/3.6.4/mongodb-driver-core-3.6.4.jar:/Users/abhisheshsingh/.m2/repository/org/mongodb/bson/3.6.4/bson-3.6.4.jar:/Users/abhisheshsingh/.m2/repository/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2.jar:/Users/abhisheshsingh/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/abhisheshsingh/.m2/repository/org/everit/json/org.everit.json.schema/1.5.1/org.everit.json.schema-1.5.1.jar:/Users/abhisheshsingh/.m2/repository/org/json/json/20160810/json-20160810.jar:/Users/abhisheshsingh/.m2/repository/commons-validator/commons-validator/1.5.1/commons-validator-1.5.1.jar:/Users/abhisheshsingh/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar:/Users/abhisheshsingh/.m2/repository/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar:/Users/abhisheshsingh/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/abhisheshsingh/.m2/repository/io/github/bonigarcia/webdrivermanager/5.3.1/webdrivermanager-5.3.1.jar:/Users/abhisheshsingh/.m2/repository/com/github/docker-java/docker-java/3.2.13/docker-java-3.2.13.jar:/Users/abhisheshsingh/.m2/repository/com/github/docker-java/docker-java-core/3.2.13/docker-java-core-3.2.13.jar:/Users/abhisheshsingh/.m2/repository/com/github/docker-java/docker-java-api/3.2.13/docker-java-api-3.2.13.jar:/Users/abhisheshsingh/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.10.3/jackson-annotations-2.10.3.jar:/Users/abhisheshsingh/.m2/repository/org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar:/Users/abhisheshsingh/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.10.3/jackson-databind-2.10.3.jar:/Users/abhisheshsingh/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.10.3/jackson-core-2.10.3.jar:/Users/abhisheshsingh/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar:/Users/abhisheshsingh/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar:/Users/abhisheshsingh/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar:/Users/abhisheshsingh/.m2/repository/com/github/docker-java/docker-java-transport-httpclient5/3.2.13/docker-java-transport-httpclient5-3.2.13.jar:/Users/abhisheshsingh/.m2/repository/com/github/docker-java/docker-java-transport/3.2.13/docker-java-transport-3.2.13.jar:/Users/abhisheshsingh/.m2/repository/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar:/Users/abhisheshsingh/.m2/repository/org/brotli/dec/0.1.2/dec-0.1.2.jar:/Users/abhisheshsingh/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar:/Users/abhisheshsingh/.m2/repository/org/apache/httpcomponents/client5/httpclient5/5.1.3/httpclient5-5.1.3.jar:/Users/abhisheshsingh/.m2/repository/org/apache/httpcomponents/core5/httpcore5/5.1.3/httpcore5-5.1.3.jar:/Users/abhisheshsingh/.m2/repository/org/apache/httpcomponents/core5/httpcore5-h2/5.1.3/httpcore5-h2-5.1.3.jar:/Users/abhisheshsingh/.m2/repository/mysql/mysql-connector-java/8.0.30/mysql-connector-java-8.0.30.jar:/Users/abhisheshsingh/.m2/repository/com/google/protobuf/protobuf-java/3.19.4/protobuf-java-3.19.4.jar io.invideo.Test
Jan 11, 2023 9:03:24 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
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.
Jan 11, 2023 9:03:52 PM org.openqa.selenium.remote.http.netty.NettyWebSocket lambda$new$0
WARNING: Remotely closed
org.asynchttpclient.exception.RemotelyClosedException: Remotely closed
    at org.asynchttpclient.exception.RemotelyClosedException.INSTANCE(Unknown Source)

Exception in thread "main" org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://localhost:4444/session/fc81683b-4a2c-405c-aa61-d17afa3ae011/se/cdp
Build info: version: '4.7.1', revision: 'c6795baf1a3'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '15.0.2'
Driver info: driver.version: unknown
    at org.openqa.selenium.remote.http.netty.NettyWebSocket.<init>(NettyWebSocket.java:102)
    at org.openqa.selenium.remote.http.netty.NettyWebSocket.lambda$create$3(NettyWebSocket.java:128)
    at org.openqa.selenium.remote.http.netty.NettyClient.openSocket(NettyClient.java:107)
    at org.openqa.selenium.devtools.Connection.<init>(Connection.java:78)
    at org.openqa.selenium.devtools.SeleniumCdpConnection.<init>(SeleniumCdpConnection.java:34)
    at org.openqa.selenium.devtools.SeleniumCdpConnection.lambda$create$0(SeleniumCdpConnection.java:56)
    at java.base/java.util.Optional.map(Optional.java:258)
    at org.openqa.selenium.devtools.SeleniumCdpConnection.create(SeleniumCdpConnection.java:54)
    at org.openqa.selenium.devtools.SeleniumCdpConnection.create(SeleniumCdpConnection.java:47)
    at org.openqa.selenium.devtools.DevToolsProvider.getImplementation(DevToolsProvider.java:50)
    at org.openqa.selenium.devtools.DevToolsProvider.getImplementation(DevToolsProvider.java:31)
    at org.openqa.selenium.remote.Augmenter.augment(Augmenter.java:179)
    at io.invideo.Test.main(Test.java:25)
Jan 11, 2023 9:03:52 PM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Remotely closed
org.asynchttpclient.exception.RemotelyClosedException: Remotely closed
    at org.asynchttpclient.exception.RemotelyClosedException.INSTANCE(Unknown Source)

Operating System

macos monterey

Selenium version

4.7.1

What are the browser(s) and version(s) where you see this issue?

Chrome-108 , Firebox-108

What are the browser driver(s) and version(s) where you see this issue?

Using SeleniumManager

Are you using Selenium Grid?

4.7.0

github-actions[bot] commented 1 year ago

@jaca786, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 1 year ago

Geckodriver also expects to see "moz:debuggerAddress", true. If you create an instance of FirefoxDriver it is set for you.

Also, it is recommended not to use driver.close() unless you are trying to close a single window, not end the session.

jaca786 commented 1 year ago

@titusfortner Thanks for looking into it. I have tried after adding the moz:debuggerAddress in my capabilites, still facing issue. Please find below logs

Jan 13, 2023 4:59:46 PM org.openqa.selenium.devtools.DevTools lambda$createSession$0 SEVERE: {"id":4,"error":{"message":"Log.clear","data":"RemoteAgentError@chrome://remote/content/cdp/Error.sys.mjs:20:5\nUnknownMethodError@chrome://remote/content/cdp/Error.sys.mjs:103:7\nexecute@chrome://remote/content/cdp/domains/DomainCache.sys.mjs:92:13\nreceiveMessage@chrome://remote/content/cdp/sessions/ContentProcessSession.sys.mjs:79:45\n"},"sessionId":"a94f8697-fc11-4d28-8754-b0895c3e6d33"} Build info: version: '4.7.2', revision: '4d4020c3b7' System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '15.0.2' Driver info: driver.version: unknown org.openqa.selenium.WebDriverException: {"id":4,"error":{"message":"Log.clear","data":"RemoteAgentError@chrome://remote/content/cdp/Error.sys.mjs:20:5\nUnknownMethodError@chrome://remote/content/cdp/Error.sys.mjs:103:7\nexecute@chrome://remote/content/cdp/domains/DomainCache.sys.mjs:92:13\nreceiveMessage@chrome://remote/content/cdp/sessions/ContentProcessSession.sys.mjs:79:45\n"},"sessionId":"a94f8697-fc11-4d28-8754-b0895c3e6d33"} Build info: version: '4.7.2', revision: '4d4020c3b7' System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '15.0.2' Driver info: driver.version: unknown

titusfortner commented 1 year ago

That is a duplicate of #10297 Firefox does not support Browser.setWindowBounds()

jaca786 commented 1 year ago

@titusfortner Thanks for the revert . I have tried with docker compose and it worked for chrome and firefox as well (for some sites.) But When i am trying the same by deploying it in kubernetes cluster , it is throwing error. Will cdp work inside kubernetes cluster as well?

https://github.com/kubernetes/examples/tree/master/staging/selenium I have used this yaml files while deploying inside kubernetes cluster and used the selenium-hub version as 4.7.2.

Please note:- I have tried with Deploying in kubernetes with helm chart as well as per below documentation. https://github.com/SeleniumHQ/docker-selenium/blob/trunk/charts/selenium-grid/README.md

Can you please check and let me know whether the CDP thing will work inside kubernetes cluster as well?

diemol commented 1 year ago

It should work as well. The right place to ask questions is https://www.selenium.dev/support/#ChatRoom