Forum Discussion

nastester's avatar
nastester
Regular Contributor
4 years ago

Tear down script to fail performance test if test step count is not reached

Hello, 

I am trying to create a tear down script that will fail my performance test if a specified test step count is not reached during the timed test run. 

There are no out of the box assertions that can do this so a script is required.

 

I have this so far but I am getting errors:

def newPropertyValue
newPropertyValue = loadTestRunner.testCase.testSuite.project.testSuites["Subscribe"].testCases["Test Case 1"].getTestStepCount();
if (newPropertyValue < 330) {
context.getLoadTestRunner().fail("FAIL TEST")

log.info "Test step count not reached"

}

 

Caused by: groovy.lang.MissingPropertyException: No such property: testCase for class: com.eviware.loadui.components.soapui.SoapUILoadTestRunner

 

I found the test step methods in another older post but it seemingly isn't applicable for loadTestRunner.

What is the best way to do this?

 

Thanks in advance!