Forum Discussion
12 Replies
- nisguptaValued Contributor
I do have some issue with object spy . Whenever I select the object to display the drop down list and do Object spy then drop down list get closed . So cannot recognize
- sanjay0288Frequent Contributor
To get the properties of drop down.. Open object spy and select ->Point and Fix option(Ctrl+Shift+A). This makes object spy to be in pointing mode. Click on dropdown in your Application. Point to the dropdown box once a red border appears on your dropdown press Ctrl+Shift+A. Now you will be able to get the properties of the dropdown.
- tristaanogreEsteemed Contributor
What class of object is it? What properties does it have? While we can see the GUI layer of the rendered object, it doesn't do us much good to be able to give you a generic function without more detail about what kind of object it is.
I don't think we need an object spy of the drop down list for starters. However, we do need the properties of the actual search control so we can help you write the code for it.- nisguptaValued Contributor
I have attached the object properties.
Let me know if you need more details
Thanks
NG
- sanjay0288Frequent Contributor
What is the exact requirement? The approach would be a function where you are passing "itemName" which would be present in the dropdown list.
What you have to do is Click on the search box so that dropdown comes and use the clickitem method to click on an item which is present in the dropdown.
- shankar_rCommunity Hero
Hi,
As part of creating generic function for this kind of control, you can create function like below,
function searchandClickDropDown(dropDownMainobject,valuetoSearch,valuetoSelect) { //dropDownMainobject is the object which will have the dropdown list with text box. var txt_box_proparr = new Array("<mentione your property name to find textbox>"); var txt_box_valarr = new Array("<mentione your property value to find textbox>"); var lst_proparr = new Array("<mentione your property name to find drop down object>"); var lst_valarr = new Array("<mentione your property value to find drop down object>"); if(dropDownMainobject.Exists) { var txtObject = dropDownMainobject.FindChild(txt_box_proparr,txt_box_valarr); var lstObject = dropDownMainobject.FindChild(lst_proparr,lst_valarr); dropDownMainobject.Click();//To display the drop down. txtObject.Keys(valuetoSearch); if(lstObject.wItemCount > 0) { lstObject.ClickItem(valuetoSelect); return true; } } return false; }
- nisguptaValued Contributor
Here the issue is testcomplete not able to recognize the search text box with unique properties . I am attaching the screenshot. This also include how firebug recognize the search text box.
Thanks
NG
- tristaanogreEsteemed Contributor
If there are no other text boxes within the hierarchy of the parent object, then the ObjectType of 'textbox' is sufficient identification. You can add other properties such as ObjectIdentifier (current value 0) to your mapping properties to add additional information. But based upon what I'm seeing, you SHOULD be able to map that object just fine. You can object spy it enough to get the property listing.
But, apparently, something is not working or you wouldn't still be asking. so... are you getting an error message when you try to use the mapped object in a test case? If so, what is it?