Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking 'Error' on web page
#1
Solved: 11 Years, 4 Months ago
I am working on a web app. I want to be able to check if on page load up at any time there is an error on the page, if some webparts dont load up successfully the sites displayes "Error"!! in their location. is there a way i can check for the string "error" anytime i am on a page?

Thanks
Reply
#2
Solved: 11 Years, 4 Months ago
a screen shot of the page with error will help. also if you can provide a snap of the spy on the object which contains the error string

Reply
#3
Solved: 11 Years, 4 Months ago
As you mentioned, if you are sure that a "Error" string is displayed whenever webparts dont load then you can simply add that image or webelement or whatever the string is and do this,

Code:
If object().Exist(2) Then
  Reporter.reportevent micfail, "Error on Page", "Webpart hasnt loaded"
Else
  Reporter.reportevent micpass, "Error on Page", "Webpart has loaded"
End If

Or on a sideline you can check for the browser status message or the page message, Sometimes when the page does not get completely loaded then the browser sends out a status message that "Error on Page".

Let me know if it helps.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Solved: 11 Years, 4 Months ago
Hi laura,

You can check the page status by validating the text displayed in the "WinStatusBar" displayed. The general status are "Done,Done, but with errors on page,Error on Page,Error" you can use a conditional loop to check this.

Let me know if you need any more info.
Thanks,
SUpputuri
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to identify an error page occurring in server in between the qtp run. aswini 1 1,782 05-04-2017, 03:52 PM
Last Post: Ankur
  click each web link in a page using Index or other method in QTP smeijer 13 24,673 04-29-2017, 04:53 PM
Last Post: kowshik
  VB Script to count number of links in a web page. Suma Parimal 4 25,257 07-01-2015, 12:59 PM
Last Post: govind
  spell checking of web objects kriday 3 3,973 07-05-2013, 01:37 PM
Last Post: Staff
  Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) sumitparolkar@gmail.com 4 5,072 05-03-2013, 11:53 PM
Last Post: agarwl.anurag

Forum Jump:


Users browsing this thread: 2 Guest(s)