Is it possible to create a temporary Alias/Name Mapping?
Good Day folks,
I'm trying to achieve something I am not sure can be done in a Web application. The question is:
"Can I take an object I found by ID, Name, etc. and Alias it, then remove the Alias when I'm done ? "
This isn't the only way to do what I'm aiming for, but it would be the most convenient. Here is how it currently works:
I have a web control. As everybody knows, their ID can be all over the place. They can also be on multiple pages or be on a page multiple times. This causes a ridiculous amount of mappings, so I'm trying to write a script that will take a parameter for the object and a parameter for the value and set it accordingly without needing to map so many objects. I'm throwing it into script that takes the Parent's alias then has methods for setting values. I can extract the ID for the controls from the Parent Alias' name etc. by using a .Find() of the textbox's name, which I will now know what it will be. Et voila, I have the textbox I would like to work with. Problem is, this is a regular object (textbox, panel,checkbox etc.), not an Aliased object. This is an important distinction, because I can use WaitAliasChild if is Aliased - I have a script that does some try-catches, retries and error logging that wraps the builtin WaitAliasChild - not to mention the fact that I have lots of other fancy footwork and scripts that depend on the Alias rather than the object.
EDIT:
I have marked the correct response, but be sure to check the reply by me at the end of the thread that has a gotcha you need to be aware of when using the proposed solution
Any thought or suggestions would be welcomed.
If I understand you correctly, you would just like to be able to dynamically change a search value for a mapped object?
Namemapping values can be tied to a Project Variable which you could then set the value of at run time. Does this accomplish what you need?