Forum Discussion

ThomasCasserly's avatar
ThomasCasserly
Frequent Contributor
8 years ago

Object Not Found during test but can be Found after test has failed.

Hi,

I am having an issue with object recognition on pages in my web application.

 

During a test run I load a page and the first operation fails due to an object not found error message.

After the failure If I right click on the failed object and choose highlight, after a few seconds the object is highlighted correctly onscreen.

If I try to use a different object for my first test after my page has loaded it still fails and after failure the object can once again be correctly highlighted by TestComplete.

 

So it appears that no matter which object I choose to interact with first, after my page has loaded,  TestComplete cannot find any object that is used for the first test on the page.

 

I have already manually re-mapped all of the objects on the page in question, checked for Dynamic IDs etc.

I have also changed the default "Auto-wait timeout" under the "Current Project Settings"to give TestCompelte more time to find the objects. (This appears to reset intermittently to default of 50ms, I'm not sure why.)

 

Any ideas on how to solve this problem, what is the cause?

 

Thanks


Tom.

  • JennyH11's avatar
    JennyH11
    Frequent Contributor

    Hi Thomas

     

    In reference to : 

     

    "I have also changed the default "Auto-wait timeout" under the "Current Project Settings"to give TestCompelte more time to find the objects. (This appears to reset intermittently to default of 50ms, I'm not sure why.)"

     

    I have recently been provided with a patch which fixed precisely this problem. :)

     

    I would recommend contacting Support and hopefully they should provide you with this aswell.

     

    Thanks, Jenny

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    This could be a timing issue.

     

    What you can do is, Try to identify a object which loads at last and Use WaitChild to wait until the Objects exists or Visible. Then perform your testing.

     

    Also below might help you

     

    https://community.smartbear.com/t5/TestComplete-Functional-Web/TestComplete-not-waiting-for-page-loads-when-api-call-done-with/m-p/123332/highlight/true#M27860

    https://community.smartbear.com/t5/TestComplete-Functional-Web/Get-page-load-state/m-p/53514/highlight/true#M136

    • ThomasCasserly's avatar
      ThomasCasserly
      Frequent Contributor

      Hi Shankar,

       

      I've had some success with getting controls recognised, by using the "Exists" object method. Am sure WaitChild would give same results so thanks  for pointing me in right direction.

       

      I'm curious about something though, why would a adding a delay to a test not give the same result? I added a 60 second delay to my tests which did not allow the object to be found, but when I added the "Exists" method to a object on the page, my test object was found and the test proceeded.

      Can you explain why simply delaying the test might not have been sufficient. I'd love the understand what the difference is between simplying adding a delay to allow objects to load and adding the object "Exists" check.

  • kevin_kapell's avatar
    kevin_kapell
    Frequent Contributor

    We have also seen this problem but only in IE and it is intermittent. If I clear the run logs and close/reopen everything it appears to go away for at least a little while. I did open a support ticket but could not reliably reproduce so it was closed. I recommend that you open a support ticket. The more information we can give them the more likely they can find the cause.