Thursday, May 14, 2009

How to check broken links in a webpage?

Broken link: A broken link refers to any clickable text that should take you to a document or webpage, that actually results in "page not found", a time out or any other type of error.

How can we verify these links in our application?

We can check the broken links by manually using Page Checkpoint.
To do this:
Step1: Start recording
Step2: Goto Inser Menu -> checkpoint -> Standard Checkpoint or
Start recording -> simply press F12(which is shortcut to Sandard Checkpoint)
Step3: Point to any object in the application -> Point to the Page object in Object Selection dialog box and click on the ok button.


Page Checkpoint Properties dialog box opens.
Step4: Select the "Broken Links" checkbox in "All objects in page" and click on ok button.


Step5: Stop recording.
If you run the script, QTP identifies any broken links in your web application.

We can also check the broken links by setting Advance web options.
To do this:
Step1: Tools Menu -> Options
Step2: Select the web tab and click on Advanced button
Step3: In Advanced Web Options, select "Create a checkpoint for each Web page while recording" check box and choose "Broken Links" check box and click on ok button

And click on ok button to close the options dialog box.

If you want to check the broken links for your current host,choose
Step1: Tools Menu -> Options and click on Web tab



Step2: select the "Broken links - check only links to current host" check box, which instructs QuickTest to check only for broken links that are targeted to your current host.

No comments: