Micro Focus QTP (UFT) Forums
Adding a Visual ID - creating a function - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Adding a Visual ID - creating a function (/Thread-Adding-a-Visual-ID-creating-a-function)



Adding a Visual ID - creating a function - jcraig26 - 11-09-2012

Anyone ever tried this? I want to create a visual identifier that I would add to an object so it can be correctly identified by by QTP.

I have a list of items:

+123 Smith John123 John123@smith.com
+234 Smith John234 John234@smith.com
+345 Smith John345 John345@smith.com
+112 Smith John112 John112@smith.com

I am adding another row to this list. But, I don't know where in the list it will appear - 1st, last or in between. I need to click the '+' to expand the nested information. The '+' objects are identical except for the Ordinal Identifier - Index. Unfortunately, I can't use that either. I have not found that number to be stable. Each time I have run the test, I see a different number.

My proposed solution is to use the email address which I set as a variable early in the script as a visual identifier for the '+'.

I created the '+' object in the repository as well as an email object on this page.

My plan is to use the SETTO to make the email address as the innertext of the webelement. Then, using scripting, set the email object as the visual identifier of the '+' saying the email is to the right and inline with the '+'

Does this make any sense to anyone? Any better ideas?