- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 09:03 AM - edited 10-27-2022 09:04 AM
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.
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 01:11 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 09:16 AM
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 09:22 AM - edited 10-27-2022 09:23 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:00 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:10 AM
Can you please paste the complete screenshot for the script include not just the code.
Regards
Suman P.