SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Dec 2006
    Location
    Denver, CO
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Differentiating between similar links on a page

    Here is link to my "posting template" information: User Information

    In my search results page, there are multiple links, some of which are primary results whereas others are related links. I need to differentiate between the primary results links and other links. The Google results page for "microsoft" is a good example.

    If I use the object spy, there does not seem to be a common difference between the two types of links. I also looked at the source, but no use there either.

    I am thinking, probably the text size could be used, but wanted to get the opinion here in the forum first.

    My situation is somewhat similar to that in this post, but different in that there is no difference in attributes between the links.
    I could not find any relevant articles in the KB either.

    Since the search terms can vary, I cannot restrict the script to just one search term.
    Anand

    --
    I believe I can fly!

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

    Re: Differentiating between similar links on a page

    But Anand its innertext must be different for all; if that is also same then check with Index property.

  3. #3
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating between similar links on a page

    When you record on the link, QTP will take cars of this by using an Ordinal Identifier (usually index as Jits suggests).

    If you are using Descriptive Programming you need to add like this:

    Browser("micClass:=Browser").Page("micClass:=Page" ).Link("innerText:=Submit","index:=0").Click

    Mark Smith.

  4. #4
    Member
    Join Date
    Dec 2006
    Location
    Denver, CO
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating between similar links on a page

    Thanks for the replies, but there is no way to identify which index numbers refer to the main links and the number of links may vary widely based on the search term.

    After some poring over the source seems like the class tag might work. For the main links, the class is "l". I am working on including this in the script. I will update this thread if it works out.

    Anand
    Anand

    --
    I believe I can fly!

  5. #5
    Member
    Join Date
    Dec 2006
    Location
    Denver, CO
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating between similar links on a page

    It worked. The classname is different between the main links and the other links, at least for Google search results.
    The classname for the main results is "l" while for others either there is none or it is "q".
    Anand

    --
    I believe I can fly!

 

 

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 02:45 AM.

Copyright BetaSoft Inc.