serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
720 stars 519 forks source link

Unable to run serenity tests on Selenium Grid 4 #2663

Open vasyafomiuk opened 2 years ago

vasyafomiuk commented 2 years ago

I'm using Serenity version 3.1.15 and Selenium Grid 4.1.1. For some reason I'm getting error during test execution:

Jan 10, 2022 9:53:35 AM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer INFO: Using OpenTelemetry for tracing Jan 10, 2022 9:53:40 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C Jan 10, 2022 9:53:40 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch INFO: Found exact CDP implementation for version 96 Jan 10, 2022 9:53:50 AM org.openqa.selenium.remote.http.netty.NettyWebSocket lambda$new$0 WARNING: connection timed out: /172.26.0.7:4444 java.net.ConnectException: connection timed out: /172.26.0.7:4444 at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179) at org.asynchttpclient.netty.channel.NettyChannelConnector$1.onFailure(NettyChannelConnector.java:108) at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:28) at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:20) at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:262) at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /172.26.0.7:4444

I've tried to run tests with a plain selenium WebDriver (ver 4.1.1) + Cucumber (ver 7.2.2) and it worked. link of the project https://github.com/vasyafomiuk/demo-project

Did anyone try to run tests on grid 4 with Serenity? Thank you in advance

wakaleo commented 2 years ago

Could be some kind dependency version issue. There's no Serenity code in that stack trace, so hard to say.

vasyafomiuk commented 2 years ago

Jan 10, 2022 10:36:46 AM org.openqa.selenium.remote.http.WebSocket$Listener onError WARNING: connection timed out: /172.26.0.5:4444 java.net.ConnectException: connection timed out: /172.26.0.5:4444 at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179) at org.asynchttpclient.netty.channel.NettyChannelConnector$1.onFailure(NettyChannelConnector.java:108) at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:28) at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:20) at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:262) at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /172.26.0.5:4444 at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261) ... 9 more

net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate class org.openqa.selenium.remote.RemoteWebDriver

at net.thucydides.core.webdriver.WebDriverFacade.newDriverInstance(WebDriverFacade.java:144)
at net.thucydides.core.webdriver.WebDriverFacade.newProxyDriver(WebDriverFacade.java:132)
at net.thucydides.core.webdriver.WebDriverFacade.getProxiedDriver(WebDriverFacade.java:102)
at net.thucydides.core.webdriver.WebDriverFacade.get(WebDriverFacade.java:172)
at com.cydeo.platform.steps.ui.LoginSteps.openLoginPage(LoginSteps.java:10)
at com.cydeo.platform.steps.ui.LoginSteps$ByteBuddy$5nZTaF5E.openLoginPage$accessor$ktbdc3V6(Unknown Source)
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 net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:504)
at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:484)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:458)
at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:210)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:197)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:85)
at net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:51)
at com.cydeo.platform.steps.ui.LoginSteps$ByteBuddy$5nZTaF5E.openLoginPage(Unknown Source)
at com.cydeo.platform.step_definitions.ContentsStepDefinitions.is_on_the_page(ContentsStepDefinitions.java:44)
vasyafomiuk commented 2 years ago

Could be some kind dependency version issue. There's no Serenity code in that stack trace, so hard to say.

I hope that stack trace will give more details. On the grid side it's seeing the request nut nothing happens

wakaleo commented 2 years ago
net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate class org.openqa.selenium.remote.RemoteWebDriver

Is there anything after that?

vasyafomiuk commented 2 years ago

ionError: Co

net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate class org.openqa.selenium.remote.RemoteWebDriver

