verifyElementPresent should not have a timeout parameter, or it should accept a value of 0

Generally speaking, when using a function like “verifyElementPresent”, the tester would like to evaluate the presence of an element at the time the function is called.

As such, the current implementation:

WebUI.verifyElementPresent(TestObject to, int timeout)

should not include a timeout. This could be handled in either of the following ways:

1.) Remove the timeout implementation completely.
2.) Allow for the timeout parameter to accept ‘0’. Currently, if the tester gives a value of ‘0’, it appears that the studio defaults back to 30 seconds:


The current workaround is to set timeout = 1. Obviously, this is not ideal.

Thanks!

image.png

2018_03_22_16_15_02_Katalon_Studio_poc_Location_C_projects_katalon_poc_.png

For those that are interested, here’s another workaround that gives a close-to-zero response time:

try {

boolean isVisible = WebUI.verifyElementVisible(`findTestObject(``'myTestObject'``)`);

return isVisible;

}

catch(StepFailedException e) {

return false;

}

1 Like