Vugen: HTML and URL Recording Options Compared
Posted on Jul, 2012 by Admin
In LoadRunner Vugen, there are two general modes of recording: HTML and URL.
HTML (Context Sensitive) is usually preferred for several reasons. Firstly, because it is “context sensitive” , i.e. each mouse click recorded in the script is made in the context of the previous step/page. In order to maintain context it looks through the previous page to make sure the current operation is available. This adds extra overhead because it is performed by a background utility called the run-time parser. Although the parser uses extra overhead, it does save us work in correlation and page checks. This because if a link/request is not available, the run-time parser will see that and throw an error telling us that the request is not there. (The old “Requested Form Not Found” or “weblink not found” error).
URL mode does not check the context of the previous request. It will simply make each recorded request individually, regardless of whether the request is still available on the page or logically follows in context. That’s why URL mode requires more manual page checks and correlation. The absence of the run-time parser in URL mode allows more vusers per generator, because there’s no run-time parser using up overhead.
Here is an example:
Step 1: Go to some public website and record the home page URL
Step 2: Click a button or hyperlink on the home page. Mouse clicks/buttons are really just get requests for a web address. In this HTML mode, the second step should show up as a “web_link” function. Upon replay, the runtime parser will search through the first request on the page to see if the button/link is located on the page. If it IS there, it will request that URL. If not, the script should fail (Requested Form/link not found).
Step 3: Record the exact same script URL Mode:
Perform the same steps in your recording as you did before. Both steps are really just HTTP GET requests. In URL mode, the second step will show up as a “web_url” statement that directs you to the page. The script will STILL make the request for the URL that takes us to the page regardless whether the link is a available on the page or not!! There’s no Context!!
This means we need to have more page verification checks built into our script, since an application change or failure may take us to a location that is not expected. It may still return a 200 HTTP status code if the developers are gracefully handling errors, so we have to be careful with this recording mode. For example, what if the page returned: “This page is temporarily unavailable” as the text in the body?
In a URL-based script with no context, it would STILL make the HTTP request for the URL address. The subsequent web page may come up with a 200 server response, but it may say something like “TRY AGAIN LATER.” If we have no page checks, you might think your script is working when in actuality it is failing. At that point we are not emulating a real user. This is why detailed logging for page verification is vitally important when creating Vugen scripts.
Do you have any additional thoughts around the two types of recording modes in Vugen? If so, share them with me in the comments section below.