Skip to main content

Difference Between HTML and URL Mode in Loadrunner

What is the difference between HTML and URL Mode?

HTML Mode:

HTML Mode is the default recording mode available in Loadrunner for Web (HTTP/HTML) scripts. When you record an application in HTML mode it will not record all the resources, but it will keep in extras as shown below and when the same script is executed it will parse all the urls one by one in extras and It will take some time to parse all the urls. Please find an example of HTML Mode below for Bing.com.

Bing.com in HTML Mode:

web_url("www.bing.com",
        "URL=http://www.bing.com/",
        "Resource=0",
        "RecContentType=text/html",
        "Referer=",
        "Snapshot=t1.inf",
        "Mode=HTML",
        EXTRARES,
        "Url=/s/a/bing_p_lg.ico""Referer="ENDITEM,
        "Url=/sa/8_01_1_3345848/notifications.js"ENDITEM,
        "Url=/sa/8_01_1_3345848/homepageImgViewer_c.js"ENDITEM,
        "Url=/fd/sa/9_00_0_3325577/rmsloaderdelayed.js"ENDITEM,
        "Url=/rms/AutoSugBlue/jc/f209ebd2/5c8aa5b3.js?bu=rms+answers+AutoSuggest+Modules%24Service.source%2cApi.source%2cDataProviders%24GenericDataProvider.source%2cAutoSuggestCanvas_r.source%2cAutoSuggestLayoutBlue_r.source%2cAutoSuggestSearchForm_r.source%2cAutoSuggestSpelling_r.source%2cAutoSuggestHighConfGhosting_r.source%2cAutoSuggestInit_r.source"ENDITEM,
        "Url=/s/as/8_01_1_3345848/Identity/WindowsLiveConnect_c.js"ENDITEM,
        LAST);

URL Mode:

In URL mode each and every resource is recorded explicitly. For example, when you look into a bing.com it will have images, css files, etc. The vugen will create a new web function for every resource separately and this leads to lot of code in your script and complex correlations. We use URL mode when we need  a better control over the resources of which files need to be downloaded or not. We can comment the script accordingly.

When you look into the same script in URL Mode it will create lots of steps as shown below for Bing.com

Bing.com in URL Mode:

web_url("www.bing.com",
        "URL=http://www.bing.com/",
        "Resource=0",
        "RecContentType=text/html",
        "Referer=",
        "Snapshot=t1.inf",
        "Mode=HTTP",
        LAST);

    web_concurrent_start(NULL);

    web_url("bing_p_lg.ico",
        "URL=http://www.bing.com/s/a/bing_p_lg.ico",
        "Resource=1",
        "RecContentType=image/x-icon",
        "Referer=",
        "Snapshot=t2.inf",
        LAST);

    web_url("notifications.js",
        "URL=http://www.bing.com/sa/8_01_1_3345848/notifications.js",
        "Resource=1",
        "RecContentType=application/x-javascript",
        "Referer=http://www.bing.com/",
        "Snapshot=t3.inf",
        LAST);

    web_url("homepageImgViewer_c.js",
        "URL=http://www.bing.com/sa/8_01_1_3345848/homepageImgViewer_c.js",
        "Resource=1",
        "RecContentType=application/x-javascript",
        "Referer=http://www.bing.com/",
        "Snapshot=t4.inf",
        LAST);

    web_url("rmsloaderdelayed.js",
        "URL=http://www.bing.com/fd/sa/9_00_0_3325577/rmsloaderdelayed.js",
        "Resource=1",
        "RecContentType=application/x-javascript",
        "Referer=http://www.bing.com/",
        "Snapshot=t5.inf",
        LAST);

    web_url("5c8aa5b3.js",
        "URL=http://www.bing.com/rms/AutoSugBlue/jc/f209ebd2/5c8aa5b3.js?bu=rms+answers+AutoSuggest+Modules%24Service.source%2cApi.source%2cDataProviders%24GenericDataProvider.source%2cAutoSuggestCanvas_r.source%2cAutoSuggestLayoutBlue_r.source%2cAutoSuggestSearchForm_r.source%2cAutoSuggestSpelling_r.source%2cAutoSuggestHighConfGhosting_r.source%2cAutoSuggestInit_r.source",
        "Resource=1",
        "RecContentType=application/x-javascript",
        "Referer=http://www.bing.com/",
        "Snapshot=t6.inf",
        LAST);

    web_url("WindowsLiveConnect_c.js",
        "URL=http://www.bing.com/s/as/8_01_1_3345848/Identity/WindowsLiveConnect_c.js",
        "Resource=1",
        "RecContentType=application/x-javascript",
        "Referer=http://www.bing.com/",
        "Snapshot=t7.inf",
        LAST);

    web_concurrent_end(NULL);


Comments

Post a Comment

Popular posts from this blog

NeoLoad Interview Questions and Answers

Here are some of the interview questions and answers on NeoLoad:
What is NeoLoad?
NeoLoad is a performance testing tool designed to test different types of web, standalone and mobile applications.
What is the difference between Loadrunner, JMeter and NeoLoad?
Click here for differences
What are the different counters you monitor in NeoLoad?
Average Response Time(requests), average response time(pages), average requests/s, average throughput, current response time(requests), current response time(pages), current requests, current throughput, current users count, controller cpu load, controller memory load etc.
What are the different type of tools you can integrate with NeoLoad?
App Dynamics, CA APM Integration, Dyna trace integration, HP ALM or Quality Center Integration, Java and Jamo Solutions M-eux Test Integration, Jenkins Integration, perfecto mobile integration, selenium integration.
What are the different type of Operating systems you can monitor?
Linux Monitor, Solaris Monitor, AIX …

File operations in loadrunner with examples

In this post I will explain how to capture a value from server response and save to a text file using vugen.
How to capture and save to text file using loadrunner:
First I have recorded the script using bing.com and then i searched for IBM. We will get 10 results. I have captured all the 10 values and saved to a file.
Here is the code for that.

LR Functions with Examples | Loadrunner Functions with Examples

LR Functions in Loadrunner with Examples.

lr_abort Stops the script execution.lr_advance_param It will take the next value in the parameter list.lr_continue_on_error Continue on error even if the request is failed.lr_convert_string_encoding Converts a string to a UTF 8 or Unicode.lr_db_dataset_action Validates database contents by setting checkpoints.lr_db_connect Connects to a database.lr_db_dataset_action Performs an action on a dataset.lr_db_disconnect Disconnects from a database.lr_db_executeSQLStatement Submits an SQL statement to a database.lr_checkpoint Validates the value of a parameter against an expected value (checkpoint).lr_db_getValue Retrieves a value from a dataset.lr_debug_message Sends a debug message to the LoadRunner output or Application Management agent log file.lr_decrypt Decrypts an encoded string.lr_disable_ip_spoofing Disables IP Spoofing.lr_enable_ip_spoofing Enables IP Spoofing.lr_end_sub_transaction Marks the end of a sub-transaction.lr_end_transaction Mark…