I think that this is not possible.. QTP follow a top-down approach.. i.e. given a parent object, you can find its child.. But you cant use a child object (like Submit button in your case) to back-track the parent hierarchy...
This is what I think of.. But I have never tried it out.. If someone else has any idea if this can be done, then please share... * cheers, a n i s h [QTP Framework Tutorials]<http://www.automationrepository.com/2012/03/qtp-framework-types-an-introduction/>| [QTP Blogs] <http://www.automationrepository.com/qtp-blogs/> ** [Subscribe to get new posts in your Inbox]<http://feedburner.google.com/fb/a/mailverify?uri=automationrepository/feeds> * On Wed, Aug 21, 2013 at 10:23 AM, <[email protected]> wrote: > Let me clear my point : > > I want to write a function like below : > Function *GetParentObjectString*("Submit") > 'Do calculations here & then return a string like below > GetParentObjectString*="Browser("Browser").Page(" > Page").WebButton("Submit")"* > End Function > > In this function we have provided logical name of object that is > Submit.Now this function will search the parent of submit button that is > here Page & finally it will find the parent of Page that is > Browser.Assuming Submit,Page & Browser objects are in repository. > > Thanks: > Surendra > > On Tuesday, August 20, 2013 10:20:00 PM UTC+5:30, surendra k wrote: > >> Question :Assume you have recorded a web button(say submit) like below : >> Browser("Browser").Page("Page"**).WebButton("Submit").click .All the >> objects Browser,page & submit button are stored in repository. >> >> I want to write a function which takes 1 object as a parameter & returns >> string "Browser("Browser").Page("**Page").WebButton("Submit")" >> >> Please share your thoughts. >> >> Thanks >> Surendra >> > -- > -- > You received this message because you are subscribed to the Google > "QTP - HP Quick Test Professional - Automated Software Testing" > group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/MercuryQTP?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "QTP - HP Quick Test Professional - Automated Software Testing" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- Regards, Anish Pillai My QTP Blog <http://automationrepository.blogspot.com> -- -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en --- You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
