Forum Discussion

hp's avatar
hp
New Contributor
11 months ago

How to filter the specific testcases from Testrail suite and add those into testrun

I'm implementing the script to integerate the Testcomplete and Testrail to update the results. I have successfully created the Testrun and can add the specific testcases to testrun by giving the caseIds. I have used Testrail API for this.

 

Qs: Now I want to add only specific testcases to testrun which is marked as "can_be_automated = yes" in the testrail suite, I stuck up on this part. Implemented some script for this but it is not taking up the specific testcases. Filtering "can_be_automated = yes" is not working. Using JavaScript

Referred previous post  but it is not related to my scenario.

 

Can someone help me on this please? If anyone have script, please share it will be helpful.

 

 

Thanks in advance

1 Reply

  • If you implemented creating a testrun and adding specific cases in that run, you should be able to go through the array of the cases returning by 

    get_cases/{project_id}&suite_id={suite_id}

    Do you see your flag "can_be_automated" in a case section in that array?

    ........
    "cases"
    : [ { "id": 1, "title": "..", }, { "id": 2, "title": "..", } ]
    .....