Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

505
Views
Using Docker, with Selenium and Pytest to run parallel tests

I'm trying to use these all things together to run parallel tests in a headless chrome:

Docker, Selenium, Pytest

However, I'm wondering where it makes sense to run the parallel part of the system?

Docker can do this (using selenium grid). Both these can be used to run parallel (and distributed) selenium tests. e.g.

https://github.com/elgalu/docker-selenium

https://github.com/zalando/zalenium

Also Pytest has its own way of running parallel tests (using pytest-xdist) e.g.

http://pytest.org/dev/xdist.html

Would it be easier to run 10 parallel pytest-xdist than running 10 docker containers?

I would be grateful to find out the advantages/disadvantages are for each.

Also, any idea how to use these things together? Information on this seems really sparse.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You create as much as you need/want containers then you will let know xdist IPs of containers and if you need UI tests then pytest has pytest-splinter and if you need bdd scenarios you can use pytest-bdd.

about 4 years ago · Santiago Trujillo Report

0

However, I'm wondering where it makes sense to run the parallel part of the system?

Each part will contribute for the parallelism to happen. You need Selenium HUB to orchestrate available browsers to run a test. You can have n browser running in headless mode, each one isolated in its own container.

Would it be easier to run 10 parallel pytest-xdist than running 10 docker containers?

Pytest will parallelize the test execution for you, bur not the instantiation and orchestration to the available browsers.

Summarizing:

Problem: You need to run UI (Selenium) tests in parallel. You will need N amount of browsers available to run this test.

Solution: You can start N nodes of headless chrome from docker. problem: You have 10 different connection options to give to your drivers in your tests.

Solution: Start selenium hub and let it manage these for you. So you have to concern with only one connection point and then it will give you the browser that is free to run that test.

Problem: You run you tests now and only one browser is being used. Solution: Use xdist to instruct pytest to run X amount of tests per time. X in this case can match with N number of browser available.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!