Forum Discussion

vijay_rout21's avatar
vijay_rout21
New Contributor
13 years ago

Not able to select a particular item from a drop down list in script

Hi,

I am also facing a similar problem. I am writing the script for a web page manually in JavaScript using Name Mapping. There is a part where TestComplete has to select a value from a drop down list.

First i tried using the text and later using the index. When i am playing it back TestComplete is not throwing any error but its not selecting any value from the drop down list. Thats why i'm unable to write the script further, because if i write next step, Test Complete is throwing the error for that previous step.



Here are the lines of code:

1. Using Index:


Aliases.browser.selectMaincontentDdlcustomrname.ClickItem(2);


Aliases.browser.selectMaincontentDdlcontactperso.ClickItem(1);



2. Using Text


Aliases.browser.selectMaincontentDdlcustomrname.ClickItem("AMERICAN CONSULATE");


Aliases.browser.selectMaincontentDdlcontactperso.ClickItem("FAYAZ HUSSAIN");



Do you have a solution to this?




4 Replies


  • Hi Vijay,


     


    As far as I understand, TestComplete doesn't click the specified item and there are no errors in the test log, right? Could you please zip your entire project suite folder along with the log of the test execution and post the archive here?


     

  • indubousely's avatar
    indubousely
    Occasional Contributor

    Hi


     


    I am Using Test complete in Windows desktop application, in this application i have many drop down and grid controls and i am facing  couple of issues. 


    1) while recording the project I used script method and selected one value from the drop down, when i do play back i want to choose another option from the drop down, but here its taking the co-ordinates(Position values) so i can't give the drop down options names directly, also  its not displaying ClickItem() method, Only the Click(),ClickR() and ClickM() Methods are available. please give me valuable feedback ASAP.


     


    2)While recording the application i have entered values in the Grid one by one from top to bottom, but on play back its not re-entering the values. Value get filled only for the first cell after it  moved to next one and shows object doesn't exists error.


     


    please tell me how to overcome these two problems.

  • i am also getting problem while tring to click on drop down item, i am using powerbuilder application.

    not able to call clickitem() method only click() option found here, can anyone suggest me for it. is any other way to automate drop down list item without using clickitem method?



    What changes required for it?