Forum Discussion

Raghukatta's avatar
Raghukatta
Contributor
7 years ago

Button not getting enabled after checkbox is selected

Hi All,

 

I automating a .net desktop application. I am trying to select a check box in Tree list. Tree list has nodes and sub nodes with check boxes. After selecting check box continue button needs to be enabled.I am able to select checkbox by looping nodes and sub nodes and by using this method subnode["set_Checked"](true);.

But the problem is after selecting a check box continue button is not getting enabled.Looks event is not getting called after selecting a check box.(Manually it is working fine).Are there any methods or any workarounds for this issue.

 

Thank you in advance.

 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Since you're using a native method like "set_Checked", there are probably events in your application that are not getting triggered such as OnClick or something like that.

    Is there a reason why you can't use "ClickChecked" or just "Click" on the object?  That MIGHT trigger the events you need.

    • Raghukatta's avatar
      Raghukatta
      Contributor

      Thank you for your reply. Earlier we used click() but we need to give x,y coordinates in that click. Problem with that method is if the coordinates of that node changes then the script will fail. If I new node is added then coordinates will change. Looking for a more long-term solution.

      I didn't find ClickChecked method for either grid or nodes.

       

      Thanks.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        You don't need to include co-ordinates.  If you have

         

        checkboxObj.Click() that will click in the center of the checkbox.

         

        Now, if that doesn't work for you, you will still need to somehow trigger the event that populates the checkbox.  Look through the methods your object to see if there is something like "on click" or "on checked" or something like that.  This is what it comes down to.  Without knowing more details about teh specific component type you're working with, we can't give more specific answers.