Ask a Question

How to implement logic at testsuite level ?

Regular Contributor

How to implement logic at testsuite level ?



Is there any way to implement logic at testSuite level ?

What I'm trying to achieve is to implement setup or teardown scripts feature that would apply on every testCase of my testSuite.

Of course, these scripts would include variables that would take values according to the current running test case ...


If anyone knows ...

So far I tried to do this in setup script and it failed with a

groovy.lang.MissingPropertyException: No such property: testRunner for class: Script1


Maybe SOAP ui could be configured ?



Regular Contributor

So far, it is possible to implement something in the teardown script :

ie, I want a summary of execution for my testCases :

for (testCase in context.testRunner.getResults())
{  testCase.getTestCase().getName() + " : " + testCase.getStatus()

this provides me with information <testcase> : <status>


If someone has other methods or manages to do things in setupscript, don't hesitate to post !  🙂

Regular Contributor

After further investigation, I managed to do a complete summary of my tests, test cases and test steps, in my testSuite teardown script:

def runner = context.testRunner;

for (testRun in runner.getResults())
	testCase = testRun.getTestCase()
	// "testCase " + testCase context.expand( '${#Project#testcase_flag}' ) + testCase.getName()

	for (testResult in  testRun.getResults()) testResult.getTestStep().getName() + " : " + testResult.getStatus() context.expand( '${#Project#testcase_status_flag}' ) + " : " + runner.getStatus()
Showing results for 
Search instead for 
Did you mean: