Forum Discussion

gdave's avatar
gdave
Regular Contributor
6 years ago

Button is Disabled

Hi

 

I constantly get 'button is diabled' error message and my test fails. I have attached the screenshot of the object properties for your reference. Not sure why but Visible & VisibleOnScreen is set to 'False'.

 

Thanks

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The "Enabled" property on your Add Link button is false... so, because it's not enabled, you can't click on it... that is, at least, how TestComplete is seeing it.  Also, Visible is false... so, something about the object doesn't match what's on screen.

     

    Double check and make sure that you don't have more than one window open... or that there's not another copy of that window open somewhere... or that there isn't some sort of additional "phantom" copy open somewhere... basically, TestComplete is doing what it is designed to do... report that it's attempt to click on the indicated button failed because the properties of the button don't allow for it.

     

     

    • gdave's avatar
      gdave
      Regular Contributor

      But it seems that test complete is bit tempramental with its approach. At times it clicks the button and at times just gives the disabled error.


      tristaanogrewrote:

      The "Enabled" property on your Add Link button is false... so, because it's not enabled, you can't click on it... that is, at least, how TestComplete is seeing it.  Also, Visible is false... so, something about the object doesn't match what's on screen.

       

      Double check and make sure that you don't have more than one window open... or that there's not another copy of that window open somewhere... or that there isn't some sort of additional "phantom" copy open somewhere... basically, TestComplete is doing what it is designed to do... report that it's attempt to click on the indicated button failed because the properties of the button don't allow for it.

       

       


       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Ah, so you don't "constantly" get the error. ;-)

         

        What you've described is a timing issue.  I'm guessing, from your description, that there's some action or event performed before your attempt to click the "Add Link" button which should enable that button (like filling in a text field, highlighting something, etc).

         

        So, my guess is that you need to add some sort of wait method or process in before your attempt to click the "Add Link" to wait until it is enabled before you attempt to click on it.  Look into using WaitProperty on the button to wait for Enabled to be true.