Web Global Verification in LoadRunner

In last article, we have seen about web global verification in LoadRunner in detail using Google dot com example. In this article, we are going to see how to pause and resume web global verification in LoadRunner. As you aware, web global verification in LoadRunner enables you to check for the string for all the subsequent requests. But you have the option to pause and resume those checks programmatically.

Web Globlal Verification in LoadRunner
Web Global Verification in LoadRunner

How to pause web global verification in LoadRunner?

In below code snippet, we have three web global verification function in vuser_init() and the action has three calls to Google dot com, ca, and in. Web global verification checks for the text “Advertising”,”Business”, and “About”.

vuser_init()
{
web_global_verification(“Text=Advertising”,
“Fail=NotFound”,
“ID=Find Advertising”,
LAST);

web_global_verification(“Text=Business”,
“Fail=NotFound”,
“ID=Find Business”,
LAST);

web_global_verification(“Text=About”,
“Fail=NotFound”,
“ID=Find About”,
LAST);

return 0;
}

Action()
{

web_set_sockets_option(“SSL_VERSION”, “TLS”);

web_url(“https://www.google.com”,
“URL=https://www.google.com”,
LAST);

web_url(“https://www.google.ca”,
“URL=https://www.google.ca”,
LAST);

web_url(“https://www.google.in”,
“URL=https://www.google.in”,
LAST);

return 0;
}

Assume that you need to pause the web global verification for the string “Advertising” for Google dot com. Below code snippet pauses the web global verification during runtime.

web_global_verification_pause(“ID=Find Advertising”,LAST);

Here is the output of the execution in which global verification for the string “Advertising” is skipped.

Starting action vuser_init.

Web Turbo Replay of LoadRunner 12.53.0 for Windows 10; build 1203 (Feb 25 2017 19:13:20)          [MsgId: MMSG-26983]

Run mode: HTML          [MsgId: MMSG-26993]

Replay user agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)          [MsgId: MMSG-26988]

Run-Time Settings file: “C:\Users\Navee\Documents\VuGen\Scripts\WebHttpHtml10\\default.cfg”          [MsgId: MMSG-27141]

vuser_init.c(3): web_global_verification started          [MsgId: MMSG-26355]

vuser_init.c(3): Registering web_global_verification was successful          [MsgId: MMSG-26390]

vuser_init.c(8): web_global_verification started          [MsgId: MMSG-26355]

vuser_init.c(8): Registering web_global_verification was successful          [MsgId: MMSG-26390]

vuser_init.c(13): web_global_verification started          [MsgId: MMSG-26355]

vuser_init.c(13): Registering web_global_verification was successful          [MsgId: MMSG-26390]

Ending action vuser_init.

Running Vuser…

Starting iteration 1.

Warning -27077: The “vuser_init” section contains web function(s) when the “Simulate a new user on each iteration” Run-Time Setting is ON.  This may produce unpredictable results with multiple iterations          [MsgId: MWAR-27077]

Maximum number of concurrent connections per server: 6          [MsgId: MMSG-26989]

Starting action Action.

Action.c(4): web_set_sockets_option started          [MsgId: MMSG-26355]

Action.c(4): web_set_sockets_option was successful          [MsgId: MMSG-26392]

Action.c(6): web_global_verification_pause started          [MsgId: MMSG-26355]

Action.c(6): The “web_global_verification_pause” with ID “Find Advertising” was successful          [MsgId: MMSG-26187]

Action.c(6): web_global_verification_pause was successful          [MsgId: MMSG-26392]

