This topic describes how to use Groovy script to run a test step from another project.
Where to use
There are two ways to run this script:
- As a Groovy Script test step.
- As a setup or teardown script on the project, test suite, or test case level in functional tests.
Example
Groovy
// Replace names of a project, test suite, case and step with those you need.
// Connect to the test step in another project.
def prj = testRunner.testCase.testSuite.project.workspace.getProjectByName("ProjectName")
tCase = prj.testSuites['Test Suite Name'].testCases['Test Case Name']
tStep = tCase.getTestStepByName("Test Step Name")
// Call the test runner and check if it can run the specified step.
def runner = tStep.run(testRunner, context)
log.info ("runner status ....... : " + runner.hasResponse())
See Also
Run Test Case From Another Project
Groovy Script Test Step
Groovy Scripting Samples
Scripting