Add more instances to Selenium Docker
Asked Answered
L

1

5

I have downloaded Selenium Grid from a Docker compose, following the documentation. Now, I have all the images up and running.

enter image description here

Also, the UI is working.

enter image description here

For each browser, I have only one instance. I want to increment the number of instances for each browser. So, I can run parallel tests. I can't find the way to do that.

Lavender answered 2/3, 2021 at 13:41 Comment(0)
T
9

You need to add the environment variable SE_NODE_MAX_SESSIONS (former NODE_MAX_CONCURRENT_SESSIONS) for the node you would like to set the concurrency for.. For example:

  chrome:
    image: selenium/node-chrome:4.0.0-beta-1-20210215
    volumes:
      - /dev/shm:/dev/shm
    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_MAX_SESSIONS=5
    ports:
   

   - "6900:5900

So your UI would then look like:

enter image description here

P.S. - Here you can find the complete guide to Selenium Grid 4 configuration flags.

Transvalue answered 2/3, 2021 at 14:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.