In some of our test scenarios we have to wait for at least 1 minute before doing an action. We are not waiting for an element to load or something but rather just waiting cause these are our system limitations.
We tried this:
WebUiCommonHelper.wait(60000)
but it triggers an error message stating:
05-24-2017 06:19:32 PM - [ERROR] - Test Cases/Login/Valid login inputs FAILED because (of) java.lang.IllegalMonitorStateException
Would you be able to clarify on the simple wait() action please ? Where did we make a mistake ? Based on the wait() function description it is still waiting for an element to load but how can we just let Katalon Studio wait for 1 minute for instance and then keep executing the code right after that.
Katalon Studio provides delay keyword for delaying the execution for the specified seconds. Please have a look here to check if it meets your expectation https://docs.katalon.com/display/KD/[Common]+Delay.
Can we able to slowdown / speedup the script execution?
Example:
Let us consider that our script consist of 50 steps. Total Execution time of the script = 120 Seconds. I have to test my system under different network speed condition.
Question : Shall i make my script to slowdown such that complete execution of script should take 1.5 x (times) i.e. the script should take 180 Seconds to complete instead of actual time of 120 minutes without adding any additional sleep between the statements.
In some of our test scenarios we have to wait for at least 1 minute before doing an action. We are not waiting for an element to load or something but rather just waiting cause these are our system limitations.
We tried this:
WebUiCommonHelper.wait(60000)
but it triggers an error message stating:
05-24-2017 06:19:32 PM - [ERROR] - Test Cases/Login/Valid login inputs FAILED because (of) java.lang.IllegalMonitorStateException
Would you be able to clarify on the simple wait() action please ? Where did we make a mistake ? Based on the wait() function description it is still waiting for an element to load but how can we just let Katalon Studio wait for 1 minute for instance and then keep executing the code right after that.
Just an FYI for whoever comes across this thread in the future - delays are great and easy but they arent the most efficent way of writing the test. They can become a bad habit and can cause significant time loss in the future. The whole point of automation testing is to be fast and efficent.
Katalon has built in key words such as WebUI.waitForElementVisible(findTestObject(null), 0) where the 0 is the number of seconds the step will wait before it errors.
This way if the element is ready before x seconds it will move onto the next step, however a delay will continue to “delay” for the complete allotted time.
Hii I use time.sleep(100) for file uploading . i want after file uploading Robot automatically click without using time.sleep(100) method. how to i solve it help me .
WebUI.delay will do everything you want it to do but its bad practice for automation as you are hard coding a time for the test to wait. You may run the test another time and get a lag spike and the it actually hangs for longer than 5 seconds, you will then go in and increase the seconds delay from 5 to 10 because you want to “fix” the test. You then have 10 seconds of delay every test, even when the test may be ready after 2 seconds to proceed to the next step. This can grow and grow till eventually you could have 7 hours worth of tests, which are only perfoming actions for 2 hours of that time, the rest of the time its just perfoming your hard coded waits. Do you get where im coming from?
The ultimate goal is to wait for jQuery.active to be 0 before you can proceed to the next step, but a simpler solution is to use on of the inbuilt waitFor… methods that katalon have included. This will only wait the time needed on that occasion, up to a certain time you will set before it times out.