Forum Discussion
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;
}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
- tristaanogre9 years agoEsteemed 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?
- nisgupta9 years agoValued Contributor
Generally in Name mapping I put 2 properties for an object
ObjectType and other 1 property - may be contenText or idStr, ObjectIdentifier or className etc.
in this case we are putting only one property which is ObjectType .
There are other textboxes but I have to see how it works .
Thanks
NG
- nisgupta9 years agoValued Contributor
I have tried to develop the generic function
Attached the screenshot.
- nisgupta9 years agoValued Contributor
The function is not generic as it use the following property and value to check which may not be applicable to other applications
if(noResults.className == "no-results")
So how can we make it more generic
Thanks
NG
- nisgupta9 years agoValued Contributor
How can we automate the validation if we search failed ?