cancel
Showing results for 
Search instead for 
Did you mean: 

Disable testcases in a particular environment

Highlighted
Contributor

Disable testcases in a particular environment

Hi

 

I have a testsuite with some testcases (REST services) and 3 environments.

 

Env1

Env2

Env3

 

When I select Env1 or Env2, and run my testsuite, all the testcases should be executed.

But few tests are not applicable to Env3. When I select Env3, and run the testsuite, few of my testcases/teststeps should not get executed (like disabled state).

 

how do I handle this? I have around 100 tests and have to disable around 10 - 20 tests for Env3.

1 REPLY 1
Highlighted
Community Hero

Re: Disable testcases in a particular environment

You should be able to do it. However, there should be a list for each environment which ones to be enabled or disabled.
for eg: below line of code is to enable, and opposite for disable of a test step.
testStep.disabled = false

For instance you may also use system variables like -Denvironment=QA

Put this in a project load script on meeting conditions you needed.
if QA enable this list
else Dev enable this list
else enable this list.



Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors