Ask a Question

Not able to find a UI button after recording a test and proving it prior to system restart.


Not able to find a UI button after recording a test and proving it prior to system restart.

My company builds a user interface for CNC cutting machines and I'm currently building an automated test for our software. While recording the test we enter a password to unlock a hidden button to run a process, I programmed the test to enter the password and click the button so the process will run. This will work as I'm creating the test and will pass every time, once I restart the control for the morning or run the test on a separate system using Test Execute. After a restart or testing on another system, I get "cannot find the object error". This happens every time and I have read through many of the questions here and have seen some similar issues but they have not pointed me in the right direction.

Champion Level 3

Are you using coordinates to click that hidden button?  If so, you should switch to using the object name to avoid this issue.  Coordinates can vary and it makes your test unreliable.


If not, then do your restart or switch to the other system and record another test with exactly the same steps, or use Object Spy at that point to see the name of hidden button in the state where your test fails.  It may be that you need a wildcard in the name of the button in order to compensate for the various testing states.



It's not actually a hidden button, once you type in the password the button appears so I can record the test. I have tried pretty much everything from Object spy and other things. I record the test and test as I go it will pass, even on a loop of six tests. But once I reboot my system or move my test to a system with Test Execute it will not pass. I'm kind of at a loss as to next stepped, I'm currently looking at the code of the program to see if I can create some kind of look hole to work around. 

Are you clicking it by object name or by coordinates?

I have tried both along with picture verification. 

Let's see a screenshot of the advanced object spy results for that button please

I have to work that through with one of my engineers to verify what I'm going to post prior to posting it. 


Thank you for your help. I should be able to update tomorrow. 

SmartBear Alumni (Retired)

Hi @CGilbert,


Any updates? Was the issue resolved?

Tanya Yatskovskaya
SmartBear Community and Education Manager

No, not yet, working through some of the ideas I have been giving. Also working with my developers to see if I can share the picture of the advanced find box. 

Esteemed Contributor

This sounds very much like a timing issue.


Something to keep in mind: TestComplete attempts to execute commands, operations, actions, as quickly as possible.  If that button does not "exist" in memory soon enough, when TC attempts to click on it, you'll get that message.  You should do tests for "Exists" before attempting to click on the button.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Showing results for 
Search instead for 
Did you mean: