Forum Discussion

Subbulakshmi's avatar
Subbulakshmi
Frequent Contributor
12 years ago

Click button not working in test complete

Hi,



I am using TC9.2 licensed version for our application UI testing. In that, when I try to click a button, it is logging message "Object clicked with left mouse button" but actually, the button is not clicked in the application. When I try to highlight, the button is getting highlighted. I tried giving delay of upto 10 seconds, after that also, the button is not clicked. I have tried to check whether it is exist/enabled then click on that button condition check.. It is entering into the condition that, the button is enabled, but the button is not clicked.



Can you please help me on this.





Regards,

Deepa

3 Replies

  • Here is an example:



    var ButtonRef =  


    Sys.Process("AEMS.PSS.Infrastructure.Shell").WinFormsObject("XtraWindowForm", "*").WinFormsObject("YesButton");

    if(ButtonRef.Exists)

    {



      ButtonRef.Click(); OR ButtonRef.ClickItem("YesButton); OR

      ButtonRef.DblClick("YesButton,0);

    }

    else

    {

     log.Warring("Uanble to get Yes Button reference...Please investigate");


  • Hi Deepa,



    I found that issue once, and I solved it with the brute force.



    I created a method called force click. It performed some actions while the button existed. Thoses actions where:


    • Click on the object


    • If it still existed, press space on that object ( object.Keys("[Space]" )


    • If it still existed, press enter on that object ( object.Keys("[Enter]" )


    It did the trick for me, I hope it helped!
  • Please share a code or add delay before perform any action on button and try ClickButton() Action.