Thursday, May 2, 2013

How to verify the correct business flow at run time?

The basic prerequisite for load testing is you should be assured that your application works correctly. The business flow verification can be performed by using LR content verification function web_reg_find.
So let’s see how to add LR content verification?
Take an example of banking application record a simple flow of opening start page, log in the application, and log out.

Now, open the script in Tree View (with menu 'View/Tree View')

1.    Select initial step ('Url: Banking Application).

2.    Select the text you would like to check on the page and right click; use default settings in 'Find Text' dialog.

3.    Open LR script in Script View (menu 'View/Script View')

You will see that web_reg_find function has been just added before the first function as shown below:
web_reg_find("Text=Welcome", "Search=Body", LAST);
web_url("Banking Application", "URL=...", ...

Lets check out web_reg_find function.
Click here to know more

The web_reg_find function registers a request to search for a text string on a Web page retrieved by the next action function, such as web_url.

This function helps you verify whether or not the page you received is the desired page by searching for an expected text string. For example, in this example you can search for the text "Welcome" to check if your home page opened properly. You can check for the word "Error" to check if the browser encountered an error. You can also use this function to register a request to count the number of times the text appeared.

If the check fails, the error is reported after the next action function executes. This function only registers requests, but does not perform them. Thus, the return value of web_reg_find indicates only if the registration succeeded, and not if the check succeeded.
Please note if the string is not found, it fails and the script execution stops.

I will explain various attributes of web_reg_find function and also show how to handle the above situation using error handling code.

So stay tuned for next post J…Happy Load running!!!

No comments:

Post a Comment