Forum Discussion
SmartBear_Suppo
12 years agoSmartBear Alumni (Retired)
Hi!
Yes, you should be able to run this from the Setup Script as well as a Groovy test step.
Sorry for the code being a bit incomplete. The following code probably works better:
To answer your other questions,
2. Probably because "retries" was never initialized and not incremented in the loop
3. It's just a counter that is incremented for each loop
4. try..catch is needed in java because Thread.sleep() throws a checked exception, but it is not needed in groovy.
Hope this helps,
Anders
SmartBear Sweden
Yes, you should be able to run this from the Setup Script as well as a Groovy test step.
Sorry for the code being a bit incomplete. The following code probably works better:
import com.eviware.soapui.monitor.TestMonitor
def monitor = new com.eviware.soapui.monitor.TestMonitor()
def maxSecondsToWait = 10 // or whatever value of your choosing
def retry = 0
while ( monitor.hasRunningTests() && retry < maxSecondsToWait) {
Thread.sleep(1000)
retry++
}
To answer your other questions,
2. Probably because "retries" was never initialized and not incremented in the loop
3. It's just a counter that is incremented for each loop
4. try..catch is needed in java because Thread.sleep() throws a checked exception, but it is not needed in groovy.
Hope this helps,
Anders
SmartBear Sweden
Related Content
Recent Discussions
- 8 days ago