API test job execution is not working

Hi Team,

I created a test job in CTP and when trying to execute, it shows waiting status and did not execute.
Can you please help me with this. Please let me know if any more details needed. Attached screenshot.

Thanks
Nihar Ranjan Arisal

Tagged:

Comments

  • Matt LoveMatt Love Posts: 48 admin

    Your screenshot shows an offline server in the execution group at IP address 10.12.208.82. This may have been registered by accident. Navigate to the SOAtest Server page and scroll down to the Execution Group table at the bottom of the page to remove it. Then just to be safe restart CTP to clear the job queue. If that doesn't work please contact Parasoft support for further assistance.

  • Nihar1991Nihar1991 Posts: 38

    Hi Matt,

    Thanks for your quick response and provide the solution. it works now.
    Can you please help me on how to execute that job continuously for 2 to 3 days with multiple runs.

    like I need to check these service performance and for that, i need to run this for more than 2 to 5 days with a maximum run just to check if any impact or service down in between.

    is there any way to do that.

    Appreciate your help here.

    Thanks
    Nihar

  • Matt LoveMatt Love Posts: 48 admin

    Hi Nihar,

    Parasoft CTP does not provide any built-in scheduling for test execution jobs. Instead you can use the REST API to trigger your job from your own scheduler or continuous integration pipeline. Go to Help > API Documentation within CTP to see the interactive REST API docs. Send an empty JSON {} payload request to POST /v2/jobs/{jobId}/histories to execute the job and create a new history for it. CTP will save all the job history for you to review any time.

    Best regards,
    Matt

  • Nihar1991Nihar1991 Posts: 38

    Hi Matt,

    Appreciate your response here.
    I am getting some error while doing the above procedure. I created job ID form GET /v2/jobs. and then run it with /v2/jobs/{jobId}/histories. but somehow I got below error.

    can you please help.

    http://10.12.73.31:8080/em/api/v2/jobs?name=HermesPnACheck&limit=50&offset=0

    {
    "jobs": [
    {
    "context": {},
    "fork": false,
    "historyCountLimit": 20,
    "historyDaysLimit": 2,
    "id": 297,
    "name": "HermesPnACheck",
    "testConfiguration": "",
    "testScenarioInstances": [
    {
    "id": 18,
    "priority": 0,
    "testScenarioId": 14,
    "variables": [
    {
    "key": "EndPoint",
    "type": "active"
    }
    ]
    }
    ]
    }
    ]
    }

    getting this when executed from /v2/jobs/{jobId}/histories
    {
    "status": 404,
    "message": "The system with id 0 was not found."
    }

    Thanks
    Nihar

  • Nihar1991Nihar1991 Posts: 38
    edited September 13

    Hi Matt,

    I am able to run it now. Thanks for your help.
    Also can you please help me with this below comment.

    "REST API to trigger your job from your own scheduler or continuous integration pipeline"

    Req URL: http://10.12.73.31:8080/em/api/v2/jobs/299/histories
    but I did not get the request body.

    How we can trigger the created API from scheduler or CIP.

    Thanks
    Nihar.

  • Matt LoveMatt Love Posts: 48 admin
    edited September 14

    Hi Nihar,

    One example of how to trigger this API remotely is to use the curl command in Linux.
    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

  • Nihar1991Nihar1991 Posts: 38

    Thanks, matt,

    I am able to execute from Jenkins periodically

    Thanks
    Nihar Arisal

Sign In or Register to comment.