SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2006
    Location
    pune
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Identifying browser and page without having its info in OR

    Hi

    After clicking on a link in an browser page it will lead to an new browser page .. I have more then 200 links in a page. How can QTP identify the browser and page each link leads to without having its info in object repo.

    Task to be achived
    1)Click on a link in an browser page
    2)get all the link names in the result page

    do step 1,2 for all the pages each link leads to without having the result page identification in object repo of all the browser and pages each link leads to.

  2. #2
    Senior Member
    Join Date
    Jan 2000
    Location
    USA, CA
    Posts
    1,998
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying browser and page without having its info in OR


  3. #3
    Member
    Join Date
    May 2006
    Location
    Hyderabd
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying browser and page without having its info in OR

    Hi kiran,

    Only and the best way is to fulfill your requirement through Descriptive Progarmming only. Its worst to script to add all 200 links to OR and click each one by one and It goes lengthy too.

    Use Descriptive Programming, if you have any doubt on DP let me know somehow i will guide you on my experience.

    Thanks,
    Kiran.E

  4. #4
    Member
    Join Date
    Aug 2006
    Location
    pune
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying browser and page without having its info in OR

    I used the following within my code and is working fine

    alllinks=Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page).getElementeByTagName("A" ).length

    for i = 0 to alllinks - 1
    Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page").getElementeByTagName("A ")(i).click
    Next

    I found some good stuff on http://bondofus.tripod.com
    Thanks.
    I need some more material om DP ..are there any websites which i can refer?

  5. #5
    Senior Member
    Join Date
    Jan 2000
    Location
    USA, CA
    Posts
    1,998
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying browser and page without having its info in OR

    You have to return Browser into its initial state
    in your loop [after ....(i).click],
    because the link, you've expected, might not exist on the page you've navigated in the loop.

    Also, would be nice to add verification if navigation is correct, otherwise, what is the point to do such a navigation without knowing the result of that procedure?

    Janna

  6. #6
    Member
    Join Date
    Aug 2006
    Location
    pune
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying browser and page without having its info in OR

    Few corrections to my code ...



    URL = "http://...."

    alllinks=Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page).getElementeByTagName("A" ).length

    for i = 0 to alllinks - 1
    Page_URL=Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page").getElementeByTagName("A ")(i).href
    Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page").getElementeByTagName("A ")(i).click
    If (InStr(Page_URL ,"Error_404") <> 0) Or (InStr(Page_URL ,"HTTP 404") <> 0)Then
    mesgbox("error")
    endif
    Browser("micClass:=Browser","CreationTime = 0").Navigate(URL)
    Next

  7. #7
    Member
    Join Date
    Aug 2006
    Location
    pune
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying browser and page without having its info in OR

    URL = "http://...."

    alllinks=Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page).Object.getElementeByTagN ame("A").length

    for i = 0 to alllinks - 1
    Page_URL=Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page").Object.getElementeByTag Name("A")(i).href
    Browser("micClass:=Browser","CreationTime = 0").Page("micClass:=Page").Object.getElementeByTag Name("A")(i).click
    If (InStr(Page_URL ,"Error_404") <> 0) Or (InStr(Page_URL ,"HTTP 404") <> 0)Then
    mesgbox("error")
    endif
    Browser("micClass:=Browser","CreationTime = 0").Navigate(URL)
    Next

 

 

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 10.71%
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 11:51 AM.

Copyright BetaSoft Inc.