Quality is delighting customers
In our project, developers have recently changed the hard coded values href of links to some generalized urls. Now the requirement is that we need to validate the links of all web pages if they navigate to right url or will lead to any error pages. This can be done through Web Link validator tool but it can work on only static links and that too it cannot detect custom error pages (eg: browser title is Custom 404 error page). Through qtp, we can get the info about the links that are leading to custom error pages provided a page given.
To achieve the same, in the given page, the qtp fetches all links, opens each link in new window validates for the correctness of it and closes the new window. Since a page can contain some hundreds of links we are thinking to use Web validator link tool in our script which can do the operation in the back ground.
Not sure how to do this, just wanted to check if any such option is available. If anyone has experienced this issue, request you to share the details.
Thx in adv,
I have implemented such a program in my ex-company and I named it as Custom Recovery System. I can't share code due to compliance issue.
Here is the process, it may take couple of hours to implement for an expert:
1. Create a function which will validate current page content, you can use OuterText Property to do the same.
'Check for Network Error, Server Error, Page Cannot Be Displayed, HTTP 404 Error, Internet Explorer cannot display the webpage
2. Create a QTP Test Script which reads all links (use ChildObjects) and perform Click event using For Each statement
3. Inside for, call above function for validation. That's it, you are done.
Let me know for any help.
Thanks for responding. We did the same kind of stuff but there are few problems we are facing with this:
1. The code cannot work on hidden links(links of Dropdown popups which come up on clicking link of the current page)
2. There could be some links existing in page which navigates to other apps other than browser eg: Microsoft outlook, open file confiramtion dialog
Going forward, we are nto sure how many like this will be observed. So we will have to check atleast 2-3 pages to get to know about these different scenarios and provide the support for them in the script which is tedious.
Instead we are thinking of an approach where we will make the code run the available tool (web link validator.exe) which inturn does the process in background.
Do you have idea like how to run an exe and waiting till this exe completes its execution (as the validator tool is taking around 6-7 mts for each page). Please help.
Sorry for delay reply, was busy with year end deliverables.
1. You can use DOM to get hidden elements / links in a page
2. Interesting question, here is my answer:
Use Desktop.ChildObjects to find any third party UI opened (can be window like MS Outlook or Popup dialog like Save AS)
It could be achievable but need more efforts. Let me know if you need any code help.