In ATF Is there a way to pause the screen at a particular step

ServiceNow Use6
Tera Guru

Hi,

Can you please tell me that the screen is paused for a certain number of seconds so that the user can have proper look at the screen. I wrote some code but it doesn't seem to be working. It just closes in a couple of seconds. Kindly help.

step1.PNG

 

step2.PNG

Regards

Suman P.

1 ACCEPTED SOLUTION

You defined the script with a capital S, atfSleep, but you are calling it with a small s, atfsleep. Javascript is case sensitive, so the case has to match exactly.

View solution in original post

8 REPLIES 8

pneuvil1
Mega Guru

I wrote this simple script include.

function atfSleep (amtSeconds) // used to cause the ATF test to pause.
{  // this would give the author time to debug a failing test to see what has actually been created, update, deleted etc...
	gs.sleep (amtSeconds*1000);
}

and then called if as a test step.

 

image_2022-10-27_121428774.png

 

But now there is a built in way to pause the script using debug. But the pause if fixed. In this script you can specify how long to pause for.

Hi,

Can you please tell me where would I put the script. Even I put for 30000, it stays for 3 seconds. Where am I doing wrong.

 

 

function atfSleep (amtSeconds) // used to cause the ATF test to pause.
{  // this would give the author time to debug a failing test to see what has actually been created, update, deleted etc...
	gs.sleep (amtSeconds*30000);

 

Regards

Suman P.

You do not need to change the script, leave it at *1000. So that when you pass it a parameter, you are passing it in the number of seconds you want to pause. gs.sleep takes a millisecond argument. Notice in the previous screen shot, i pass a value of 60 so that it will sleep for 60 seconds and give me a minute before the rollback occures.

In this sample test, I put it at the end to prevent the atf rollback. That way I can examine everything the test created or changed.

 

sample sleep test.png

Can you please paste the complete screenshot for the script include not just the code.

Regards

Suman P.