Performance Test DNS Servers using LoadRunner

If ever you need to use LoadRunner to test DNS servers, this is the script for you.

This virtual user script is designed to test hostname resolution against DNS servers. If a host address resolves to multiple addresses, all addresses are displayed in the output.   

N.B. DNS scripts use parameter delimiters rather than the more common {} delimiters.


 


#include “mic_socket.h”

 

Actions()

{

char *results = NULL;

int   rescnt  = 0;


lr_save_string(“10.190.32.16″,”DnsServer”); // Set DNS server IP Address

lr_save_string(“DNSSERVERNAME.CO.UK”, “Hostname”); // Set hostname to resolve


// Perform DNS Query

// Usage Notes:

// – IP Address of a Domain Name Server

//  – Name of host to resolve IP address for


results = (char *) ms_dns_query(“DnsQuery”,

“URL=dns://“,

“QueryHost=“,

LAST);


// List all the results… (if more than one)

while (*results) {

rescnt++;

lr_log_message(

lr_eval_string(“(%d) IP address for is %s”),

rescnt,

results);

results = (char *) ms_dns_nextresult(results);

}

return 0;

}

 

Share Calculation – example of mathematical calculation in LoadRunner

Example script showing mathematical calculations. This script converts text values into decimal values so that they can be used in calculations. The script performs a calculation using a decimal number [484.05253284] where it has not been possible to capture that number as a single value. In this case 484 and 05253284 are captured by another function (web_reg_save_param) The decimal point was the delimiter allowing the two values to be captured. This function was used in an HSDL script to calculate the number of shares that could be purchased with a certain amount of money.

In the script attached to this post, the number of shares worth 484.05253284p that can be purchased with a fund of £1380 is returned.

 

2016-10-06-16_11_59-start

TiddlyWiki

As I’m sure you’re aware, a Wiki is a site which you can edit “as you go”.

This is a good example of a web page (HTML file) that you can put on your desktop and use as a notepad/scratchpad containing hyperlinks etc. It’s pretty good and could be used for making notes during test runs and could easily be saved off to a project folder or shared with colleagues.

You can download it from http://www.tiddlywiki.com/.