Forum Discussion
Colin_McCrae
12 years agoCommunity Hero
I get you.
If you are happy that an object ID will never change, then I can see how this would work for you.
But if an object ID did change. Or a parent object you use to start your search was removed, I assume you would have to go through all your scripts updating search calls?
Using Aliases to reduce the complexity of object references works very well if you do it well in the first place. To use Tez's object as an example:
Aliases.browser.pageMymome.panelUiDialogUiWidgetUiWidgetCon.formForm0.tableModalformwrapper.textboxQuestions0AnswerAnswertex
Now
Aliases.browser.pageMymome.panelUiDialogUiWidgetUiWidgetCon2.formForm0.textboxQuestions0AnswerAnswertex
Which looks very like a straight copy of the name map object. I wonder if it would have been possible to store the Alias as:
Aliases.browser.pageMymome.textboxQuestions0AnswerAnswertex
In the first place. So then when the intermediate parts ".panelUiDialogUiWidgetUiWidgetCon2" and "tableModalformwrapper" changed, you simply update the name map and updating that will correct the Alias without any further work. Thats the point of Aliases. To reduce complexity of object references and give you a "control layer" between the original name map and your scripts. At least, thats my interpretation of it anyway.
An example of one of mine is:
Sys.Browser("chrome").Page(my website).Panel("pageContainer").Panel("mainPage").Panel("contentContainer").Panel("mainContent").Panel(0).Form("create_user_form").Label(0).Select("creation_selection")
Has an Alias of:
Aliases.Browser.Website_GlobalControls.Form_CreateEstate.DropDown_Create
So if any of the intermediate panels change, I just update the name map. I don't have to touch the Alias or scripts that use it. I know the page will always be there. I know the control will always be there. So they are all that is included in the Alias. It's the intermediate stuff that is likely to change so it is excluded.
Its an interesting subject. And always a minefield. So I'm always interested to see how people approach it.
If you are happy that an object ID will never change, then I can see how this would work for you.
But if an object ID did change. Or a parent object you use to start your search was removed, I assume you would have to go through all your scripts updating search calls?
Using Aliases to reduce the complexity of object references works very well if you do it well in the first place. To use Tez's object as an example:
Aliases.browser.pageMymome.panelUiDialogUiWidgetUiWidgetCon.formForm0.tableModalformwrapper.textboxQuestions0AnswerAnswertex
Now
Aliases.browser.pageMymome.panelUiDialogUiWidgetUiWidgetCon2.formForm0.textboxQuestions0AnswerAnswertex
Which looks very like a straight copy of the name map object. I wonder if it would have been possible to store the Alias as:
Aliases.browser.pageMymome.textboxQuestions0AnswerAnswertex
In the first place. So then when the intermediate parts ".panelUiDialogUiWidgetUiWidgetCon2" and "tableModalformwrapper" changed, you simply update the name map and updating that will correct the Alias without any further work. Thats the point of Aliases. To reduce complexity of object references and give you a "control layer" between the original name map and your scripts. At least, thats my interpretation of it anyway.
An example of one of mine is:
Sys.Browser("chrome").Page(my website).Panel("pageContainer").Panel("mainPage").Panel("contentContainer").Panel("mainContent").Panel(0).Form("create_user_form").Label(0).Select("creation_selection")
Has an Alias of:
Aliases.Browser.Website_GlobalControls.Form_CreateEstate.DropDown_Create
So if any of the intermediate panels change, I just update the name map. I don't have to touch the Alias or scripts that use it. I know the page will always be there. I know the control will always be there. So they are all that is included in the Alias. It's the intermediate stuff that is likely to change so it is excluded.
Its an interesting subject. And always a minefield. So I'm always interested to see how people approach it.