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!
Since the error is pointing to a missing property I would review the path for your newPropertyValue. For the loadTestRunner I believe the correct model is "loadTestRunner.loadTest.testcase...."
The following link contains some useful information for working implementing tear down scripts with the loadTestRunner.
https://www.soapui.org/docs/load-testing/scripting-possibilities/#1-Setup-and-TearDown-scripts
Hope this helps.