[WebUI] Click

This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/webui-click.html

is it possible to create a test object to save the initial test object in it and then interact with it? I can’t get this to work

For example:

WebElement MyTestObject1 = WebUiCommonHelper.findWebElement(findTestObject(‘Object Repository/SomeTestObject’), 30)


Try “TestObject” not “WebElement”.

TestObject MyTestObject1 = findTestObject(‘Object Repository/SomeTestObject’)

Yes, thank you. I figured out I was wrong shortly after I posted :slight_smile:

why the Click command is running for a very long time? Command execution time-Elapsed time: 30,262 s

click(findTestObject(“Object Repository/Distributors/Booking/button_Select”), OPTIONAL)

Elapsed time: 30,262s
changing object properties from attributes to xpath doesn’t help

It likely means that your default timeout period is 30 seconds and that the click event did not find the button element. Review your button element’s xpath or whichever means you used to locate it (and if you use multiple references to locate your button element, like class, style, width, etc., then perhaps reduce to just having tag and xpath selected).

Thank you, but the fact is that in the end the command is executed and the button is pressed, but it takes 30 seconds. I can’t use Xpath because it is changing.
The command is also processed for a long time -
selectOptionByValue(findTestObject(“Object Repository/Distributors/Booking/button_Select”), “1”, false, OPTIONAL)

Elapsed time: 1m - 0,363s

What is the tag for the element, button_Select?

selectOptionByValue(findTestObject(“Object Repository/Distributors/Booking/button_Select”), “1”, false, OPTIONAL)

selectOptionByValue, selectOptionByLabel and selectOptionByIndex only work on a select tag.

hi, this is tag;

Why does the “click” command take so long? Where can I change the timeout to 2 seconds?

Are you moving to a different web page between clicking on your “Log_in” button and your “GoToRPIE” button?

Being on the page https:site/auth/login, I click on the “Log_in” button, go to the page https://site/taxappeal/ there appears a pop-up and in it I click on the “GoToRPIE” button

then your test case script MUST wait for the the page https://site/taxappeal/ is loaded completely and a popup is displayed before your script tries to click on the “GoToRPIE” button.

Your current script calls a WebUI.click("Log_in button") and soon (in just a few milli-seconds) calls WebUI.click(GoToRPIE button) without waiting for the pop up is ready to click. The second call WebUI.click() failed because the pop up is not yet there in a few milli-seconds.

The second “click” failed instantly. But the failure was reported after 30 seconds of timeout. — I think this behaviour is not good.

Thanks for the answer. It turns out that it was necessary in the execution - the “Default Smart Wait” was set to enable:

It’s ok to use the Smart Wait if it solves your current problem.

But the Smart Wait is NOT necessary. It is a magic spell, that may help sometimes, but not always.

I would advise you not to rely on it. Rather you should learn/find how to code an appropriate “wait” for yourself. The magical Smart Wait tends to leave you untrained.

Got it, thanks!