Issue with WebUI.waitForElementPresent and WebUI.waitForElementVisible in Katalon 5.6

When I call the WebUI.waitForElementPresent / WebUI.waitForElementVisible in an object that does not exists, after the timeout period I received the following message:

[INFO] - Found web element with id: ‘Object Repository/UI/PCI_Catalog_Deploy/div_select_catlog_service’ using heuristic method. Matching attributes: [tag, class].

This looks like a blocker for me, I have tried multiple workarounds but every time i get this message. This definitely needs to be fixed as soon as possible. But in mean time is there any workaround for the issue ?

1 Like

That is just a log message, therefore the result should be fail . Can you help to just double check it again?

Hi,

No its just not a log message. If you can see my below screenshot which has the code and the execution steps, here I was expecting that WebUI.waitForElementPresent / WebUI.waitForElementVisible would throw an exception when an element in not visible / not present on a page but it is not the case here. I could see message that “Found element using heuristic method”, this might be the reason it is not throwing exception.

So I am expecting 2 fixes here :
This misleading message should be corrected.
In case of non existing elements, WebUI.waitForElementPresent / WebUI.waitForElementVisible should throw exception as expected along with failed step that object is not found.

Please let me know if you any need any other info.

image.png

Hi,
Any update on this ?

I also encountered this issue.

Finding web element with id: 'Object Repository/something/iframe_d' located by 'By.cssSelector: iframe.lightBoxFrame' in '10' second(s)Found web element with id: 'Object Repository/something/iframe_d' using heuristic method. Matching attributes: [tag].
Web element found by heuristic method is not used because we can't guarantee it reflects the intended element.
You should consult our guide in choosing attributes : https://docs.katalon.com/x/fhlO

Object selection method is set to ‘CSS’ and yet Katalon is trying to find it using heuristic method.

1 Like

Sunil (and maybe Mate?)

Try this:

...
  if( cnt == 6) {
    KeywordUtil.markFailed(...)
    throw new StepErrorException("Could not find object")
  }
...

You might need to use this import:

import com.kms.katalon.core.exception.StepErrorException as StepErrorException

Hope this helps.

Something similar happened:

When waiting for an element inside of an iframe to be clickable (after switching to the iframe) I got:

[INFO]   - Web element found by trial and error method is not used because we can't guarantee it reflects the intended element.

It is intermittent.
This is after updating to 5.7.0.

This is after updating to 5.7.0.

Ouch. Seems .0 == alpha, .1 == beta…

1 Like

Now I’m getting the following two messages (for the same element):

Web element found by heuristic method is not used because we can't guarantee it reflects the intended element.
Web element found by trial and error method is not used because we can't guarantee it reflects the intended element.

Is there any difference between the heuristic method and trial and error method? Are those different than finding the element by css or xpath? Or they are just ways of getting the css/xpath element?

1 Like

Mate: Let me see if I can get some traction on this…

1 Like

I won’t stop you… :smiley:

Can you hold your breath for 5.8? That’s how it’s looking…

Well, I guess i’ll revert to 5.6 until then.

@Russ Thomas Im expecting that this issue gets fixed in 5.8. This is very important fix for us.

Sunil - I have no input as to what does or does not get fixed.

Same problem here:

Hello,

I’m facing the same heuristic issue in 5.7.1 when trying to set the google password to login into my app. It cannot find the field webelement. Strangly the email adr field just the screen before can be retreived.

- Found web element
with id: ‘Object Repository/Page_EMAsphere - Login/SSO_passwordField’ using
xpath: //div/input.

09-27-2018 03:02:19
PM - [INFO] - Web element found by
trial and error method is not used because we can’t guarantee it reflects the
intended element.

09-27-2018 03:02:19
PM - [FAILED] - Unable to set text ‘Qwerty1!’ of object ‘Object
Repository/Page_EMAsphere - Login/SSO_passwordField’ (Root cause:
com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element
with id: ‘Object Repository/Page_EMAsphere - Login/SSO_passwordField’ located
by ‘By.xpath: //*[@type = ‘password’ and @name = ‘password’]’ not found)

09-27-2018 03:02:19
PM - [END] - End action :
setMaskedText


Is it confirmed this is a Katalon issue? How can this be avoided? I cannot go any further obvisouly…

Side important note, the setMaskedText when in error displays the password in clear in the console… this is a serious security issue.

Thanks
David.

GoogleLoginPwd.PNG

Not sure why this issue is not being addressed from so many releases. This is a major issue which is a blocker for us in many places.

why this issue is not being addressed

Is it possible for me to get access to the live URL which makes you blocked? I have never seen this issue myself so I am not keen on getting involved.

Sunil Kumar A said:

Not sure why this issue is not being addressed from so many releases. This is a major issue which is a blocker for us in many places.

This issue has been addressed in the latest version 5.8, can you help to double check it again?