Forum Discussion

ThomasCasserly's avatar
ThomasCasserly
Frequent Contributor
7 years ago

Button detected as disabled during test run and causing test failure

Hi,

I am having an issue with controls that is causing my test to fail. Control in question is a button on a pop up dialog. The button only becomes enabled after the user enters text into a text field

During my test the click operation on this button fails with TestComplete reporting that the button is disabled.

 

The button is visually enabled onscreen, if I use the object spy the "Enabled" Property for the button displays "True".

I have tried adding WaitProperty method for the button, choosing the Enabled property of the button under test and setting the Property value as boolean "True".

I have also tried using the Exists method for the button.

In both cases TestComplete appears to check these methods, pass them, then move on to the button click method and fail with the "button is disabled" message.

 

This also happens on at least one other pop up dialog in my system and I am currently assuming it will happen on all where a button is disabled until the user enters data in some other field.

 

I've checked the other issues here on the community and solutions suggested there i.e. use WaitProperty, have not resolved the problem

 

Browser: Firefox

OS: Windows 10

Oh also, I'm running keyword tests, I've no scripting/programming experience.

 

Any help would be greatly appreciated

16 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    How do you find your control (using NameMapping, Find() method)?

     

    Probably you have a several number of similar buttons in the DOM. TestComplete finds the first one, and if it is disabled, your test fails.

    • ThomasCasserly's avatar
      ThomasCasserly
      Frequent Contributor

      Hi baxatob,

       

      I'm using namemapping, I have manually mapped all the controls in the application so the tree structure is unique for each Add button in the system, so I don't think there can be any confusion for TestComplete, but then again I don't know enough about mapping of controls to say that for certain.

      When the pop up dialog is displayed Testcomplete appears to ignore all controls on the webpage in the background i.e. I can't highlight or use object spy to view properties of those controls. So I'm assuming that it can only work/detect the controls  the pop up dialog and on this there is only 1 button, the one I'm trying to perform a click on.

       

      I don't have any issue highlighting the control from within the test either, when I right click within the test steps and click highlight the correct step is highlighted.

       

      Is there any way that I can see which button TestComplete is using/taking the properties from during the test run?

       

      • baxatob's avatar
        baxatob
        Community Hero

        Please fire the popup dialog on your page, then go to Name Mapping -> right click on your mapped button and select Highlight on the screen. Whould it be highlighted?