Modifying Selenium Timeout

Does anyone have any insight in to how to adjust the Selenium timeout within a Katalon test?

I have a process that resets our application to a known state, but it takes an extremely long time. To make matters more complicated it actually happens within the WebUI.click call.

Normally you would WebUI.click(....) and then WebUI.waitForPageLoad(...) but this is not a user-facing thing, its something that only ever appears in our testing environment, and only ever happens at the beginning of our test suites, so best practices dont really apply here from the application side of things.

Until recently it completed within the 5 minute Selenium timeout, but (for various reasons) now takes longer than 5 minutes, and reducing that would create a huge batch of work which I would like to avoid.

I am able to add print statements and see that the WebUI.click function starts, but does not return before the 5 minute timeout. I can also see that the click did actually occur, and the handler code is executing.

The error I get is:

[1606406037.812][SEVERE]: Timed out receiving message from renderer: 300.000
2020-11-26 15:53:58.153 ERROR c.k.k.core.keyword.internal.KeywordMain  - ? Unable to click on object '........'

What I would like to do just beforeWebUI.click, is to set the timeout to say 900 seconds, then then straight after, return it to the 300 second default, e.g.:

driver.setTimeout(900)
WebUI.click(...)
driver.setTimeout(300)

its probably not that simple, but I’ve not been able to find anything useful online to help me work out what i need to do

Any suggestions would be gratefully received! :slight_smile:

You want to call a method of a WebDriver instance in action, do you?

In https://docs.katalon.com/katalon-studio/docs/using_selenium_webdriver_katalon_studio.html#driverfactory mentioned the following snippet:

import org.openqa.selenium.WebDriver
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
 
WebUI.openBrowser('')
WebDriver myDriver = DriverFactory.getWebDriver()

Once you obtain a reference to the WebDriver instance, I suppose, you can call myDriver.setTimeout(900).

Aaah, looks promising! thank you, I will give it a try and see what happens :slight_smile: