Applies to ReadyAPI 3.3.1, last modified on August 11, 2020

ReadyAPI allows you to use a Groovy scripts to run multiple test cases at once, synchronize data between your projects, and process it in your tests.

This topic describes how to use Groovy script to run a test step from another project.

Availability

There are two ways to run this script:

Example

The following code demonstrates how you can run a test step from another project of your choice using the built-in scripting objects of ReadyAPI:

Groovy

// Replace names of a project, test suite, case and step with those you need.

// Connecting to the test step in another project.
def prj = testRunner.testCase.testSuite.project.workspace.getProjectByName("ProjectName")
tCase = prj.testSuites['TestSuiteName'].testCases['TestCaseName']
tStep = tCase.getTestStepByName("TestStepName")

// Calling the test runner and checking if it can run the specified step.
def runner = tStep.run(testRunner, context)
log.info ("runner status ....... : " + runner.hasResponse())

See Also

Groovy Script Test Step
Groovy Scripts

Highlight search results