Micro Focus QTP (UFT) Forums
Look up table - 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: Look up table (/Thread-Look-up-table)



Look up table - Skepsis - 03-19-2008

Hello,
I am trying to create a look up table for multiple repositories that represent different versions of the same application and some objects have changed in both name and type so I can continue to use the same scripting framework tests.
To do this I need the my current location in the app as a QTP line like:
Window("Wnd1").Dialog("DLG1") in a variable
I want to only store the objects name and not the full path to make construction of the lookup table easier so only the object is stored with a unique name
a_CB, winCheckBox("CB1") rather than
a_CB, Window("Wnd1").Dialog("DLG1").winCheckbox("CB1")
so the full QTP line can be constructed
but in order to do this I need to get my current location in the Application - which window / dialog I am in so I can programatically add the object to the current location to get the full name of the object back e.g do this:
Code:
ExeLine = currentLocation&"."&objectLookup&".Click"
Execute ExeLine
equivilent to
Window("Wnd1").Dialog("DLG1").winCheckbox("CB1").Click

Any Ideas?
I am trying to move to an abstracted model where the testscript is parsed by QTP rather than having fixed test scripts written in QTP.

Cheers
Ade