TestProject Forum

Timeout during "Is [element] not present or invisible" validation causes failure rather than success?

I have a test that failed on a “not present or invisible” step with the failure caused by “TimeoutException: Timeout occurred while trying to perform the action.” Isn’t this the intended passing behavior of a “not present or invisible” validation though? It timed out while searching for the element, therefore the element is not present and the validation should pass. Screenshot taken when the step failed showed that the element being targeted was indeed not present, as intended. I’ve also double checked that I didn’t accidentally invert the step result. This is doubly bizarre because it is not consistent; the four step immediately before the failing one are identical except that they check for different elements.


image

can you expand the full error message from the report and paste it here?

This is all there is.

It should work, the only direction I can imagine here is that this specific element is in intermediate state which making this to fail.

Try to do one of the following

  1. Use Is Present or Is visible validations instead and then invert step result, they work slightly different so it might work for you.
  2. locate the element with different locator (XPATH/CSS/ID) you can do it by hoovering on element and click “save element”
  3. Reduce the adaptive wait time on this specific step to 5 seconds (5000 ml)

additionally please run the test again and send us agent logs to support@testproject.io we will take a look and try to figure out why it fails.

Unfortunately, this error occurs on the Safari browser provided by the Browserstack virtual agent, so I cannot download the agent logs since it is cloud-run.