Forum Discussion

ShahZaib's avatar
ShahZaib
Contributor
2 years ago

The Drop-down box cannot be closed error

Hi 

I am trying to fetch a property from the dropdown using the ClickItem() function. It was working fine before but now all of a sudden it's not working

It opens up the dropdown but it does not select the item under it and says "waiting for the drop-down to close" after this, it throws the following error in the log

The Drop-down box cannot be closed error

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    We use Bootstrap controls in our web application, and that's how they work.

     

    Your control may be different, but you need to know the behaviour

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    With certain controls like a dropdown list on a web application, you have to click the control for the dropdown list to appear, then call click item to select an item, then click away to close the dropdown list!

     

    If the dropdown list has a default item selected/shown, then you need to ensure you use the correct properties, so that TC can find the correct object

  • For me, it opens up the dropdown correctly but after that, it just gets stuck on waiting for a dropdown message

    The strange thing is if I click anywhere else at that time it closes the dropdown (correct behavior) and then everything works fine means It opens the dropdown again and selects the correct option

     

    ANd more strange its the same script was working fine few days back but now its not

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I'm not sure what your control looks like (or the properties chosen), but there's usually two parts to a dropdown list.

    Calling Click method on the red part will show the list beneath it. Calling ClickItem method will select an item from the green part.

     

    You need to get an understanding of how your control works, and then write the appropriate actions to simulate this.

  • As per my understanding for ClickItem, we don't need to perform Click first to open the dropdown 

    ClickItem itself opens the dropdown and selects the option

  • LaRo's avatar
    LaRo
    Occasional Contributor

    The same thing happened to me!!

    Is there a solution??

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    LaRo - you need to understand how your control works, and then write the appropriate actions to simulate this. ClickItem may not always work for your control.

  • warrenw39's avatar
    warrenw39
    Occasional Contributor

    This is an issue and was meant to be fixed in the latest TC version 15.55 but does not appear to have been implemented correctly. There is no requirement for a Click() event before the ClickItem() event as the latter event is meant to handle this process.