Friday 4 September 2015

Virtual Table Server(VTS) in LoadRunner 11.52

With the release of 11.52, HP has released a whole new VTS, with some enhanced features in LR 12.00. The new VTS APIs is backward compatible and can be used in all protocols that uses C language as well as TruClient. You can see the new console UI in the below screen:

VTS2.png

Installation:
The new VTS consists of two parts, the vuser side is tightly integrated with the LoadRunner, and is installed with 11.52. The VTS server side needs separate download and install.

If you want to use the new VTS, you can take the following steps to install the new VTS and experience it:
  • Install 11.52 on all load testing machines, particularly, the VuGen and LG machines.
  • Install VTS server on a server machine, it can be a separate machine, or any of existing load testing machine, depends on how much load VTS service will have. You can either install 32 bits version or 64 bits version, depends on your OS type. After installation, the service will start automatically and you can browse to the VTS console UI. The default port is 4000, therefore the URL is something like http://localhost:4000. You can specify a different port during the install or afterwards.
  • On the console UI, you can import data by uploading a CSV file, or typing in a connection string to import from database directly. The following screen shows the UI of importing data:VTS3.png
  • Create a C language script, like Web Http/Html script. Add VTS API in vuser_init method to connect to the server, like the following:
int   rc = 0;
char  *VtsServer = "192.168.0.100";
int   nPort = 8888; 

PVCI2 pvci = 0;
vuser_init()
{
    pvci = lrvtc_connect(VtsServer,nPort,VTOPT_KEEP_ALIVE);
    lr_log_message("pvci=%d\n", pvci); 
    return 0;
}
  • In Action.c, add some code to retrieve one column from the server and remove from the server at the same time. You can run the action multiple iterations, and it will retrieve one:
char * cname; //column name
int ret;

RetrieveMessage()
{
    lr_start_transaction("retrieve_column");
    rc =  lrvtc_retrieve_messages1("cname",";");
    lr_log_message("lrvtc_retrieve_messages1 rc=%d\n", rc);
    lr_log_message("cname is %s", lr_eval_string("{cname}"));
    lr_end_transaction("retrieve_column", LR_AUTO);
}

Action()
{
    RetrieveMessage();
    return 0;
}

  • In vuser_end.c, add API call to close the VTS handle:
vuser_end()
{
    lrvtc_disconnect();   
    return 0;
}

  • You can test it in VuGen and run it in Controller. Don’t forget to turn on the API access port before you run the script. Like old VTS, the new one use 8888 as the port for API to access. It is turned off by default, so you need to browse to the administrative UI to enable it.

1 comment:

  1. HP ML350 Gen10 Server in UAE, Proliant Server in UAE, Server in UAE
    https://gccgamers.com/hp-ml350.html
    HP ML350 Gen10 Server in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
    1633659929095-15

    ReplyDelete