Forum Discussion

SruthePrakash's avatar
SruthePrakash
New Contributor
8 years ago

Drop down selection with shell scripting

Can anyone guide me on how to select an option from drop-down using shell scripting with python ?

3 Replies

  • sanjay0288's avatar
    sanjay0288
    Frequent Contributor

    Hi,

      You can use object.ClickItem(<drop down item name>) to select the dropdown option.

     

    Sample code is given below as reference

     

    def DropDown(): 

    objBrowser = Sys.Browser("iexplore")

    objBrowser.ToUrl("http://support.smartbear.com/message/?prod=TestComplete")

    page = objBrowser.Page("*https:*")

    cBox = page.FindChild("Name", "Select(""lstAnswer"")", 100)

    cBox.ClickItem("None of the above")

     

    Hope this might be of help.

     

    Regards,

    Sanjay

  • shankar_r's avatar
    shankar_r
    Community Hero

    Why you are selecting the Drop down values using Shell scripting?

     

    You can use in-build method like SelectItem(). Refer here

     

  • sanjay0288's avatar
    sanjay0288
    Frequent Contributor

    The above sample is assuming that you are using python as scripting language for your Test Complete project.