0

I'm trying to run my selenium automation scripts in CI pipeline using Azure DevOps. I have configured Visual Studio test task to run my automation scripts by selecting test plan option.

Now it runs all my automation scripts which associates with test cases. But it does not take the order define in the test case.

How do we define the order to run test cases? Currently it is not running according to test cases order.

For Example: I have test cases: Test A, test B, test C. I want to run test in order B,C,A.

Thinkx
  • 129
  • 1
  • 10
  • Best practice is to have your tests able to run in any order. Why are you trying to control the test run order? – JeffC Apr 08 '19 at 04:33
  • Each test method contains functionality of a flow. Even though methods can be run individually data of each functionality will be dependent. That's why I need to run it in a particular order – Thinkx Apr 08 '19 at 04:44
  • Then those aren't independent tests. – JeffC Apr 08 '19 at 16:26
  • Yes. But data is dependent. My main concern is the order we mentioned in test plan, does it take in to consideration on executing automation scripts? – Thinkx Apr 09 '19 at 02:53
  • By using NUnit I was able to let test run in a particular order. But still I have maintain independence of executing tests. – Thinkx Oct 25 '19 at 04:55

2 Answers2

1

You may create a main test and use any order, something similar was considered here: Controlling execution order of unit tests in Visual Studio

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31
0

try this use TestNG annotations and run with Priority tag.