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.
Solved! Go to Solution.
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.
https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/checking-existence.html
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.
Hi @CGilbert,
Any updates? Was the issue resolved?
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.
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.
https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/checking-existence.html
Subject | Author | Latest Post |
---|---|---|