SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Figure out current page from function

    I am writing Recovery Scenarios for my web application. I have one for 'Object not found". Even if the page does not exist, the error being displayed is that the WebTable(in the page) is not found. Is there a way to get the current page name while in the recovery scenario function? So that I can check whether the page exists while in the function?

  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: Figure out current page from function

    ...Page().GetROProperty("Name")
    OR
    ...Page().GetROProperty("Title")

    Janna

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Figure out current page from function

    Page actually always exist. Once you have a browser. The page will always be there. There is nothing like Page does not exist.

    You never in your life can generate a message saying cannot identify the Page object. It would always be either browser object or some object inside the page.

    So to make sure which page it is you need to pick a property of that page and see where it maps to.

    I hope it is making sense

  4. #4
    Member
    Join Date
    Jul 2007
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Figure out current page from function

    I am a little confused. When there is an error on the page, then how do I pick that error instead of displaying an error that the object was not found.
    Can I get the title of the browser, since when there is an error on the page, the title is "Error - Microsoft Internet Explorer"
    Please refer to attachment...
    Attached Images Attached Images

  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: Figure out current page from function

    I've told you how to "get the title of the browser".
    Using it, you can capture that Error.

    Janna

  6. #6
    Advanced Member gencke's Avatar
    Join Date
    Feb 2008
    Location
    Seattle, Washington, United States
    Posts
    531
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Figure out current page from function

    I'm pretty familiar with the error messages our pages throw, so I just wrote on failure to get the page text in its entirety.
    Patience is like bread I say.... I ran out of that yesterday.

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

    Re: Figure out current page from function

    Can you please explain to me how you are doing it? Capturing the page text?

    Also, to jbotash:
    How can I access the browser object while in the recovery function?

  8. #8
    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: Figure out current page from function

    Post your Recovery Function - I'll show you.

    Janna

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

    Re: Figure out current page from function

    Hi,
    Here is my recovery function. Any help would be really appreciated. I am looking at a way to capture an error on the page. And also save a screenshot.
    Thanks,
    Poonam

    Function HandleObjectNotFoundError(Object, Method, Arguments, retVal)
    Reporter.ReportEvent micFail, "Object not found", Object.GetTOProperty("Name")
    TestArgs("ErrorText") = Object.GetTOProperty("Name") & " not found!"
    End Function

  10. #10
    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: Figure out current page from function

    O. It is not Recovery Function, but Reporting Function.
    And even more: not cleare what are you trying to Report... QTP Error, Your own Error or what?
    Who else, except you, cares what your tool complaines about?
    Who cares, how you've made OR for your testing - correct or not...
    Your goal: to find application error and fix your own mistakes behind the scene.

    Did you read my firs post in this thread?
    It was hint how to do that.

    Insert that inside of your function (if you want to define error from title):
    sBrowserTitle =
    Browser(...).Page(...)GetROProperty("Title")
    But better yet: discard your Function, think about what you want do to, how to do that and write new Recovery Function.
    Post it here, if still have a problem.

    Janna

 

 
Page 1 of 2 12 LastLast

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.34%
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 01:12 PM.

Copyright BetaSoft Inc.