Forum Discussion

EnservePete's avatar
EnservePete
Occasional Contributor
10 years ago
Solved

TC Finding a button but doesn't click on it when the test is run

Having an issue where I've remapped a search button in our app in test as TC couldn't find it. TC now highlights the search button and can find it. However when I run my test. TC can't find the object unless the application was already open when the test started.

  • Sounds like the object heirarchy (map) is different at runtime.

     

    So, outside a run, you can click the map object and highlight on screen and all is well.

     

    But, during a run, it fails to find it.

     

    Which leaves two possibilities:

     

    1. As I said, the heirarchy is different (for reasons unknown) when run via your test. Have you put a break point in on the line it attempts the click? So when it pauses, go into the name map and see if the mapped object highlights on screen.

     

    2. It's a timing issue. So the button is neither visible and/or enabled at the point your test it trying to click it. Again, add a break point, make sure it can see it OK, then restart it. If it find it OK, and works OK after the pause, you have timing issues.

6 Replies

  • Sounds like the object heirarchy (map) is different at runtime.

     

    So, outside a run, you can click the map object and highlight on screen and all is well.

     

    But, during a run, it fails to find it.

     

    Which leaves two possibilities:

     

    1. As I said, the heirarchy is different (for reasons unknown) when run via your test. Have you put a break point in on the line it attempts the click? So when it pauses, go into the name map and see if the mapped object highlights on screen.

     

    2. It's a timing issue. So the button is neither visible and/or enabled at the point your test it trying to click it. Again, add a break point, make sure it can see it OK, then restart it. If it find it OK, and works OK after the pause, you have timing issues.

    • EnservePete's avatar
      EnservePete
      Occasional Contributor

      Hi just tried the first suggestion put the breakpoint in and you are correct the search button isn't found.

       

      How would I rectify this?

      • EnservePete's avatar
        EnservePete
        Occasional Contributor

        I've now managed to get the search button to be found and clicked however my software in test now crashes back to the desktop when clicked which is the same issue as another one I have raised today. TC keeps crashing the software as manually this clicks work.