SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4

Thread: Links & QTP

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Links & QTP

    All,
    I'm having issues with 2 of my test scenarios...any help would be GREATLY appreciated

    Test Scenario1 : :
    We have 10-12 links in a webtable and my script needs to iterate thru those links and click each one of them. The Problem is that one link opens up in a new pop window(with a dynamic site name) and all other links open In-Application. so, when my script clicks on the link(which opens the pop-up window), it does not come back to the original webtable and click on the next Link. Can some one please help...

    My Script :
    Set oDesc = Description.Create()
    oDesc("html tag").Value = "A"
    For i=0 to num-1
    set rc = Browser("XXX_10").Page("XXX").WebElement("WebTable ").ChildObjects(oDesc)
    ' get the href of the link
    ref = rc(i).GetROProperty("href")
    Browser("XXX_10").sync
    title1=Browser("XXX_10").getRoproperty("title") 'get the tile of the target page
    Browser("XXX_10").navigate(ref) 'Navigates to the url taken from “href" property
    Browser("XXX_10").sync
    title2=Browser("XXX_10").getRoproperty("title") '’get the tile of the Navigated page
    Browser("XXX_10").sync
    Next


    Test Scenario2 ..

    I have 4 links in webpage and one of them is "Logout".. I need iterate thru 4 links and click on "logout" link last .... i have tried the index & creation time , but the script still clicks on the logout link after first 2 links and is logging out of application. Also, index # of "logout" ink changes

    My Script :
    Set oDesc = Description.Create()
    oDesc("html tag").Value = "A"
    'Retrieve HTML tag
    set rc = Browser("XXX_8").Page("XXX").ChildObjects(oDesc)
    'Getting the Child objects of the "Webtable " From Page
    num = rc.Count() 'get the number of link in a page
    For i=0 to num-1
    set link1 = Description.create
    If Link1("Innertext").Value = "Logout.*" Then
    Browser("XXX_8").Page("XXX").sync
    Else
    Browser("XXX_8").Page("XXX").link("text:=.*","inde x:="&i).click
    Browser("XXX_8").Page("XXX").sync
    End If
    Next


    Any correction or any advise to my scripts is appreciated.

    Thanks.

  2. #2
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Links & QTP

    any advice ?

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Links & QTP

    Tarun / gurus... can someone please please advice!

  4. #4
    Member ravikonka's Avatar
    Join Date
    Oct 2007
    Location
    Brussels, Belgium
    Posts
    181
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Links & QTP

    Use Child Objects in QTP...read the QTP help or search in this forum for same...
    Ravi Konka -

    ***** Help others it will help you *****

 

 

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 06:14 PM.

Copyright BetaSoft Inc.