SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Oct 2005
    Location
    usa
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to get the last parent object

    Hi all,

    I am passing Object element to the function.
    Example:

    Object=browser("QTP").Page("QTP1").Link("select")

    Public function ClickOnLink(Object,index1)
    ...
    ...
    End function

    Inside the function i want browser("QTP").Page("QTP1") so that i can put
    index2="index:="&index1
    object.Link(index2)

    How to get the last parent object.

  2. #2
    Member
    Join Date
    Apr 2004
    Location
    India
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the last parent object

    Hi,

    YOu can use GetTOProperty("parent") that will return the parent object.

    Like your Example
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Set Parent = Object.GetGetTOProperty(&quot;parent&quot </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Now the value of parent is browser("QTP").Page("QTP1")

    Hope this will solve ur problem.

    Thanks,
    Sreekanth Varma

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to get the last parent object

    Originally posted by sk_varma:
    Hi,

    YOu can use GetTOProperty("parent") that will return the parent object.
    <font size="2" face="Verdana, Arial, Helvetica">Well this is never gonna work as there is no parent property available with the GetROProperty for Link.

    Pranay, Know i feel there are two solution that you can follow

    1. Pass both the parent as well as child object to the function.
    2. Pass the string for the object to the function and then use the string function to get the parent object string and then use the Execute (a vbscript function) to create the object from the string. Well this one is a very complex kind of a solution and i really would recommend you to go for the first one.

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Location
    usa
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the last parent object

    Any other solution..
    like..
    .Object.firstChild
    or
    .Object.lastChild

  5. #5
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to get the last parent object

    That gives you the DOM object nodes and not the QTP objects.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:44 AM.

Copyright BetaSoft Inc.