How to set test execution speed.

I just started learning Katalon Studio. I came across a situation where I need to initialize and use own defined chrome WebDriver instead of the one initialized by Katalon to handle browser push notification scenario. The problem is with this initialized driver, the test execution speed is too fast so some of the tests starts failing.

While execurting tests with web driver which initilized by Katalon, the tests run with default action delay setting of 1 second.

Is there a way to slow down the execution while not using the default driver.?

This is what I am doing in the code to initilize web driver.

WebDriver driver = new ChromeDriver(options)
DriverFactory.changeWebDriver(driver)
driver.get(URLToNavigate)

You can insert “WebUI.delay()”

That’s equivalent to

            try {
                Thread.sleep(second * 1000)
            } catch (InterruptedException e) {
                // Thread is interrupted, do nothing
            }

Hi kazurayam,

Isn’t “WebUI.Delay()” for adding dealy before/after a specific action?

I am talking about overall execution speed of tests, something equivalent to “Delay between actions” setting which is avaialble at Projet → Settings > Execution. The mentioned setting do not have impact when I initilized web driver as mentioned in my above post. .

You (your test script) MUST make appropriate wait for the HTML of web page to load completely in a browser window before doing any operation on the page. Your test case script shouldn’t click a button, shouldn’t set text into <input> element without making sure that the target HTML element is there and ready. Your test scipt must wait for the HTML elements to be there in the browser.

Are you conscious of this practice? I guess, you aren’t.

The WebUI.openBrowser(url) and WebUI.navigateToUrl(url) implicitly & automaticaly wait for the HTML to load in the opened browser. If you decide not to use the WebUI keywords and you prefer creating a WebDriver instance yourself, you MUST write your script so that it waits for the HTML to load completely before your test script starts doing anything on the page. If your script does not make appropriate wait, your test will certainly fail. This is a common pitfall of Selenium testing.

If this is the case for you, something equivalent to “Delay between actions” setting which is avaialble at Projet → Settings > Execution would not help you at all.

How to fix? — well, I don’t know yet because you haven’t informed to us anything about your current problem. See

Please show us the error log, show us your test case script, show us the HTML source of the target web page, show us the definition of your Test Object that is used in the test case script to select the HTML element of your interest.

1 Like