cancel
Showing results for 
Search instead for 
Did you mean: 

Disable testcases in a particular environment

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
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:
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win