SoapUI Groovy: Disabling a test step within a test case

If you want to disable a specific test step that’s in all your test cases, at the Setup Script level for your TestSuite, here’s what you can do:

def totalTestCases = testSuite.getTestCaseCount();

for(n in (0..totalTestCases-1))	{    
 	if (testSuite.getTestCaseAt(n).getTestStepByName("MyTestStep")){
 			testSuite.getTestCaseAt(n).getTestStepByName("MyTestStep").setDisabled(true)
	 	}
}

Enjoy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s