SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Clicking Mulitple Links in a webelement--> issues

    AS you all know by now that i'm learing QTP and executing some samples on my own ...

    I'm having some issues when trying to create a script for a scenario...

    I have multiple links in webelement(html tag :=Tab) and have to click on this each availabe link and when the link opens in a new page--> then i need to see if they a submit button....


    PLEASE HELP...........!struggling with this issue since 2 weeks...
    ************************************************** ******************
    ‘SCENARIO NAME : ************************************************** *********************

    Set oDesc = Description.Create()
    ‘ Retrieve HTML tag
    oDesc(”html tag”).Value = “A”
    Set rc = Browser(”title:=.*”).Page(”title:=.*”).ChildObject s(oDesc)
    num = rc.Count() ’get the number of link in a page
    For i=0 to num-1
    Set rc = Browser(”title:=.*”).Page(”title:=.*”).ChildObject s(oDesc)
    ref = rc(i).GetROProperty(”href”) ’get the “href”propety of the i th link
    Browser(”title:=.*”).Page(”title:=.*”).link(”text: =.*”,”index:=”&i).click ’click on i th link
    Browser(”title:=.*”).sync
    title1=Browser(”title:=.*”).getRoproperty(”title”) ’get the tile of the target page
    MsgBox title1
    Browser(”title:=.*”).navigate(ref)’Navigates to the url taken from “href” property
    Browser(”title:=.*”).sync
    title2=Browser(”title:=.*”).getRoproperty(”title”) ’get the tile of the tNavigated page
    MsgBox title2
    If title1=title2 Then’condition to check for the targetted page and Navigated page
    Reporter.ReportEvent 0, “Navigated To Correct Page”,”"&title1′Reports if correct
    else
    Reporter.ReportEvent 1,”"&title1,”"&title2
    End If
    Browser(”title:=.*”).back’Navigates back to main page
    Browser(”title:=.*”).sync

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Clicking Mulitple Links in a webelement--> issues

    You haven't mentioned where are you struggling? and what error are you getting?
    Snehal Pailkar

  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: Clicking Mulitple Links in a webelement--> issues

    Hi Shilpa,

    The issue is - I need to click on the links in the webelement inside the page.(there are other links on the same webpage, which my script should not click). The script I wrote gets all the links on the page, which is not what I want. Hence I am checking each link by it's name and clicking it. When a link is clicked it opens a new page and checks if a submit button exists. My script is doing all this. But since I have many links in the webelement on the page, checking each link by it's name is not an effecient method. I want my script to be more dynamic.

    I want my scripts to parse through the web element and get a count of the number of links and then loop through them and click on each link. Each new window that open has an id that keep incrementing (for eg., if parent window's name is pagename, the child windows would be pagename1, pagename2, and so on.)

    Can you please help me with this. Or if you have a better suggestion please let me know.

    Thanks,
    Siddu

 

 

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:50 PM.

Copyright BetaSoft Inc.