How can I autoreplay one of my testcases?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I autoreplay one of my testcases?
Hello,
I would like to autoreplay one of my testcases. Is that possible within SoapUI NG pro? And so yes, on what manner?
Kind regards,
Kees
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use test case Teardown scripts to do this. This script should work, but there are probably lots of simpler ways.
// IMPORTANT. CAN CAUSE INFINITE LOOP WITHOUT ITERATOR
for (i = 0; i <1; i++) { def testCase = testRunner.testCase.testSuite.project.getTestSuiteByName("TestSuite 1").getTestCaseByName("TestCase 1") def properties = new com.eviware.soapui.support.types.StringToObjectMap () def async = false testCase.run (properties, async) }
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Igor, thank you very much!
That script works! But another question. How can I stop that script during the loop? Or is there an option that I can replay the script for 10 or another number times?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want the loop to run the test suite 3 times, you would use
for (int i = 0; i < 3; i++) { ........... }
If you want the loop to run a MAX of 3 times and stop if a certain condition is met:
for (int i = 0; i < 3; i++) { ........... if (condition == true) { break; } }
---
Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your response.
It does not work. What can I do? Is my script (see below) wrong?
My complete TearDown Script is now:
// IMPORTANT. CAN CAUSE INFINITE LOOP WITHOUT ITERATOR
for (i = 0; i < 3; i++)
{
def testCase = testRunner.testCase.testSuite.project.getTestSuiteByName("Medewerkers").getTestCaseByName("Niet-gekeurde medewerkers verwijderen")
def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
def async = false
testCase.run (properties, async)
if (i == 2) {break;}
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that this code is wrong: "testCase.run (properties, async)". But I don't know what I must write there.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you say it does not work, what error are you getting or what is not working?
---
Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
