Forum Discussion

MarcusBengtsson's avatar
MarcusBengtsson
Frequent Contributor
22 days ago

Unstable test results during automation testing

I dont know how to put it. We have setup a final builder which is setting up our web/client environment and then starts test completes and runs the execution. 

But somehow there is always a different result. Sometimes it passes and other time it doesn, when i try to run it (by starting it manually) it works. I dont know what would be the cause of this. 

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      I use the record function, i do not know what the "unable to obtain the item's rectangle" error means. Its never been an issue when starting test complete manually. And its always on different places which is weird.

       

       

      Thanks for all the help and replies guys

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        That error usually occurs when the object has most likely been destroyed and recreated, but TC is still referring to the old object. Refreshing TC cache/object tree may resolve the issue.

        Is your UI always visible i.e. are you able to see the desktop, when this error occurs?

  • My first guess is that it's a timing issue, but I'm with rraghvani - we need to see error messages. It would also help to see the part of the test(s) that are failing.

  • Agree with Marsha, in my experience timing issues due to a slower test environment are often responsible for these types of failures.  If you are using scripts look into the WaitWindow and WaitProperty methods for delaying execution until a required window or control is available.  With Keyword tests and scripts increasing the Auto-wait timeout value on the Playback page of the project properties might help too.  That is more of a "shotgun approach" instead of a targeted approach with the Wait methods.

    One more thing, consider logging a screen capture at the step right before the problem/error.  I find those really helpful for debugging problems in test environments that don't reproduce on my local machine.  Seeing exactly what's going on when it fails can lead you quickly to the problem and solution.
    Post Screenshot Operation | TestComplete Documentation (smartbear.com)