Forum Discussion

mikileung's avatar
mikileung
Occasional Contributor
4 years ago

Web dropdown menu

Hi,    I am trying to write a script (Python) to  - click the down arrow button  - select one of the options in the drop down menu.  Here is my script. It failed with the log saying "The object ...
  • mikileung's avatar
    4 years ago

    Thanks 

     

    I have changed the p to narrow down the search area. I managed to find the object but now it says There was an attempt to perform an action on a zero-sized window. 

    The drop down list does not hold up, which it is very hard to map the object. That is why I used the find object method. If I map the object with the object spy, it would say the object is not under the object tree. 

     

    Is there a way to solve this problem? 

     

    Here is my adjusted code, 

    def my_test():
    # Find all enabled buttons in the Replace dialog
    p = Aliases.browser.pageLogon.sectionShellSplitCanvas.frameApplicationActivitytypeMana.frameIframeid.activityTypeCat_dropdown_var
    my_choice = p.Find("contentText","Manual entry, manual allocation",2,True)
    if my_choice.Exists:
    Log.Message("FOUND IT!")
    my_choice.Click(-1,-1)
    else:
    Log.Message("Cannot find the menu option")