Action.c(8): web_url(“https://www.google.com”) started          [MsgId: MMSG-26355]

Action.c(8): Found resource “https://www.google.com/images/hpp/Chrome_Owned_96x96.png” in HTML “https://www.google.com”          [MsgId: MMSG-26659]

Action.c(8): Found resource “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-res.png” in HTML “https://www.google.com”          [MsgId: MMSG-26659]

Action.c(8): Found resource “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-hp.jpg” in HTML “https://www.google.com”          [MsgId: MMSG-26659]

Action.c(8): Notify: Transaction “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-res.png” will be skipped – could not calculate the transaction time (duration=0.0934, think_time=0.0000, wasted_time=1.1014).

Action.c(8): Notify: Transaction “https://www.google.com/images/hpp/Chrome_Owned_96x96.png” will be skipped – could not calculate the transaction time (duration=0.1022, think_time=0.0000, wasted_time=1.1017).

Action.c(8): Notify: Transaction “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-hp.jpg” will be skipped – could not calculate the transaction time (duration=0.1190, think_time=0.0000, wasted_time=1.1029).

Action.c(8): web_url(“https://www.google.com”) was successful, 131971 body bytes, 1769 header bytes, 942 chunking overhead bytes          [MsgId: MMSG-26385]

Action.c(13): web_url(“https://www.google.ca”) started          [MsgId: MMSG-26355]

Action.c(13): Found resource “https://www.google.ca/images/hpp/Chrome_Owned_96x96.png” in HTML “https://www.google.ca”          [MsgId: MMSG-26659]

Action.c(13): Found resource “https://www.google.ca/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-res.png” in HTML “https://www.google.ca”          [MsgId: MMSG-26659]

Action.c(13): Found resource “https://www.google.ca/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-hp.jpg” in HTML “https://www.google.ca”          [MsgId: MMSG-26659]

Action.c(13): web_url(“https://www.google.ca”) was successful, 131536 body bytes, 1749 header bytes, 571 chunking overhead bytes          [MsgId: MMSG-26385]

Action.c(17): web_url(“https://www.google.in”) started          [MsgId: MMSG-26355]

Action.c(17): Redirecting “https://www.google.in” (redirection depth is 0)          [MsgId: MMSG-26694]

Action.c(17): To location “https://www.google.co.in/”          [MsgId: MMSG-26693]

Action.c(17): Found resource “https://www.google.co.in/images/hpp/Chrome_Owned_96x96.png” in HTML “https://www.google.co.in/”          [MsgId: MMSG-26659]

Action.c(17): Found resource “https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png” in HTML “https://www.google.co.in/”          [MsgId: MMSG-26659]

Action.c(17): web_url(“https://www.google.in”) was successful, 76409 body bytes, 1678 header bytes, 1230 chunking overhead bytes          [MsgId: MMSG-26385]

Ending action Action.

How to resume web global verification in LoadRunner?

In above example we just paused the global verification, but if you want to resume the global verification during runtime, you can enable it by using below function.

   web_global_verification_resume(“ID=Find Advertising”, LAST);

Here is the updated code snipped of the Action.

Action()

{

web_set_sockets_option(“SSL_VERSION”, “TLS”);

web_global_verification_pause(“ID=Find Advertising”,LAST);

web_url(“https://www.google.com”,

“URL=https://www.google.com”,

LAST);

web_url(“https://www.google.ca”,

“URL=https://www.google.ca”,

LAST);

web_global_verification_resume(“ID=Find Advertising”, LAST);

web_url(“https://www.google.in”,

“URL=https://www.google.in”,

LAST);

return 0;

}

?For the Google dot in, the global verification for the “Advertising” will be resumed. Here is the output.

Starting action vuser_init.

Web Turbo Replay of LoadRunner 12.53.0 for Windows 10; build 1203 (Feb 25 2017 19:13:20)          [MsgId: MMSG-26983]

Run mode: HTML          [MsgId: MMSG-26993]

Replay user agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)          [MsgId: MMSG-26988]

Run-Time Settings file: “C:\Users\Navee\Documents\VuGen\Scripts\WebHttpHtml10\\default.cfg”          [MsgId: MMSG-27141]

vuser_init.c(3): web_global_verification started          [MsgId: MMSG-26355]

vuser_init.c(3): Registering web_global_verification was successful          [MsgId: MMSG-26390]

vuser_init.c(8): web_global_verification started          [MsgId: MMSG-26355]

vuser_init.c(8): Registering web_global_verification was successful          [MsgId: MMSG-26390]

vuser_init.c(13): web_global_verification started          [MsgId: MMSG-26355]

vuser_init.c(13): Registering web_global_verification was successful          [MsgId: MMSG-26390]

Ending action vuser_init.

Running Vuser…

Starting iteration 1.

Warning -27077: The “vuser_init” section contains web function(s) when the “Simulate a new user on each iteration” Run-Time Setting is ON.  This may produce unpredictable results with multiple iterations          [MsgId: MWAR-27077]

Maximum number of concurrent connections per server: 6          [MsgId: MMSG-26989]

Starting action Action.

Action.c(4): web_set_sockets_option started          [MsgId: MMSG-26355]

Action.c(4): web_set_sockets_option was successful          [MsgId: MMSG-26392]

Action.c(6): web_global_verification_pause started          [MsgId: MMSG-26355]

Action.c(6): The “web_global_verification_pause” with ID “Find Advertising” was successful          [MsgId: MMSG-26187]

Action.c(6): web_global_verification_pause was successful          [MsgId: MMSG-26392]

Action.c(8): web_url(“https://www.google.com”) started          [MsgId: MMSG-26355]

Action.c(8): Found resource “https://www.google.com/images/hpp/Chrome_Owned_96x96.png” in HTML “https://www.google.com”          [MsgId: MMSG-26659]

Action.c(8): Found resource “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-res.png” in HTML “https://www.google.com”          [MsgId: MMSG-26659]

Action.c(8): Found resource “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-hp.jpg” in HTML “https://www.google.com”          [MsgId: MMSG-26659]

Action.c(8): Notify: Transaction “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-res.png” will be skipped – could not calculate the transaction time (duration=0.0913, think_time=0.0000, wasted_time=1.0788).

Action.c(8): Notify: Transaction “https://www.google.com/images/hpp/Chrome_Owned_96x96.png” will be skipped – could not calculate the transaction time (duration=0.1025, think_time=0.0000, wasted_time=1.0791).

Action.c(8): Notify: Transaction “https://www.google.com/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-hp.jpg” will be skipped – could not calculate the transaction time (duration=0.1240, think_time=0.0000, wasted_time=1.0803).

Action.c(8): web_url(“https://www.google.com”) was successful, 132115 body bytes, 1769 header bytes, 1149 chunking overhead bytes          [MsgId: MMSG-26385]

Action.c(13): web_url(“https://www.google.ca”) started          [MsgId: MMSG-26355]

Action.c(13): Found resource “https://www.google.ca/images/hpp/Chrome_Owned_96x96.png” in HTML “https://www.google.ca”          [MsgId: MMSG-26659]

Action.c(13): Found resource “https://www.google.ca/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-res.png” in HTML “https://www.google.ca”          [MsgId: MMSG-26659]

Action.c(13): Found resource “https://www.google.ca/logos/doodles/2017/ida-lewis-175th-birthday-5722811319451648-hp.jpg” in HTML “https://www.google.ca”          [MsgId: MMSG-26659]

Action.c(13): web_url(“https://www.google.ca”) was successful, 131441 body bytes, 1749 header bytes, 1294 chunking overhead bytes          [MsgId: MMSG-26385]

Action.c(17): web_global_verification_resume started          [MsgId: MMSG-26355]

Action.c(17): The “web_global_verification_resume” request with ID “Find Advertising” was successful          [MsgId: MMSG-26183]

Action.c(17): web_global_verification_resume was successful          [MsgId: MMSG-26392]

Action.c(19): web_url(“https://www.google.in”) started          [MsgId: MMSG-26355]

Action.c(19): Redirecting “https://www.google.in” (redirection depth is 0)          [MsgId: MMSG-26694]

Action.c(19): To location “https://www.google.co.in/”          [MsgId: MMSG-26693]

Action.c(19): Found resource “https://www.google.co.in/images/hpp/Chrome_Owned_96x96.png” in HTML “https://www.google.co.in/”          [MsgId: MMSG-26659]

Action.c(19): Found resource “https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png” in HTML “https://www.google.co.in/”          [MsgId: MMSG-26659]

Action.c(19): web_url(“https://www.google.in”) was successful, 76272 body bytes, 1678 header bytes, 612 chunking overhead bytes          [MsgId: MMSG-26385]

Ending action Action.

Ending iteration 1.

Ending Vuser…

How to pause or resume multiple web global verification in LoadRunner?

If you want to pause or resume for multiple global verification check, you can use multiple IDs. E.g.

web_global_verification_pause(“ID=Find Advertising”,”ID=Find Business”,LAST);

    web_global_verification_resume(“ID=Find Advertising”,”ID=Find Business”, LAST);

Your turn: Have you used web global verification in LoadRunner? If yes, please do share your experience.

About the Author

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Hamster - Launch JMeter Recent Test Plans SwiftlyDownload for free
+
Share via
Copy link