at net.thucydides.core.webdriver.WebDriverFacade.newDriverInstance(WebDriverFacade.java:144) at net.thucydides.core.webdriver.WebDriverFacade.newProxyDriver(WebDriverFacade.java:132) at net.thucydides.core.webdriver.WebDriverFacade.getProxiedDriver(WebDriverFacade.java:102) at net.thucydides.core.webdriver.WebDriverFacade.get(WebDriverFacade.java:172) at platform.steps.ui.LoginSteps.openLoginPage(LoginSteps.java:10) at platform.steps.ui.LoginSteps$ByteBuddy$5nZTaF5E.openLoginPage$accessor$ktbdc3V6(Unknown Source) 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 net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:504) at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:484) at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:458) at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:210) at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:197) at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:85) at net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:51) at platform.steps.ui.LoginSteps$ByteBuddy$5nZTaF5E.openLoginPage(Unknown Source) at platform.step_definitions.ContentsStepDefinitions.is_on_the_page(ContentsStepDefinitions.java:44) at ✽."moderator" is on the "Courses" page(file:///C:/Users/user/Documents/GitHub/platfrom-automated-tests/src/test/resources/features/ui/admin/courses/CourseActions.feature:6) Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.remote.RemoteWebDriver (Unable to establish websocket connection to http://172.26.0.5:4444/session/70b3d1363b937ab928b90399eaa8ee13/se/cdp Build info: version: '4.1.1', revision: 'e8fcc2cecf' System info: host: 'DESKTOP-A8NQN2A', ip: '172.20.160.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.13' Driver info: driver.version: unknown). See below for more details. at net.thucydides.core.webdriver.WebDriverFactory.newWebdriverInstance(WebDriverFactory.java:146) at net.thucydides.core.webdriver.WebDriverFacade.newDriverInstance(WebDriverFacade.java:141) at net.thucydides.core.webdriver.WebDriverFacade.newProxyDriver(WebDriverFacade.java:132) at net.thucydides.core.webdriver.WebDriverFacade.getProxiedDriver(WebDriverFacade.java:102) at net.thucydides.core.webdriver.WebDriverFacade.get(WebDriverFacade.java:172) at steps.ui.LoginSteps.openLoginPage(LoginSteps.java:10) at steps.ui.LoginSteps$ByteBuddy$5nZTaF5E.openLoginPage$accessor$ktbdc3V6(Unknown Source) 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 net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:504) at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:484) at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:458) at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:210) at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:197) at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:85) at net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:51)

wakaleo commented 2 years ago
Could not instantiate new WebDriver instance of type class org.openqa.selenium.remote.RemoteWebDriver (Unable to establish websocket connection to http://172.26.0.5:4444/session/70b3d1363b937ab928b90399eaa8ee13/se/cdp

That's a Selenium error message. If you can figure out what that is about, you might be able to figure out what needs doing.

vasyafomiuk commented 2 years ago
Could not instantiate new WebDriver instance of type class org.openqa.selenium.remote.RemoteWebDriver (Unable to establish websocket connection to http://172.26.0.5:4444/session/70b3d1363b937ab928b90399eaa8ee13/se/cdp

That's a Selenium error message. If you can figure out what that is about, you might be able to figure out what needs doing.

Got it. Thanks a lot for your prompt response!

patrykost commented 2 years ago

Hi @wakaleo, I'm facing the same issue and with serenity 2.x it works fine.

wakaleo commented 2 years ago

Serenity 2.x uses Selenium 3, Serenity 3.1.15 uses Selenium 4. There may be something extra that's needed. If it is an important for you, havea look in the code and see if you can find a fix and propose a PR.

szead commented 2 years ago

Hi @wakaleo,

Unfortunately we have the same issue with the exact same versions mentioned by @vasyafomiuk.

Jan 10, 2022 1:47:17 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
Jan 10, 2022 1:47:21 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Jan 10, 2022 1:47:21 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found exact CDP implementation for version 96
Jan 10, 2022 1:47:31 PM org.openqa.selenium.remote.http.netty.NettyWebSocket lambda$new$0
WARNING: connection timed out: /172.19.0.20:4444
java.net.ConnectException: connection timed out: /172.19.0.20:4444
    at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179)
    at org.asynchttpclient.netty.channel.NettyChannelConnector$1.onFailure(NettyChannelConnector.java:108)
    at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:28)
    at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:20)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
    at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
    at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609)
    at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:262)
    at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
    at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /172.19.0.20:4444
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)

