Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

putting dealy in groovy script

hello,
I have a function in my external groovy script which updates my request and puts some timestamp. I put a 1 second delay so that i get unique timestamp. Is this the right way to do a delay ? I have a feeling that this is putting the soapui application in a sleep state.


GlobalFunctions gb = new GlobalFunctions()
gb.CreateRandomUser(context, "CreateUser - Line1 Empty")
Thread.currentThread().sleep(1000)
gb.CreateRandomUser(context, "CreateUser - Line1 Missing")

1 Reply

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    this is correct.. or just

    Thread.sleep( ... )

    The groovy editors all run scripts in the UI-thread, so this will "lock up" soapUI when running from within them... but a TestCase runs in its own thread, so you shouldn't see this behaviour when running through the TestCase/TestSuite/etc.. editors/runners..

    hope this helps!

    regards,

    /Ole
    eviware.com