TestProject Forum
Powered by leading experts in the test automation community

How to run recorded tests in parallel?

I have a web test that takes one input parameter. I have added the test to a job and attached a data source with 10 values for the parameter. Now when I run the job it triggers my test 10 times in a sequence which is perfectly fine but it takes a lot of time. So the question is if it is possible to run these 10 executions in parallel.
I am running testproject agent on docker so I could easily have 10 agents but still I can only assign one agent to my job. Does that mean I cannot run such test cases in parallel?
How to achieve my goal with testproject?

Hello @lwyporek
You can just put the Job id in TP_JOB_ID variable in your docker compose file, once you run it using docker-compose up it will start the execution of the job in parallel.
Just add more agents to the yml file.
version: “3.1”

services:

testproject-agent-1:

image: testproject/agent:latest

container_name: testproject-agent

depends_on:

  - chrome

  - firefox

volumes:

  - .:/testproject/agent

environment:

  TP_JOB_ID: "JOB ID HERE"

  TP_API_KEY: "API KEY HERE"

  TP_JOB_PARAMS: '"jobParameters" : { "browsers" : ["Chrome"] }'

  CHROME: "chrome:4444"

  FIREFOX: "firefox:4444"

testproject-agent-2:

image: testproject/agent:latest

container_name: testproject-agent

depends_on:

  - chrome

  - firefox

volumes:

  - .:/testproject/agent

environment:

  TP_JOB_ID: "JOB ID HERE"

  TP_API_KEY: "API KEY HERE"

  TP_JOB_PARAMS: '"jobParameters" : { "browsers" : ["Chrome"] }'

  CHROME: "chrome:4444"

  FIREFOX: "firefox:4444"

chrome:

image: selenium/standalone-chrome

volumes:

  - /dev/shm:/dev/shm

firefox:

image: selenium/standalone-firefox

volumes:

  - /dev/shm:/dev/shm

@ran.tzur thank you for your answer but this is not what I wanted to achieve. Doing as you suggested results with my job being run twice (on both agents in parallel).
Instead of that I want to run my job only once but I want the (10) tests within the job to be run in parallel so the job could take 10 times less time.

@ran.tzur also I would not like to bind my agents to specific job. I would rather like them to be permanent instances that could be used by any job.