Forum Discussion

hazel_chua's avatar
hazel_chua
Contributor
4 years ago

Creating a custom Delay teststep via a Groovy scripting step

I managed to create a custom Delay test step via Groovy script but I can't seem to modify the step. def stepName = "DelayTimeWindow" def newPropertiesStep = testCase.getTestStepByName(stepName) if...
  • nmrao's avatar
    nmrao
    4 years ago

    hazel_chua 

    I tried the way you are showing, but it still works. Please find the test case link which can be imported into a test suite.

    How to use:

    • Import xml into test suite and run the Groovy Script test step.

    What it does?

    • This time, changing the value of CUSTOM_DELAY with in the groovy script and run the Delay step from within Groovy to see the delay is changed or not dynamically.
    • Also Delay step is activated / deactivated and activated back to demonstrate. As you pointed you could not disable in you messages.
    • In the below screen shot, you can notice the log time difference
    • Initial value of property is 1s
    • Test run #1 with 3sec delay
    • Test run #2 with 10s delay

    https://github.com/nmrao/sample-soapui-projects/blob/master/delayTestCase/dynamicDelayInGroovy.xml