Forum Discussion
I wouldn't necessarily map individual items... depends somewhat on how TestComplete recognizes your drop down control. If you do an Object Spy on your dropdown control, does it have a method like "ClickItem" associated with it?
No, the 'ClickItem' method is not there for the dropdown.
Also, should I Not map the 'child objects' for objects such as dropdowns, comboboxes, etc..?
Thanks
- shankar_r7 years agoCommunity Hero
I see drop down object is having child nodes which i guess the list options.
You can use FindChild to grab the listItem and make use of click method to click them.
like below,
function test(){ dropdownObject.Click(); //click the the drop to expend aqUtils.Delay(1000,"waiting for list render"); var listObject = dropdownObject.FindChild("<proname>","<propvalue>",1,true); if(listObject.Exists){ listObject.Click(); Log.Message("drop down clicked") }else{ Log.Message("drop down not clicked") } }
- russelld6 years agoContributor
Sorry I know its been a long time since you wrote this...the script runs through but it still won't click the listitems. Any other suggestions?
Thanks for the reply!
- SaravanaKumar_N6 years agoContributor
Does it throw any error message?
I can see the methods available for dropdown item in your previous screenshots. Can you share the properties and methods shown for the ListItem?
Also I noticed there is a 'Value' property at your dropdown. If your tests does not care about the way how the dropdown value is set.
You can try something like this...
ddlVehicle.Value = menuItem;
I would suggest this only if you could not find any other option to set the value and if your test does not care the way the value is set.
- tristaanogre7 years agoEsteemed Contributor
lot of it depends upon the class of the object. Looking at your screenshot, while this object is labeled as a "DropDown", it doesn't appear that TestComplete is recognizing it as such. What is the WndClass of the object?
As for mapping the child objects... Again, I wouldn't for the simple fact that it could be a dynamic list... the number of objects, etc., available are probably going to change and fluxuate and, in those kinds of situations, I typically don't map the objects but use some sort of "Find" method to find the object I want, assign to a variable, and then Click on it.- russelld7 years agoContributor
The WndClass isn't listed. How do I get that added?
Thanks Again
- tristaanogre7 years agoEsteemed Contributor
So, there's no WndClass property on the object (Object Spy, properties tab)?
Related Content
- 12 months agolokwk216
- 11 years agoRavik
- 6 years agofunmay
- 12 years agositasrikanth
Recent Discussions
- 2 hours agoSvetaG