We downgraded back to Serenity 3.0.5 and Selenium hub image: 3.141.59-20210913 as a workaround.

wakaleo commented 2 years ago

It would appear to be related to Selenium 4. I don't know when I can look into this, but feel free to have a dig and propose a PR.

wakaleo commented 2 years ago

This appears to be a Selenium 4 grid error. I can't reproduce any issues running Serenity 3.1.15 on Selenium Grid 4.

wakaleo commented 2 years ago

Closing due to lack of activity.

szead commented 2 years ago

Hi @vasyafomiuk, Could you make it work for you? We still have this issue. Same issue which is mentioned above in serenity-cucumber-starter: Remote driver doesn't work with version 3.2.0

wakaleo commented 2 years ago

This appears to be related to the latest version of Selenium. Can you provide a sample project and Selenium Grid setup to reproduce the issue?

szead commented 2 years ago

This appears to be related to the latest version of Selenium. Can you provide a sample project and Selenium Grid setup to reproduce the issue?

@wakaleo I fork the serenity-cucumber-starter and write the instructions in the README.md Let me know if you have any questions.

Find it here: https://github.com/szead/serenity-cucumber-starter

schup commented 2 years ago

I have the same problem with Serenity BDD 3.2.0 and selenium/standalone-chrome:4.1.2 running in docker.

Create session returns back the docker internal IP for CDP (Chrome Developer Tools).

(Response: SessionID: b6e5a8e84c195b9fd2dee977663beadc, Status: 0, Value: {acceptInsecureCerts=false, autodownload=false, browserName=chrome, browserVersion=98.0.4758.102, chrome={chromedriverVersion=98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}), userDataDir=/tmp/.com.google.Chrome.YgxGQT}, driver=remote, goog:chromeOptions={debuggerAddress=localhost:46641}, idle-timeout=180, networkConnectionEnabled=false, pageLoadStrategy=normal, platformName=linux, proxy=Proxy(), remote.driver=chrome, remote.url=http://127.0.0.1:4444, se:cdp=ws://172.17.0.2:4444/session/b6e5a8e84c195b9fd2dee977663beadc/se/cdp, se:cdpVersion=98.0.4758.102, se:vnc=ws://172.17.0.2:4444/session/b6e5a8e84c195b9fd2dee977663beadc/se/vnc, se:vncEnabled=true, se:vncLocalAddress=ws://172.17.0.2:7900, setWindowRect=true, strictFileInteractability=false, timeouts={implicit=0, pageLoad=300000, script=30000}, unhandledPromptBehavior=dismiss and notify, webauthn:extension:credBlob=true, webauthn:extension:largeBlob=true, webauthn:virtualAuthenticators=true})

se:cdp=ws://172.17.0.2:4444/session/b6e5a8e84c195b9fd2dee977663beadc/se/cdp

This is then used when augmenting the WebDriver with capabilities (AndHasCdp) - which uses SeleniumCdpConnection with the incorrect URL. That's all happening in Selenium.

I haven't figured out yet how you can configure the selenium docker container to use the 'public' IP address for the standalone node in the create session response.

wakaleo commented 2 years ago

Can you make it work with an ordinary Selenium driver?

schup commented 2 years ago

When I tried using just selenium it worked fine but I did not use Augmenter

SerenityBDD does - return new Augmenter().augment(driver); in RemoteDriverProvider.newInstance.

wakaleo commented 2 years ago

Can you see if changing the code to not use the Augmenter would fix the issue?

schup commented 2 years ago

Yes, if I remove the line the test starts working. (Cucumber/Selenium/SerenityBDD)

public class RemoteDriverProvider implements DriverProvider {
   ...
        CapabilityEnhancer enhancer = new CapabilityEnhancer(environmentVariables, fixtureProviderService);
        DriverCapabilities remoteDriverCapabilities = new DriverCapabilities(environmentVariables, enhancer);

