sanj
7 years agoSuper Contributor
what would I need to import in order to run test runner
I am trying to do the following but want it in a standalone groovy script.
I already have the jars imported for READY API
What packages do I need to import in order to run tests from groovy
def project = testRunner.testCase.testSuite.project
def testsuite= testRunner.testCase.testSuite
tc = testsuite.getTestCaseByName("Templates")
def testStep = tc.testSteps['24hr Test Template']
//def testStep = testRunner.testCase.testSteps['24HRRequestTest']
def status = testRunner.status
log.info("status : ${status}")
def result= testStep.run(testRunner,context).getStatus().toString()
No need.
Just pass a parameter (testRunner) in your method.
// assumed that you put it in MyScript.groovy def myTest(testRunner){ // something testRunner.testCase.testSteps["YourStepName"] } // call it in groovy step def t = new MyScript() t.myTest(testRunner) // if you defined a class MyScript.groovy class MyScript{ def runner def myTest(YourStepName){ // something runner.testCase.testSteps[YourStepName] } } // call it in groovy step def m = new MyScript(runner: testRunner) m.myTest(YourStepName)