Forum Discussion

CGilbert's avatar
CGilbert
Contributor
5 years ago

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.

  • 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.

     

     

    • CGilbert's avatar
      CGilbert
      Contributor

      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. 

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Are you clicking it by object name or by coordinates?