SPONSORS:






User Tag List

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

    code is not working if link place changes

    Hi,

    I am writing code for hindu page to click the links. But same code is not working if the link place changes(may be down or up it shifted).

    Exp: Break news update link.today code is working fine but tomorrow if the link place changes means code is not working. so can any body help me in this.

    Thanks
    ~Shyamala

  2. #2
    Member
    Join Date
    Sep 2007
    Location
    Beloit, Wisconsin
    Posts
    79
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    First of all: I am a beginner regarding QTP, so listening to me might make your problems even worse ;-)


    I think you mean that the place/location on the website where the link is displayed has changed?

    I recorded the opening of this tread two times:
    With low level recording it is something like:


    Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Click 249,340

    Without lowlevel, it is:

    Browser("MetaFrame Presentation").Page("Software Quality Assurance_2").Link("code is not working if").Click

    So, my first guess would be:
    You used lowlevel-recording, so during replay position x,y is simply clicked regardless if there is a link, a self-destruction button or whatever.

    Turn off the lowlevel-recording, and it should work because then (during replay) object is clicked regardless where it is positioned.

    Hope this helps,

    Roland

    (PS: My apologies Iif I totally misunderstood you)

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

    Re: code is not working if link place changes

    while recording i got

    Browser("The Hindu : Front Page").Page("The Hindu : Front Page").Link("Breaking News and Updates").Click

    my query is today it is working fine.In case Breaking news and updates link changes it will not work, the error message what i am getting is

    "Cannot identify the object "Breaking News and Updates" (of class Link). Verify that this object's properties match an object currently displayed in your application."

  4. #4
    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: code is not working if link place changes

    Of course, it will never work if changed.

    There is no tool in the world, that recognizes not exisisting object.

    Janna

  5. #5
    Junior Member
    Join Date
    Dec 2007
    Location
    China
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    i donot very clearly about your question ,but i think the method maybe useful of you:
    that is make the link as a parameter,that means:
    dim sNewsLink
    set sNewsLink = "Breaking News and Updates"
    Browser("The Hindu : Front Page").Page("The Hindu : Front Page").Link( <font color="red"> </font> ).Click
    and tomorrom if the sNewsLink changed to be another one,you can just change it in the difination of sNewsLink
    hope this helps
    cola

  6. #6
    Junior Member
    Join Date
    Nov 2007
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    You can use descriptive programming by parameterizing the name / text property of Link Object as below,

    Browser("name:=The Hindu : Front Page").Page("name:=The Hindu: Front Page").Link("name:="&amp;StrName,"html tag:=A").Click

    StrName = "Breaking News and Updates"

  7. #7
    Senior Member
    Join Date
    Nov 2007
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    shyamaladevi,
    try the following line, it should work irrespective of the link "Breaking News and Updates" position


    Browser("The Hindu : Front Page").Page("The Hindu : Front Page").Link("text:=Breaking News and Updates").Click



    ------------

  8. #8
    Junior Member
    Join Date
    Nov 2007
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    My query is if the link place changes(name remains constant), what would be the solution.

  9. #9
    Junior Member
    Join Date
    Dec 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    shyamaladevi,

    pls check the property of the link by using object spy and . check the propery once again after the position change, there sud be some property changes. if not pls use DP and index.

  10. #10
    Member
    Join Date
    Sep 2007
    Location
    Beloit, Wisconsin
    Posts
    79
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: code is not working if link place changes

    If the link place changes and you are going after the object, the exact location on the screenshoudl not be a problem.

    If you still have the problem, I would suggest the following:
    When the replay fails again, record the calling of the link again into the same (better: a copy of) the original script.

    Then you should be able to compare the code. Maybe then you will discover that the objects are different, something like "Name" vs. "Name_2".

    Just my 0.02 Euro,

    Roland

 

 

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 5.56%
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 08:04 PM.

Copyright BetaSoft Inc.