ATF-server script to wait some time

Community Alums
Not applicable

Is there any way to write a script using server side step in ATF to make step case to wait for 10 seconds?

1 ACCEPTED SOLUTION

Hi Jace, 

Perhaps you'd like to consider using gs.sleep() instead of do nothing loop. 
Performance 🙂

Have a good day!

View solution in original post

13 REPLIES 13

I ended up setting the input variable u_seconds to Integer, but my mistake was that I forgot to go back to the test step itself where I now had a new Seconds field. Then the step waited for the number of seconds I specified in that particular test step (so not in the Step Configuration).

The next challenge is why my test does not proceed from there...

My step is not configured to be 10 seconds hard coded.

https://github.com/jacebenson/atf/blob/f062ab065bc6640e4833474c94314f3f01a16fd9/update/sys_atf_step_config_d2b6a776db5563008096a455ca96192a.xml#L76

It is using parseInt, to ensure it's an integer using the base 10 system.

find_real_file.png

Thank you, this has been super useful so far, but I am afraid I still cannot make it work properly since the Client Test Runner seems to be "waiting" indefinitely after this step was run. For example, if I use this step with a 5-second wait ahead of a Set Field Values step, it will first wait for 5 seconds and the results will also say "Waited 5 seconds.", but then it will not set any field values because the screen simply becomes blank while seemingly indefinitely waiting for the Set Field Values step to even start... until I get bored and cancel out of the rest of the test. I assume the script works for you just fine, but I have also tried adding "return;", "return true;"... after your line 82 (stepResult.setSuccess();), so far without any success. Do you have any idea why it is not proceeding? I have no Output defined in the Step Configuration, if that means anything.

Hi Jace, 

Perhaps you'd like to consider using gs.sleep() instead of do nothing loop. 
Performance 🙂

Have a good day!

Not allowed in scope.