Wednesday, 23 April 2014

How to use LoadRunner for broken links detection

Broken' link is 'not valid' link. This link usually returns 404 Error - "Page not found".
Another side of broken links is that images other resources are not displayed.

Using LoadRunner for broken links detection can be helpful, when you perform load testing of a site and you have to be sure, that all pages, images, applets, and other resources are available during the high server loading.

LoadRunner allows broken links detection during:
  1. Script recording
  2. Script execution
  1. Broken links detection during LoadRunner script recording
    You have to set appropriate recording options. For that, click 'Options...' button from 'Star Recording' dialog:

    'Recording Options' dialog opens. Here, set 'Add comment to script for HTTP errors while recording' option:



    Please, note that you can see a description of the 'Add comment to script for HTTP errors while recording' option.

    Now, you are ready to record your script. Click 'OK' button on 'Recording Options' dialog and start recording.

    If LoadRunner find any HTTP errors, it will include comment into VuGen script.
    My application had some problems - there were several broken links for images there. So, LoadRunner generated the following script (click the image to view enlarged):
    As you see, my application had several broken links to images and LoadRunner detected it successfully. Also, you can find the point, where these broken links were used. This is previous function - web_url.

    LoadRunner inserted comments, which describe all occurred HTTP errors. Comments contain URL and server response.
    Since you have server responses, you can determine reasons of HTTP errors.

    Tips:
    For detailed info on HTTP status codes read this article from wikipedia and this one from w3.org.
    Tips: Read about the most 'popular' HTTP status code - 404.

  2. Broken links detection during LoadRunner script execution
    LoadRunner can check broken links during the script execution too.
    You have to turn off one LoadRunner run-time option - 'Non-critical resource errors as warnings':

    Uncheck the 'Non-critical resource errors as warnings' option and execute previous script again.

    The result is:
    Please, note that LoadRunner's Replay Log contains errors about images we mentioned before. Their links were broken, that's why LoadRunner generated errors.

No comments:

Post a Comment