Posts: 3
Threads: 1
Joined: Jun 2011
Reputation:
0
06-28-2011, 12:40 PM
(This post was last modified: 06-28-2011, 12:42 PM by Sukhvinder.)
I am stuck with one issue with my script. What I am doing is hitting a particular URL fetched from a excel sheet and then checking if this URL is returning a valid response page.
I need to report any error page returned by the browser on any URL hit (it could be 404 or 503). I am unable to get a handle of any error page i.e.
All I need is to identify that the browser has returned an error page and report it in my script, it should not matter whether it returns any error code.
Is there an element on the browser which notifies that an error page is returned which can be captured with QTP script?
Thanking in Anticipation
Posts: 23
Threads: 1
Joined: Mar 2008
Reputation:
0
06-28-2011, 03:25 PM
You could capture the text from the page and look for the error number?
Posts: 3
Threads: 1
Joined: Jun 2011
Reputation:
0
06-28-2011, 07:00 PM
This can be one thing but many a times the error page is formatted to show company specific error messages OR the total look and feel is changed to hold some other message maybe "Sorry, Try again Later" OR "Please try after some time" etc. How to handle such situations ?
Posts: 516
Threads: 17
Joined: Jul 2009
Reputation:
3
06-28-2011, 08:56 PM
HI,
I would rather check for the desired page or the object in the desired page. As the error message is not specific.
Thanks,
SUpputuri
Posts: 3
Threads: 1
Joined: Jun 2011
Reputation:
0
06-29-2011, 01:50 PM
Hi Supputuri,
The messages are just to explain the issue and not intended to be captured by QTP.
You are right but can you let me know which object on the page I can check for to know anything about the error.
Posts: 23
Threads: 1
Joined: Mar 2008
Reputation:
0
06-29-2011, 03:22 PM
If you are sent to an error page then the actual URL will be different from the one expected, so check that. Since this is presumably not a one off test then you will know or can get the list of error urls that the test is going to navigate to as you run through. Just check the URL of the current page against the one expected or against the list of error URLs
Posts: 275
Threads: 4
Joined: Jul 2011
Reputation:
0
07-09-2011, 11:11 AM
Check if you can use "broken links" option in page check point