This user guide article discusses the use of API to get the custom integration done with any popular or in-house test cases automation tool in TestCollab using API, here is what you would require:

  • An API token

  • One or more test cases that need to be automated

  • A test plan for the test cases, their assignees, test results and runs

  • Updating executed test cases that will hold the test case data and their execution logs (status, results, comments and attachments added at the time of execution)

You may or may not already have the test suite, test cases, test plans created in your project, this guide also includes the API endpoints that you may refer to add or update these entities if you do not want to add them using our webapp. So let us begin :

Acquiring an API token

An API token is required to make API calls. The token can be generated from user's profile; to obtain it , login to your TestCollab account and go to 'My Profile Settings' and switch to API Token tab. Click on "Generate new API token".


Note: While using API, you would need to keep track of IDs generated by TestCollab because they play an important role in creating/updating data.

Adding a test case that needs to be automated (Optional)

You may like to use API to get new test case(s) added in TestCollab that need automation, for this use the following endpoint - http://developers.testcollab.com/#operation/createTestCase


Tip: A common practice would be to either to have the test case tagged or set values for custom field(s) that identify the test case that needs to be automated, see attached request collection for more details

Adding a test plan (optional)

Having a test plan is mandatory when it comes to execution of test cases in TestCollab. If you do not have a test plan already created and want to use API for the purpose then you may refer - http://developers.testcollab.com/#operation/addTestPlan


An important part of test plan creation is assignment of test cases to team members, you can either add a new user or use an existing one as an assignee for automated test cases.


Adding test case(s) to test plan (optional)

Once test plan is in place its time to get the test cases added to it and assigned. This process is simple and straight forward using API but needs equal care.

API endpoint to use - http://developers.testcollab.com/#operation/bulkAddTestPlanTestCases


Get list of test cases added to test plan (to be executed)

If you do not have the test case IDs with you then use the following API endpoint to fetch the list of test cases added to test plan along with their IDs.

http://developers.testcollab.com/#operation/getTestPlanTestCases

If test cases are to be run more than once then there can be RUNs added to a test plan, so you may need to keep track of the current RUN that would be impacted as a result of test cases execution, by default at the time of creation of test plan first RUN is used.

A test plan can also have configurations based on the setup you use, so a configuration id also need to be considered while logging the test execution results.

Now, its time for real action...

With the list of test cases (to be executed) fetched, trigger the automation script with all the details and get them executed. When you have the execution results from your automation script, they now need to be populated back in TestCollab, so you need to update the executedtestcase record to populate the results along with that custom comments and valid files/ artefacts can also be uploaded to be part of execution log for the automated test case.

API endpoint to perform these operations is - http://developers.testcollab.com/#operation/updateExecutedTestCase

Note: Use the API token of the user who has been assigned the test cases, to populate and update the execution result.

Tip: Adding the results, custom comments, attaching files is also possible for individual test case step to form step wise results log. See request collection for more specific details.

Miscellaneous

Here are some more API endpoints that may be referred


Adding a test suite

To better organize the test cases that require automation you may like to have test suite(s) created - http://developers.testcollab.com/#operation/addSuite


Updating a test case that needs to be automated

You may also like to have pre-existing test case modified to have properties that make it a candidate for automation - http://developers.testcollab.com/#operation/updateTestCase

Get count of executed test cases

API endpoint to use - http://developers.testcollab.com/#operation/getExecutedTestCaseCount

Add a test case to a test plan

API endpoint to use - http://developers.testcollab.com/#operation/bulkAddExecutedTestCases


Did this answer your question?