creating groovy teststep with code via groovy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2010
10:29 PM
09-09-2010
10:29 PM
creating groovy teststep with code via groovy
Hello,
How can I create a testsuite/testcase/groovy teststep via another groovy step.
For example:
I have a groovy step in testSuite1-->Testcase1-->'groovy step'
I need this groovy step to do the following
1. Create testsuite2
2. Create testcase2 (inside testsuite2)
3. Create 'groovy teststep' in testsuite2-->testcase2 with the following code
-- log.info('hello world')
4. Save project.
Thanks
Ali
How can I create a testsuite/testcase/groovy teststep via another groovy step.
For example:
I have a groovy step in testSuite1-->Testcase1-->'groovy step'
I need this groovy step to do the following
1. Create testsuite2
2. Create testcase2 (inside testsuite2)
3. Create 'groovy teststep' in testsuite2-->testcase2 with the following code
-- log.info('hello world')
4. Save project.
Thanks
Ali
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2010
02:52 AM
09-10-2010
02:52 AM
Hello,
Try this, and let me know does it helps,
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
import com.eviware.soapui.impl.wsdl.teststeps.registry.GroovyScriptStepFactory
suite = context.testCase.testSuite.project.addNewTestSuite("ali")
tc = suite.addNewTestCase("test case ali")
gs = tc.addTestStep( GroovyScriptStepFactory.GROOVY_TYPE, "ali's GroovyScript" )
gs.properties["script"].value = 'log.info(\'hello world\')'
context.testCase.testSuite.project.save()
Try this, and let me know does it helps,
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017
06:04 PM
03-28-2017
06:04 PM
Thanks for the example.
What I am trying to achieve is to dynamically create a SOAP UI request in its own test suite using groovy scripting. very similar to the example below but instead of GroovyScriptStepFactory, I need a SOAPScriptStepFactory if you know what I mean.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2017
04:26 AM
03-29-2017
04:26 AM
Haven't found any value by doing so.
Because, in order to achieve whatever you are talking via groovy script, it is required to do you need to do the same.
what is your use case?
Is not it simple to create a test suite -> test case with dynamic steps in your case as needed.
Regards,
Rao.
Because, in order to achieve whatever you are talking via groovy script, it is required to do you need to do the same.
what is your use case?
Is not it simple to create a test suite -> test case with dynamic steps in your case as needed.
Regards,
Rao.
