Forum Discussion
This is very strange, I also get the error message
ERROR:groovy.lang.MissingPropertyException: No such property: testRunner for class: Script2
But no results are shown since the script just stops when the error appears...
Is it really not possible to use the runner variable to execute a teststep from another testsuite...?
Dunno if you are still looking for a solution, but maybe this workaround will help you.
I created a test suite, with 1 test case from which I can basically run as many test suites as I desire. Here is the code. See also the attached screenshot.
Code:
testRunner.testCase.testSuite.project.getTestSuiteList().each { testsuite -> if(['ts'].contains(testsuite.getName())) { //filter testsuite we want to run testsuite.getTestCaseList().each { testcase -> if(testcase.getName().toLowerCase().startsWith('renderer')) { //filter testcases we want to run testcase.getTestStepList().each { teststep -> if(teststep.getName().equalsIgnoreCase('request')) { //finally filter all teststep we want to run log.info "running ${testcase.getName()} -> ${teststep.getName()}" def r = teststep.run(testRunner, context) log.info r.getStatus() } } } } } }
- d4vke6 years agoOccasional Contributor
Thanks Alex99,
I will give this a try and let you know what the outcome is.
- nagoorkj5 years agoContributor
below is the script to run from test suite tear down script to run any groovy script
"'mention the script where it resides"
testSuite = testSuite.project.getTestSuiteByName("Script Library");
"'mention the test case /groovy where it resides"
testCase = testSuite.getTestCaseByName("Test");
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);hope it helps
Related Content
Recent Discussions
- 2 hours agoruchisingh