Forum Discussion
PaulDonny
11 years agoRegular Contributor
The below code will clone a test suite named "Test" and rename it to "testing". Make the changes you need to fit your code and it should work fine. I wrote in Groovy so that I could efficiently test it but it shouldn't be difficult to grab the objects and use those functions.
To better fit your code:
def testCase = testRunner.testCase.testSuite.getTestCaseByName("Test");
testRunner.testCase.testSuite.cloneTestCase(testCase,"testing");
To better fit your code:
def slaveTestCase = testRunner.testCase.testSuite.project.getTestSuiteByName("Test Suite").getTestCaseByName("Name")
testRunner.testCase.testSuite.project.getTestSuiteByName("Test Suite").cloneTestCase("NewName")
- peti20056 years agoOccasional Contributor
The last part will not execute because there is parameter missing in cloneTestCase().
Tee following lines are correct:
def slaveTestCase = testRunner.testCase.testSuite.project.getTestSuiteByName("Test Suite").getTestCaseByName("Name")
testRunner.testCase.testSuite.project.getTestSuiteByName("Test Suite").cloneTestCase(slaveTestCase,"NewName")
Related Content
- 2 years ago
- 4 years ago
- 5 years ago
- 5 years ago
Recent Discussions
- 15 years ago
- 11 days ago