Alex Brohin
Katalon Apprentice
05/25/2017

Is there a way in Katalon to wait() for a certain number of seconds ?

Hello,

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.

Thanks!

Upvote
Quote

Comments

  • Hung Pham
    Katalon Apprentice
    05/25/2017
    Hi there,

    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.

    Thanks.
    Upvote
    Quote
  • Marek Melocik
    Katalon Ambassador
    05/25/2017
    Or Java function
    Thread.sleep(int milliseconds)
    if you want delay less than 1s
    Upvote
    Quote
  • Alex Brohin
    Katalon Apprentice
    05/27/2017
    Thanks!
    Upvote
    Quote
  • Naima Aziz
    Katalon Apprentice
    11/03/2017
    edited November 2017

    Hey Alex,
    you can simply use this built-in function of Katalon

    WebUI.delay(5)

    // 5 is the number of seconds you wait for before moving ahead

    Upvote
    Quote
  • Santhanakrishnan
    Katalon Apprentice
    12/12/2017
    Hi,

    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.

    Thanks,
    Santhan

    Upvote
    Quote
  • Lukas Boekenoogen
    Katalon Apprentice
    12/12/2017
    Hi,

    Maybe you can use "Delay between actions" in the Project Settings, see screenshot below.


    Click on "Project -> Settings" in the menu. Then expand the option "Default" under "Execution" and click on "Web UI".
    Upvote
    Quote
  • vivek Ghag
    Katalon Apprentice
    03/26/2018
    use delay in steps or wait until keyword.
    Upvote
    Quote
  • Ananth raghav
    Katalon Apprentice
    03/28/2018

    Hello,

    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.

    Thanks!

    Upvote
    Quote
  • Ananth raghav
    Katalon Apprentice
    03/28/2018
    edited March 28
    WebUI.delay() method delays the test case execution for a certain no of seconds.

    Also, WebUI.waitForElementPresent() method waits for a certain element until its present. You can mention the no. of seconds for it to wait
    Upvote
    Quote
Sign In or Register to comment.