How to execute a test job continuously from outside or automate it

Nihar1991Nihar1991 Posts: 38
edited September 13 in Continuous Testing Platform

Hi Team,

I have a situation where I need to execute a test continuously for a long time.
for this, I have already created a test job and execute it by using rest API (/v2/jobs/{jobid}/histories).
But here I need to run it manually every time. I need a way where i can execute this rest API from the scheduler or by automation or any other approach.

can you please help me with this. I have attached below rest API for execute the job which I execute.

Req URL: http://10.12.73.31:8080/em/api/v2/jobs/299/histories
Response Body: {
"context": {
"environmentId": 22,
"environmentInstanceId": 30,
"systemId": 7
},
"id": 6,
"jobId": 299,
"jobName": "API_Hermes",
"status": "WAITING",
"testExecutionIds": [],
"username": "inarin01"
}

Appreciate your response here

Thanks
Nihar Arisal

Comments

  • Matt LoveMatt Love Posts: 48 admin
    edited September 14

    Hi Nihar,

    One way to execute this job continuously would be to call the REST API in a loop.
    Try something like this on Linux:
    while [ true ]; do curl --user admin:admin --header "Content-Type: application/json" --request POST --data '{}' http://10.12.73.31:8080/em/api/v2/jobs/1/histories?async=false ; sleep 60; done

Sign In or Register to comment.