DS3 Page Structure
The page Structure call returns a list of valid elements and a unique identifier based on elements. Both the unique identifier and the elements are based on the type provided and will use all windows in the current session.
_pageStructure= pageStructure(validDomains,type)
Parameters:
validDomains a list of valid domains with its protocol for main windows we want to get the structure. It accepts JSONArray, ArrayList and String[]
type: The type of elements the pageStructure wil provide. Currently Smarttags, Inputs, Tags, SmarttagsInputs and SmarttagsTags are the valid values to pass.
Description: Example: in a single frame, single window
Copy
{
elements:[
{locator"link('demo')",type:"navigation",...} //Window and frame piece in locator added only if strictly required
],
hashCode:12312312 //Hashcode is hashCode("link('demo')") because there is only one element
}
Two elements with different locators in different frames
Copy
{
{
elements:[
{"locator":"product('demo')",type:"navigation",} //Window and frame piece in locator added only if strictly required
{"locator":"menu('demo')",type:"navigation",} //Window and frame piece in locator added only if strictly required
],
hashCode:567656 //Hashcode is hashCode("menu('demo')product('demo')") sorted alphabetically
}
Two elements with the same locators in different frames
Copy
{
elements:[
{"locator":"product('demo')",type:"navigation",} //Window only added if strictly required. No iframe for mainframe element
{"locator":"frame(["0","http//url.com"]).menu('demo')",type:"navigation",} //Window only added if strictly required. Iframe added for subframe
],
hashCode:567656 //Hashcode is hashCode("menu('demo')product('demo')") sorted alphabetically, window and iframe not used as they might change a little during executions
}
Two elements with the same locators in different windows
Copy
{
elements:[
{"locator":"product('demo')",type:"navigation",} //Window and frame piece in locator added only if strictly required
{"locator":"menu('demo')",type:"navigation",} //Window and frame piece in locator added only if strictly required
],
hashCode:567656 //Hashcode is hashCode("menu('demo')product('demo')") sorted alphabetically, window and iframe not used as they might change a little during executions
}