I need to obtain the parent of an object programatically, so
if I have:
winButton("aButton")
I need to obtain the parent part:
window("Window1").Dialog("Dialog1")
so I can programatically create a string of the full name of
the object to call it with an execute statement in QTP
I would like to use something like:
part[1] = "window(""Window1"")"
part[2] = "dialog(""Dialog1"")"
so I can do:
exeLine = part[1]&"."&part[2]&"."&"winButton(""aButton"")"
Execute exeLine
Apart from keeping a record of the window/dialog hierarchy
is there a parent or path function/ command
Thanks
Adrian
Answer / Ranjit Kumar
In QTP (QuickTest Professional), you can use the `Parent` property to get the parent object of another object. This can be done programmatically as follows:nn```javascriptnDim parentObjnSet parentObj = objRef.Parentn```nHere, `objRef` is a reference to your object (e.g., winButton("aButton")) and `parentObj` will hold the parent of that object.nnAs for a path function/command, QTP does not provide built-in functions to dynamically build an object path like you mentioned. However, you can create custom methods or functions to help construct paths based on your application's structure.
| Is This Answer Correct ? | 0 Yes | 0 No |
suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?
i have 2 year experience in manual and automation testing, I have less percentages in X, Xii (Second grade), can i elgible to TCS interview (Or MNC's)
What is the BPT(bussiness process testing ).and what is the main difference between BPT and QTP
3 Answers EDS, GL Noble Denton, IIST,
How to Import data from a ".xls" file to Data table during Runtime.
Ex : some mail name with surname Email id's there that is string fetch the particular surname only how to get particular surname all emails
How you will rate urself in QTP in the range of 0 to 5
What is use of object spy?
how can i use text check point in descriptive programming. or else is there any way to compare the text in the application and the text in data table.
Reverse a string keeping the words in the string as it is. E.G. "Quick Test Professional" O/P "Professional Test Quick"
Where can I find and view run-time data table?
what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?
What is descriptive.create () in QTP?