Forum Discussion

sitasrikanth's avatar
sitasrikanth
Contributor
12 years ago
Solved

Drop-down box cannot be closed...

Hi,



I have a drop -down and each item has a checkbox. When selecting a item in the drop-down using the method ClickItem, Item is getting selected sucessfully.



But Issue here is once item is selected in drop-down test complete is displaying the message "waiting until drop-down box closes" and after that error is posted to test complete log "The drop-down box cannot be closed. "



FYI - With Manual operation, once item is selected in drop-down we've to click some where to close the drop-down.



Can anyone please tell me how to handle such situation in Automation?
  • Create OnLogError event handler - see Creating Event Handlers.

    The handler code should be like this:



    function OnLogError(Sender, LogParams)

    {

      if (LogParams.MessageText == "The drop-down box cannot be closed.")

        LogParams.Locked = true; // tells to suppress this message

    }

7 Replies

  • gid_216's avatar
    gid_216
    Frequent Contributor
    Hi Srikanth,



    After selecting the required checkboxes, put below statement



    Alliases.<APP Name Map>.Click

    OR

    Alliases.<APP Name Map>.Click(0, 0)

  • Hi Deepak,



    Error is observed while performing ClickItem action itself i.e Before execution goes to next statement in the script.





  • Hi

    can anyone please help on this issue as this is giving error while running scripts..
  • You have at least two options:

    1. add error handler and ignore errors with message text "The drop-down box cannot be closed."

    2. don't use ClickItem, use some different method to check needed item - it depends on the kind of control you are using.
  • Hi,



    ClickItem works perfectly but i am worried about the error message posted to log. So if I can skip such error message in TC log, thats fine.



    Can you tell me how to skip/delete particular error messages in the log?



  • Create OnLogError event handler - see Creating Event Handlers.

    The handler code should be like this:



    function OnLogError(Sender, LogParams)

    {

      if (LogParams.MessageText == "The drop-down box cannot be closed.")

        LogParams.Locked = true; // tells to suppress this message

    }