I have an application in which i need to check whether all the available links r working or not ? For this i am validating the links using the "href" property of link which is constant in my case.Can any one tell me is this right approach ?if not suggest me better approach.
Excuse me if I misunderstood you, but how do you know your link is working when all you do is check the href property? It tells you whether the link points to the expected page / URL, but it does not say whether that link exists / works.
If you have checked before whether the link in the href property exists / functions correctly, then yes, you're fine. If not, I suggest clicking the link and checking whether the expected page / object / URL appears (if that is possible in your application).
Thanks for your info.I found that the code is looking for "HTTP 404" and "CAN NOT BE DISPLAYED" messages.Is it the only way for testing link functionality ? if anyone found any other solution, pls let me know.Since some of my links opens in new browser and some links opens in the same browser.As per QTP help, href is for "The location to which the browser navigates when the object is clicked."So i am validating based on href.but after clicking the link we can not find the href.Can anyone please let me know the solution.
It is great to see your code for link check in knowledgeinbox.com.In my case we can see the response in Frame.The values of A,B and C are same before and after clicking the link.But the innerHTML value differs.After clicking the link, how can we say that the respective page is opened/in sync to check the error msg? since it takes 5sec for some links and for some links are taking 30sec.