How to copy HTTP test step from one test suite to another test suite
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to copy HTTP test step from one test suite to another test suite
Hi,
I am looking for a groovy code which will copy test step from one test suite and clone the same step to another test suite
for e.g
PROJECT1
|
___Test Suite 1
__Test Case1
___Test Step1
___Test Suite2
___Test Case2
would like to clone Test Step1 from Test Case1 to Test Case2, please suggest
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried
def workspace = testRunner.testCase.testSuite.project.workspace
project = workspace.getProjectByName('ProjectName');
apiTestSuite = project.getTestSuiteByName(TestSuite1);
apiTestCase = apiTestSuite.getTestCaseByName('TestCase1');
apiTestStep = apiTestCase.getTestStepByName('TestStep1');
testRunner.testCase.testSuite.project.getTestSuiteByName("TestSuite2").getTestCaseByName("TestCase2").cloneTesStep(TestStep1,TestStep1)
But, this code is not working
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sachin,
You need to use the cloneStep(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep, java.lang.String) method.
Please see a sample script:
def sourceStep = testRunner.testCase.testSuite.project.getTestSuiteByName("Test Suite 1").getTestCaseByName("Test Case 1").getTestStepByName("Test Step 1"); testRunner.testCase.testSuite.project.getTestSuiteByName("Test Suite 2").getTestCaseByName("Test Case 2").cloneStep(sourceStep,"NewTestStepName");
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
