Forum Discussion

RockyRoadn's avatar
RockyRoadn
New Contributor
3 years ago
Solved

DropDown() / ClickItem() Timing out

Hello All,

Encountering a weird problem when interacting with a dropdown menu in a web app that I'm testing in Chrome.  Sometimes it works as expected and the test advances.  However, the majority of the time it has started to fail.  The code executes, the drop down menu opens on screen, but then Testcomplete hangs and eventually times out while "Waiting until the drop-down box appears".  The log then generates the following error message: "The drop-down box cannot be opened".

First attempt:

const taskDropDown = subPage.FindElement("#selTask");
taskDropDown.ClickItem("CAC Badge");

 

Then read some help posts and modified my code to what's below to try and give it some time to load everything:

const taskDropDown = subPage.FindElement("#selTask");
taskDropDown.DropDown();
Delay(1000);
taskDropDown.ClickItem("CAC Badge");

 

Still fails with the same problem, except now instead of timing out on ClickItem(), it times out on DropDown().

Any help on how to resolve is appreciated! 

 

 

  • Thanks Marsha, so the Object name did not change after refreshing But... there is a GET request appending a query string to the URL on the page the dropdown is on.  On a lark I moved my wild card a little further down the URL string closer to the query string that's being stored in my subPage variable and it has, thankfully, started working again... 

2 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Is it possible that the object name (or other property you are using) of the drop down is changing when the page refreshes?  That would cause TC to not recognize it.  

     

    Try checking the drop down with Object Spy, then manually refreshing the page, and then check with Object Spy again and see if the object name is different.

    • RockyRoadn's avatar
      RockyRoadn
      New Contributor

      Thanks Marsha, so the Object name did not change after refreshing But... there is a GET request appending a query string to the URL on the page the dropdown is on.  On a lark I moved my wild card a little further down the URL string closer to the query string that's being stored in my subPage variable and it has, thankfully, started working again...