VVinay
13 years agoNew Contributor
Object Identification only through Property-Value pair?
Hello,
(Ours' is a web based application. We are only using script based testing, writtien in C# script language.)
I am aware of how we use name mapping for identifying the objects and perform action on it. But I am yet to discover a way in which any control can be identified by only its property-value pair. We are on the verge of writing a frame work, if this concept is addressed we would be grateful.
example: for google application, consider performing an operation on the search "text box". If we want a unique property for this object, it is Property: idStr, and Value: gbqfq.
Traditionally it is done something like this:
(Ours' is a web based application. We are only using script based testing, writtien in C# script language.)
I am aware of how we use name mapping for identifying the objects and perform action on it. But I am yet to discover a way in which any control can be identified by only its property-value pair. We are on the verge of writing a frame work, if this concept is addressed we would be grateful.
example: for google application, consider performing an operation on the search "text box". If we want a unique property for this object, it is Property: idStr, and Value: gbqfq.
Traditionally it is done something like this:
fieldset = iexplore["pageGoogle"]["panelMngb"]["panelGb"]["panelGbw"]["panelGbq"]["panelGbq2"]["panelGbqfw"]["formGbqf"]["fieldsetGbqff"];
textbox = fieldset["panelGbqfqw"]["panelGbqfqwb"]["tableLstT"]["cell"]["table"]["cellGsibA"]["panel"]["textboxGbqfq"];
textbox["SetText"]("testcomplete");
What we are looking forward is something like this:
var editBoxGoogleSearch = page["FindObject"](idStr, gbqfq);
editBoxGoogleSearch["SetText"]("testcomplete");
where, "FindObject" is a function which will search for object with property: idStr, and value: gbqfq.
For this type of function to work, first I assume, we have to assign the entire webpage as a container, with in which all searches will happen.
Thanks in advance. Anticipating for a response.