Forum Discussion

parthkar27's avatar
parthkar27
Occasional Contributor
7 years ago

How to enable a combobox or a listbox ?

I am trying to select an object from combo box or listbox but, I am getting an error as "ComboBox " is not enabled,even thogh the combobox is present and its visibility is marked as true in object spy.Then why is it not enabled?What can be the reason behind this?

 

How can we enable the combo box?

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Is there an action or event that occurs before your attempt to click on the ComboBox that would enable it?  It's possible that this is an issue in timing where the ComboBox may not be immediately enabled when your test attempts to click on it.

    Best bet is to use a WaitProperty method on the ComboBox to wait for it to be enabled.

    • parthkar27's avatar
      parthkar27
      Occasional Contributor

      Thanks for your response.

       

      As per your suggestion, I induced wait to my code by using Call Delay function but,  it did not work and did not fetch me the desired result i.e. the combox was still disabled.

       

      Is there any way to enable that combo box ?

       

      Thanks in advance

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Enabling a combo box is not a function of what TestComplete does.  TestComplete attempts to interact with the component.  If the component is disabled (meaning the "Enabled" property is set to False) then TestComplete will generate the message you are receiving.

        So, the question REALLY is: why is the box disabled when TestComplete attempts to interact with it?  Are you properly identifying the box? Is TestComplete seeing some other box when you send the command?  

        This is where you dig in and figure out "why is it disabled?"  Use Object Spy and Object Browser and manually walk through the test steps yourself and see if you can figure out why TestComplete sees the box as disabled.