Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

TestRail - Running tests from multiple projects in one test run


#1

Hi,

I’m new to testrail. I have 5 (c#) projects in my solution and each project has 10 tests. I would like to run few tests from each project in one test run. I’m using add_run to create new testrun on the fly and added testcases to the testrun successfully.

Is it possible?

Ex:
MyTestSloution
TestProject1 - 3 tests
TestProject2 - 2 tests
TestProject3 - 1 test
TestProject4 - 4 tests
TestProject5 - 5Tests

Any help much appreciated,
sara


#2

Hi Sara,

Thanks for your posting! A test run always belongs to a single project and can include cases from this project only. Do you have the option to use a single project instead of 5 projects? I’m asking as you can have thousands of tests/cases in a single project and is much more flexible to use a single project instead of multiple projects (for creating test runs, reports, etc.).

Cheers,
Tobias


#3

Thanks much for the quick response!!! Currently we don’t have the option to use single project. We have five different wsdl’s to test, so we created project for each wsdl’s (endpoint) that’s why we ended up having 5 instead of one :slight_smile:


#4

Hi Sara,

Ah okay, I understand :slight_smile: I would recommend creating multiple runs in this case, one per project, and a run is always linked to single project.

Cheers,
Tobias


#5

Hi Tobias,

I felt like i’m not clear about c# project and TestRail project in my previous post. Hence i’m posting again with more details. Right now we created Testrun and Test cases manually in testrail and updating our test results to TestRail using add_result_for_case from our C# code.

We want to take it one step further to create TestRun on the fly using TestRailAPI add_run method from our test C# code and update testcase results in that testrun which is combination of test cases from various C# projects. Also some tests exist in completely different solution (C#).

C#
MyTestSloution1
TestProject1 (c#) - 3 tests (Nunit)
TestProject2 (c#) - 2 tests (Nunit)
TestProject3 (c#) - 1 test (Nunit)
TestProject4 (C#) - 4 tests (Nunit)

C#
MyTestSolution2
TestProject5 (C#) - 2Tests (Nunit)

Current set up in TestRail:

DevOps (Test Project we created manually)
Clicking TestRuns & Results menu and then clicking Test Run High priority Small set ( Test Run which we created manually) will display:

R3235 High Priority Small Set
ID Title Assigned To Status
T6886 Testcase1 Passed
T6887 Testcase2 Failed
T6888 Testcase3 Failed
T6889 Testcase4 Failed
T6920 Testcase5 Passed
T6921 Testcase6 Passed
T6922 Testcase7 Passed
T7219 Testcase8 Passed
T7221 Testcase9 Passed
T7477 Testcase10 Passed
T7478 Testcase11 Passed
T7479 Testcase12 Passed

Clicking Test Suites & Cases menu and clicking “High Priority Small Set” will display:

Test Cases (12)
ID Title
C3900 Testcase1
C3901 Testcase2
C3902 Testcase3
C3903 Testcase4
C3940 Testcase5
C3941 Testcase6
C3942 Testcase7
C4101 Testcase8
C4112 Testcase9
C4161 Testcase10
C4162 Testcase11
C4163 Testcase12

We combined tests(Nunit) from different c# project in one TestRun:
TestCase1, TestCase2, TestCase3 belong to TestProject1
TestCase4, TestCase5 belong to TestProject2
TestCase6 belong to TestProject3
TestCase7, TestCase8, TestCase9, TestCase10 belong to TestProject4
TestCase11, TestCase12 belong to TestProject 5 (Different C# solution)

Please confirm once again that it’s doable or not.

Thanks,
sara


#6

Hi Sara,

The idea is to store the test case IDs together with your tests in C# and then submit test results via add_result_for_case. I believe you are doing this already. To also create the test runs with add_run dynamically, you would also need to store the project ID with your C# tests and can then call add_run with this project ID. The response of add_run includes the run ID you need to submit test results with add_result_for_case.

Cheers,
Tobias