        WebDriver driver = new DefaultRemoteDriver(environmentVariables, remoteDriverCapabilities).buildWithOptions(options);
        //return new Augmenter().augment(driver);
        return driver;
schup commented 2 years ago

Would it be an option to include the Augmenter through a feature flag only - considering that it is a Beta feature?

wakaleo commented 2 years ago

Possibly, but I would like to do broader refacoring. What makes you think the Augmenter is a beta feature? It appears that code has been in the code base (and working correctly) since 2017, so prehaps something has changed in Selenium 4.

schup commented 2 years ago

I'm not really familiar with the Selenium code. While debugging the problem I noticed the Beta annotation on the class. https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/remote/Augmenter.java#L62

image
wakaleo commented 2 years ago

Interesting, the @Beta annotation was added two years ago, but the class has been around (and was the documented way of using the Remote driver) 5 years ago. I'm not sure what it does, so I will remove it or make it configurable in an upcoming release.

schup commented 2 years ago

The documentation might be outdated. The real issue is IMHO in selenium with the remote driver reporting back the internal docker IP instead of the 'public' IP.

I'll see what I can find out there.

spursbob commented 2 years ago

I think I am running into this issue trying to run Serenity tests with Selenium Grid 4 which is running in Docker. Running pytest-selenium works fine so not sure why this isn't working.

wakaleo commented 2 years ago

Looks like something that needs to be done in the remote driver setup in Serenity, possibly to work-around/cater for updates in the Selenium 4 grid code. At some point I will look into this. If you would like to look into this first and propose a pull request, the issue will probably get resolved faster.

spursbob commented 2 years ago

I think I am running into this issue trying to run Serenity tests with Selenium Grid 4 which is running in Docker. Running pytest-selenium works fine so not sure why this isn't working.

Not sure if I did have the same problem but adding "- SE_NODE_GRID_URL=http://localhost:4444" to my docker-compose seems to have resolved my particular issue.

version: "3"
services:

    chrome:
        image: selenium/node-chrome:4.1.2
        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

    selenium-hub:
        image: selenium/hub:4.1.2
        container_name: selenium-hub
        ports:
          - "4442:4442"
          - "4443:4443"
          - "4444:4444"
schup commented 2 years ago

Ah, I tried that and it didn't work - but I just realised I had a typo :-(

SE_NOD_GRID_URL instead of SE_NODE_GRID_URL.

So, starting the standalone-chrome using

docker run -d -p 4444:4444 --name standalone-chrome -p 7900:7900 --shm-size="2g" -e SE_OPTS="--log-level FINE" -e SE_NODE_GRID_URL="http://127.0.0.1:4444" -e SE_NODE_MAX_SESSIONS=10 -eSE_NODE_OVERRIDE_MAX_SESSIONS=true  selenium/standalone-chrome:4.1.2

When I create the session

curl --location --request POST 'localhost:4444/wd/hub/session' --header 'Content-Type: application/json; charset=utf-8' \ --data-raw '{ "desiredCapabilities": { "browserName": "chrome", "goog:chromeOptions": { "args": [ "--remote-debugging-port=9225" ] }, "goog:loggingPrefs": { "browser": "ALL", "driver": "ALL", "server": "ALL" } }, "capabilities": { "browserName": "chrome" } }'

The URL is correct now!

"se:cdp": "ws://127.0.0.1:4444/session/55ffeefd19e436a572eb2c6b467fe5dc/se/cdp",
szead commented 2 years ago

I also confirm that this workaround worked for me! 👍

remyanekkuth commented 2 years ago

@wakaleo @schup @vasyafomiuk I am also facing same issue intermittently when execute the code in grid 4. How to give SE_NODE_GRID_URL for non -docker file. I don't have a docker file. The node configrations are passed via toml file and the script in t windows batch file.

Using serenity 3.3.0 and selenium server 4.1.3

onkarvaidya commented 1 year ago

I know this is relatively old thread but I see issue is still open.

I am on the latest version of Serenity with Cucumber (3.4.3) and selenium grid 4. I was able to fix timeout issue by passing SE_NODE_GRID_URL parameter to my kubernetes cluster.