Selenium Grid 4 + playwright (browser library)

Hi I’m trying to get playwright to work with grid 4.
I’m using kubernetes as orchestration. GitHub - SeleniumHQ/docker-selenium: Docker images for the Selenium Grid Server this repo is used for helm deployment (charts/)

I’m struggling to get this running. All I get is that playwright opens chrome, chrome is immediately closed and session is deleted from hub . Also robot framework test is stuck and it will never finish.

I can’t find anything valuable in the logs. I tried to use old selenium (robotframework-seleniumlibrary) test to find out if the problem is in playwright. I found out that old tests are running without issued.

Had anybody facing the same issues?

What did you do to connect to Grid?

Which env var did you set?

I set all according to link you provided
I found out that grid is working, new session is started,
afterwards chrome is opened, and closed… session is removed from grid , but tests are still ‘running’ and never timeouts.

I didn’t find out why chrome crashes, there is no information in log file… chromedriver starts chrome, and after few milliseconds i see:

<> is http in logs below

18:52:35.162 DEBUG [NettyRequestSender.pollPooledChannel] - Using pooled Channel ‘[id: 0x4e4f85dd, L:/127.0.0.1:57920 - R:localhost/127.0.0.1:60223]’ for ‘DELETE’ to ‘<>://localhost:60223/session/1a801f8f1a1138d9ccbe1f0064b6418e’

and session is destroyed.

logs from chromedriver:

18:41:04.481 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling <>://localhost:43692/status
Starting ChromeDriver 98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}) on port 43692
All remote connections are allowed. Use an allowlist instead!
18:41:04.503 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling <>://localhost:43692/status
18:41:04.556 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling <>://localhost:43692/status
ChromeDriver was started successfully.

I have no idea what more to check… I don’t know if this is a hint, but i found out that, if I’m using playwright or selenium, this is in the log:

18:41:09.359 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C

Also, I tryied to remove all the default arguments that are send by playwright, but it looks like:

NewBrowser … ignoreDefaultArgs=[“–remote-debugging-port=0”] …

does not working, all arguments are sent even if I ignore them. Maybe it is one of them that cause chrome crash, but I cant’ find it out…

(I also tried to ignore with, and without --, with and withou = with zero success.

the problem was that you need to expose a additional 5555 port and add some environment values

SE_NODE_GRID_URL:  <point to hub url>:4444/wd/hub
SE_NODE_PORT: "5555"

and service type should be ‘NodePort’, not ‘ClusterIP’

after this, I was able to connect and run tests against selenium grid in k8s environment

Could you please share your docker-compose file

Hi…

i’m no longer working in company, where I needed to do this. But as I remember, we were just using selenium helm from the oficial sources.

You just need to extend environement variables with this 2 ,
expose addional port, and change service to nodeport.

Everything can be done in values.yaml file that comes with selenium helm chart