# Sometimes TestObject is not found, but visible on error screenshot

**URL:** <https://forum.katalon.com/t/sometimes-testobject-is-not-found-but-visible-on-error-screenshot/37361>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [December 10, 2019, 4:20pm UTC](https://forum.katalon.com/t/sometimes-testobject-is-not-found-but-visible-on-error-screenshot/37361 "2019-12-10T16:20:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Peter.Albrecht](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@Peter.Albrecht](https://forum.katalon.com/u/Peter.Albrecht)\
**Post date:** [December 11, 2019, 12:44pm UTC](https://forum.katalon.com/t/sometimes-testobject-is-not-found-but-visible-on-error-screenshot/37361/3 "2019-12-11T12:44:05Z")

</div>

@Russ_Thomas: Thank you for your quick reply.

I figured out some new information: It seems that `WebUI.waitForPageLoad(10)` does not work in my case (I know, I am not the only one with this problem). Watching my firefox and katalon test execution in parallel, I see the following:

- firefox needs 16 seconds to load the webpage (long database query and big html table)
- in those 16 seconds, I see katalon executing the loop (mentioned above) 4 times

So `WebUI.waitForPageLoad(10)` does not pause the test until the page is loaded in firefox. Instead katalon test execution goes on.  
I guess, the page is completly loaded at some random time in test execution. In this case, it can easily happen that the button is still there when test execution is at `WebUI.verifyElementPresent(myButtonTestObject ...`. Then the new page (without the button) is completly loaded. And so the following `WebUI.click(myButtonTestObject)` fails, since the button is gone.

* * *

Any ideas how to solve this?

My next plan would be to add a timestamp (milliseconds) in EVERY html page renderd by our AUT. So I could wait until the current page in firefox has a new timestamped, compared to the old page. 😉

---

_[View the full topic](https://forum.katalon.com/t/sometimes-testobject-is-not-found-but-visible-on-error-screenshot/37361)._
