Create test cases and test runs in TestRail: A test case management tool

Ishan mittal
5 min readJun 6, 2024

--

TestRail is one the well known testcase management tool where we can write our manual test cases in different formats like plain text, BDD steps. We can make different test runs/cycles for execution and update the status manually as per test case outputs(Passed, Failed, Blocked, Retest etc.)

In this article we’ll see that how can we write test cases , group the test cases, create test run for different test execution and finally update the status before giving any signoff in project.

TestRail

Lets jump into discussion………..
Step 1:
Create an account on TestRail. TestRail gives 30 days trail period. We’ll use the same.

Signup screen

Here, web Address is the address name which will be displayed in url once your account is created. So please keep a meaningful name.
A confirmation mail will be sent on Email, Your account will be created in few seconds after confirming email and you will be redirected to dashboard page.

Dashboard with web address in Url

Step 2: Project & Test case creation
a)
Create one project.

Create Project from Dashboard

b) Go to testcases section and click Add Test case

Add test cases under Test Cases section in project

c) Chose the template on test case screen:
c.1) Behavioral Driven Development (Here you can add Scenario in as testcase)
c.2) Exploratory (Mission and Goals of the test case are defined)
c.3) Test case Steps (Here test case is written step wise and expected result against each step is defined)
c.4) Test case Text (Here test case is written is single block and a single validation is defined)

d) Test case Steps is the popular one and we are going to use the same here for demo.
d.1) Add test case details (Test case name, Type, Priority, Assign to etc.)
d.2) Add test steps and expected result against each step (if required)
d.3) Finally click “add test case” and test will be added successfully.

d.1: Test case details
d.2: Test steps
d.3: Test case is saved

Similarly we can multiple test case as per the requirement. We can segregate or move test case to different folders as per the modules.

Test case segregation

All test cases will have unique ID. (eg. C1, C2…). This ID will be used in automation framework to update the status.
For demo , I have created one project “DummyJson_application” and added multiple test cases under two folders(API tests and UI tests) as shown in above picture.

Step 3: Create Test Run
Test Run is a kind of folder/group where we keep all the test cases we want to run under particular testing cycle. We can keep multiple test runs. Each run will have a unique run ID.”
Go to Test Runs & Results , Create one Test Run and add the test cases you want to execute under that run. For example, In current sprint , we want to run only API tests, So i have created one Test Run with name “Sprint_001_API_Test”.

There are different ways to add test cases in this Test Run:
a) Include all test cases ( selected by default)
b) Select specific test cases
c) Dynamic Filtering
I am using option ‘b’ and added all API tests under this Run. Once we create the Run, a unique Run id will be generated and displayed in Url (eg. Here the Test Run id is 2).This Run id will be used while integration in Automation framework.

Step 4: Initially status of all the test cases under Test Run is Untested. Once the team test those test, they will update the status as per the output of testcase (Passed, Failed, Blocked, Retest etc.). Tester can add comments , link defects while updating the status. There are multiple filters available. Team can use those as per requirement.

Update test case status with custom remarks

Additional Benifits:
a) A beautiful pie chart is given on the top, which helps to get the statistics of test case execution. Team can take further discussion/actions based on the pass percentage.

b) Team can track the history of any testcase by click on testcase title.

Test case execution history

c) Once all the test case has been executed and analyzed. Team can mark the Test Run completed by clicking lock icon on the top.

Click Lock icon to complete test run

Once you compete the test run, Status of test case is non-editable.

Test run marked completed

Similarly you can make different runs for different product lines, different regression cycles. Its all about the requirement.

Hope this article will be helpful for you. Keep exploring other features of TestRail (Like importing feature files, adding test data, adding pictures, Export reports, Email reports and many more..)

Please feel free to write in comments if you face any difficulty or finds any scope of improvement in the article.

In next article, We’ll learn how can we integrate our Test cases and test runs with our automation framework and how status will be automatically updated once we run our automation tests.

--

--