Enrico
Enrico

Reputation: 6202

Add more instances to Selenium Docker

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.

Upvotes: 5

Views: 4532

Answers (1)

Alexey R.
Alexey R.

Reputation: 8676

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.

Upvotes: 9

Related Questions