How to slow down the execution of the test in a specific part of the script?
Hello,
I was wondering...Is there any possible way to slow down Testcomplete for a while during a script execution?
I've tried slowing down the execution using the Project\Playback\Delay Between Events property, but what I really need is something that slows down the execution only when I want, for as long as I want (sometimes I need to slow down the execution during a whole window test because it works slower than the rest of the system, so Delay() is not an option either) then go back to the original speed.
It would be something like this:
//"Normal" speed
field.SetText("Text");
field.SetText("Text");
//Enters "slow" speed
field.SetText("Text");
btnOK.Click();
wnd.Close();
...
//Back to normal speed
field.SetText("Text");
So, is there any way to get this done?
Thanks in advance!
I agree with tristaanogre there is probably a more effective and direct way of fixing this by just adding Delays exactly where they are needed.
But if you are determined to find a way to slow down sections of a script there's a potential hackish way of doing it. If you are familiar with Events you could use OnLogEvent and have it execute a Delay statement depending on whether a global variable you set in your script is True or False. That way when you want the script to slow down you set the global variable to True and every time a Log.Event occurs it will perform a Delay of whatever length you want, effectively slowly down your script on every statement that interacts with the UI [Keys, Click, etc.]. This should work more or less the same as the project property setting does.