SlideShare a Scribd company logo
1 of 20
How to use VTS with LR
Kranthi Paidi
1
What is VTS
2
 VTS – Virtual Table Server
 A windows service which maintains an in memory database that can be accessed
by a number of load generators on a network
 VTS helps different data dependent scripts “talk-to” each other during a load test
 Unlike the parameter files which involves file operation in order to be changed
once the test starts and thus bringing in concurrency issues, VTS holds and shares
the values that “producer” scripts generate so that “consumer” scripts can act
upon the data.
 For example, if a script called Add_Issue generates an Issue ID which is assigned to
a particular user, using VTS, this Issue ID can be “inserted” into a “table” during run
time and “retrieved” by Close_Issue script by that particular user.
 Thus, VTS can be treated (and is a kind of) database.
 The only difference here is that you cannot “query” this database. For example,
you cannot write a query like “select * from table_1 where user_ID=“kpaidi””
 HP LoadRunner does not “officially” provide any support to VTS. This is a third
party “add-in” that you have to use by yourself.
What is VTS
3
 Even though HP does not support this tool, thousands of users have used this and
are still using it without any problems.
 The last available version is VTS 2. This is no longer being developed, but, VTS2 is
completely stable and has no issues reported over a significant time.
 Attached in this slide is VTS.rar which has all setup files required.
VTS
Installing VTS
4
 Minimum system requirements:
 A 1-CPU 300Mhz+ Windows NT/2000
 The total amount of data that VTS supports is limited by the Operating System’s
maximum limit on process memory (2Gig to 3 Gig)
 VTS is tested for 1 million entries per row. It supports only 32,767 rows
 VTS should be installed on your controller(s) and all load generators that you intend
to make use of in your load test.
 For each machine, do the following:
 Extract the zip file and click vtsinstall.exe
 VTS automatically selects “C:Program FilesHPLoadRunner as installation directory
 Select install
 Open cmd prompt with elevated privileges
 Cd to “C:Program FilesHPLoadRunnerbin”
 Type regsvr32.exe vtsctls.ocx
 Type regsvr32.exe msflxgrd.exe
Setting up the Server
5
 If your tests involve large data creation and consumption, please plan to have a
separate machine as VTS server other than controller and load generator. Working
on large sets of data will have its impact on the memory and network bandwidth
thus affecting the load generators and controller. You do not want to introduce
bottlenecks in the test design itself.
 If your tests have minimal amount of data being operated up on (not more than a
few MB), choose a less utilized load generator.
 Whatever the machine you choose, determine the physical IP of the machine using
“ipconfig /all” command from cmd prompt.
 Once you determined the IP, check what ports are available on the machine. Use
the command “netstat –an”. Choose a port that is available (I am choosing 8888
here)
 Once you do the above, open a notepad and type the following
 ECHO ON
 CD “C:Program FilesHPLoadRunnerbin”
 START vtconsole –port 8888 –launch
Setting up the Server
6
 Save the notepad as “START_VTS.bat” on a location you prefer (I prefer Desktop)
 Click the batch file. You should see a window like this –
Setting up the Server
7
 Your VTS server is UP and READY now. You can use this as a database to store and
retrieve values during a scenario run.
 In the next few slides, we will see how to connect to a VTS from a VUGen script,
how to write data, how to retrieve data and error handling.
Connecting to VTS from VUGen
8
 Include the following at the top of vuser_init, action, vuser_end sections
 #include “as_web.h”
 #include “vts2.h”
 Your init, action and end sections will look like this –
 In the vuser init section, write the following code to connect to VTS
Connecting to VTS from VUGen
9
 In the vuser_end section, write the following code. This disconnects the
vuser from vtc.
 If your VTS is up and running (remember the START_VTS.bat?), running
the above VuGen code should not write any messages to the output
screen. It should look like below:
Connecting to VTS from VUGen – Error Codes
10
 If you have any problems with VTS, the following error codes are returned:
 #define VTCERR_INVALID_CONNECTION_INFO -10000 > verify the server name attribute.
 #define VTCERR_FAILED_TO_RESOLVE_ADDR -10001
 #define VTCERR_FAILED_TO_CREATE_SOCKET -10002
 #define VTCERR_FAILED_TO_CONNECT -10003 > the vtconsole is not running.
 #define VTCERR_INCOMPLETE_REQUEST -10100
 #define VTCERR_FAILED_TO_RECV_RESPONSE -10101
 #define VTCERR_INCOMPLETE_RESPONSE -10102
 #define VTCERR_RESPONSE_ARGS_UNMATCH -10103
 #define VTCERR_OPERATION_ERROR_BASE -11000
Writing data into the server - example
11
Data Manipulation in VTS
12
 Insert Data Element:
 Inserts operation data into the column specified by column name
 Insert Unique Data:
 Inserts operation data only if the data is unique
 Update Data Element:
 Updates the value of data element in the column name at selected location
 Increment Data Element:
 Increments the numerical data element in the column name at selected location by the number
specified
 Query data element:
 Obtains the value of the data element in the column name at location specified
 Clear Data Value:
 Clears the data in the column name at location specified
 Clear Entire Column:
 Clears the entire column
Client side API – LR functions
13
 VTS supports two types of functions. Raw VTS functions and LR version of the same
functions. The definitions for both the type of functions are available in vts2.
 We will discuss and see only LR version of the fuctions
 Connect/Disconnect:
 PVCI lrvtc_connect(char *servername, int portnum, int options);
 Options: 0 for None, VTOPT_KEEP_ALIVE for keep connection alive
 PVCI is a typedef int variable
 lrvtc_disconnect();
 Query a Column: retrieves data from a Column specified by name and index
 lrvtc_query_column(char *ColumnName, int RowIndex);
 Query a Row: retrieves data from all columns in a row specified by row index
 lrvtc_query_row(int RowIndex);
Client side API – LR functions
14
 Send data to a column: sends data to the next row of the column specified
 lrvtc_send_message(char *columnName, char *columnValue);
 Send unique data to a column : sends a data to the next row of column only if it is
unique in that column
 lrvtc_send_if_unique(char *columnName, char *columnValue);
 Returns 1 for pass and 0 for fail
Client side API – LR functions
15
 Send entire row: Sends data into a row with specified column names
 lrvtc_send_row1(char *columnNames, char *messages, char *delimiter, unsigned char
sendflag);
 Status code returned PVCI 1=pass, 0=fail
 Update data: Updates data at specified column and index
 lrvtc_update_message(char *columnName, int Index, char *message);
Client side API – LR functions
16
 Update entire row: Updates row data at specified column index
 lrvtc_update_row1(char *columnNames, int index, char *messages, char *delimiter);
 Clear Message: Clears the data at specified column and Index
 lrvtc_clear_message(char *columnName, int index);
Client side API – LR functions
17
 Clear Column: Clears all data in the given Column
 lrvtc_clear_column(char *columnName);
 Clear row: Clears all data in a row of specified index
 lrvtc_clear_row(int index);
Client side API – LR functions
18
 Retrieve message: retrieves and clears the first data element from a column
 lrvtc_retrieve_message(char *columnName);
Client side API – LR functions
19
 Retrieve multiple messages: retrieves and clears the first data element from a row
as specified by column names
 lrvtc_retrieve_messages1(char *columnNames, char *delimiter);
Thank You
20

More Related Content

What's hot

LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance Testing
Atul Pant
 

What's hot (20)

Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With Jmeter
 
Postman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenarioPostman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenario
 
Test Data Management a Managed Service for Software Quality Assurance
Test Data Management a Managed Service for Software Quality AssuranceTest Data Management a Managed Service for Software Quality Assurance
Test Data Management a Managed Service for Software Quality Assurance
 
Cross browser testing using BrowserStack
Cross browser testing using BrowserStack Cross browser testing using BrowserStack
Cross browser testing using BrowserStack
 
Katalon Studio Presentation.pptx
Katalon Studio Presentation.pptxKatalon Studio Presentation.pptx
Katalon Studio Presentation.pptx
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
 
Automation With A Tool Demo
Automation With A Tool DemoAutomation With A Tool Demo
Automation With A Tool Demo
 
12 Steps to API Load Testing with Apache JMeter
12 Steps to API Load Testing with Apache JMeter12 Steps to API Load Testing with Apache JMeter
12 Steps to API Load Testing with Apache JMeter
 
Pairwise testing - Strategic test case design
Pairwise testing - Strategic test case designPairwise testing - Strategic test case design
Pairwise testing - Strategic test case design
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Perofrmance testing and apache jmeter
Perofrmance testing and apache jmeterPerofrmance testing and apache jmeter
Perofrmance testing and apache jmeter
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Selenium Primer
Selenium PrimerSelenium Primer
Selenium Primer
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance Testing
 
Load testing with J meter
Load testing with J meterLoad testing with J meter
Load testing with J meter
 
testng
testngtestng
testng
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 

Viewers also liked

TouristEye - Personalizing The Travel Experience - 500 Startups
TouristEye - Personalizing The Travel Experience - 500 StartupsTouristEye - Personalizing The Travel Experience - 500 Startups
TouristEye - Personalizing The Travel Experience - 500 Startups
500 Startups
 
Pitch deck for Kejahunt
Pitch deck for KejahuntPitch deck for Kejahunt
Pitch deck for Kejahunt
Joshua Mutua
 

Viewers also liked (20)

Dot Net performance monitoring
 Dot Net performance monitoring Dot Net performance monitoring
Dot Net performance monitoring
 
20 Habits That Hold Us Back
20 Habits That Hold Us Back20 Habits That Hold Us Back
20 Habits That Hold Us Back
 
Java Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideJava Performance Engineer's Survival Guide
Java Performance Engineer's Survival Guide
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
 
Standard Treasury Series A Pitch Deck
Standard Treasury Series A Pitch DeckStandard Treasury Series A Pitch Deck
Standard Treasury Series A Pitch Deck
 
TouristEye - Personalizing The Travel Experience - 500 Startups
TouristEye - Personalizing The Travel Experience - 500 StartupsTouristEye - Personalizing The Travel Experience - 500 Startups
TouristEye - Personalizing The Travel Experience - 500 Startups
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!
 
Square pitch deck
Square pitch deckSquare pitch deck
Square pitch deck
 
task.ly pitch deck
task.ly pitch decktask.ly pitch deck
task.ly pitch deck
 
Kibin
Kibin Kibin
Kibin
 
Binpress
BinpressBinpress
Binpress
 
Sverve
SverveSverve
Sverve
 
LaunchRock
LaunchRockLaunchRock
LaunchRock
 
500’s Demo Day Batch 12 >> Alfred
500’s Demo Day Batch 12 >> Alfred500’s Demo Day Batch 12 >> Alfred
500’s Demo Day Batch 12 >> Alfred
 
BrandBoards demo day pitch deck
BrandBoards demo day pitch deckBrandBoards demo day pitch deck
BrandBoards demo day pitch deck
 
300 Milligrams - Demo Day Presentation
300 Milligrams - Demo Day Presentation300 Milligrams - Demo Day Presentation
300 Milligrams - Demo Day Presentation
 
PinMyPet
PinMyPetPinMyPet
PinMyPet
 
Pitch deck for Kejahunt
Pitch deck for KejahuntPitch deck for Kejahunt
Pitch deck for Kejahunt
 
Daily hundred Pitch Deck 2014
Daily hundred Pitch Deck 2014Daily hundred Pitch Deck 2014
Daily hundred Pitch Deck 2014
 
Kickfolio - 500Startups Batch 5
Kickfolio - 500Startups Batch 5Kickfolio - 500Startups Batch 5
Kickfolio - 500Startups Batch 5
 

Similar to How to use VTS with loadrunner

Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
Bilam
 
Principles of Computer System Design
Principles of Computer System DesignPrinciples of Computer System Design
Principles of Computer System Design
Ying(Doris) WANG
 

Similar to How to use VTS with loadrunner (20)

Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Workshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSWorkshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWS
 
XenApp Load Balancing
XenApp Load BalancingXenApp Load Balancing
XenApp Load Balancing
 
V sphere perf_charts
V sphere perf_chartsV sphere perf_charts
V sphere perf_charts
 
Merged document
Merged documentMerged document
Merged document
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
 
TO Hack an ASP .NET website?
TO Hack an ASP .NET website?  TO Hack an ASP .NET website?
TO Hack an ASP .NET website?
 
Hack ASP.NET website
Hack ASP.NET websiteHack ASP.NET website
Hack ASP.NET website
 
Technical Report Vawtrak v2
Technical Report Vawtrak v2Technical Report Vawtrak v2
Technical Report Vawtrak v2
 
IoT with OpenPicus Flyport
IoT with OpenPicus FlyportIoT with OpenPicus Flyport
IoT with OpenPicus Flyport
 
Wcat
WcatWcat
Wcat
 
Load Balancer Device and Configurations.
Load Balancer Device and Configurations.Load Balancer Device and Configurations.
Load Balancer Device and Configurations.
 
communicate with instrument by using lan
communicate with instrument by using lancommunicate with instrument by using lan
communicate with instrument by using lan
 
Technical Note - ITME: Running StADOSvr.exe as a Service
Technical Note - ITME: Running StADOSvr.exe as a ServiceTechnical Note - ITME: Running StADOSvr.exe as a Service
Technical Note - ITME: Running StADOSvr.exe as a Service
 
Principles of Computer System Design
Principles of Computer System DesignPrinciples of Computer System Design
Principles of Computer System Design
 
Network Setup Guide: Deploying Your Cloudian HyperStore Hybrid Storage Service
Network Setup Guide: Deploying Your Cloudian HyperStore Hybrid Storage ServiceNetwork Setup Guide: Deploying Your Cloudian HyperStore Hybrid Storage Service
Network Setup Guide: Deploying Your Cloudian HyperStore Hybrid Storage Service
 
Backtrack Manual Part7
Backtrack Manual Part7Backtrack Manual Part7
Backtrack Manual Part7
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

How to use VTS with loadrunner

  • 1. How to use VTS with LR Kranthi Paidi 1
  • 2. What is VTS 2  VTS – Virtual Table Server  A windows service which maintains an in memory database that can be accessed by a number of load generators on a network  VTS helps different data dependent scripts “talk-to” each other during a load test  Unlike the parameter files which involves file operation in order to be changed once the test starts and thus bringing in concurrency issues, VTS holds and shares the values that “producer” scripts generate so that “consumer” scripts can act upon the data.  For example, if a script called Add_Issue generates an Issue ID which is assigned to a particular user, using VTS, this Issue ID can be “inserted” into a “table” during run time and “retrieved” by Close_Issue script by that particular user.  Thus, VTS can be treated (and is a kind of) database.  The only difference here is that you cannot “query” this database. For example, you cannot write a query like “select * from table_1 where user_ID=“kpaidi””  HP LoadRunner does not “officially” provide any support to VTS. This is a third party “add-in” that you have to use by yourself.
  • 3. What is VTS 3  Even though HP does not support this tool, thousands of users have used this and are still using it without any problems.  The last available version is VTS 2. This is no longer being developed, but, VTS2 is completely stable and has no issues reported over a significant time.  Attached in this slide is VTS.rar which has all setup files required. VTS
  • 4. Installing VTS 4  Minimum system requirements:  A 1-CPU 300Mhz+ Windows NT/2000  The total amount of data that VTS supports is limited by the Operating System’s maximum limit on process memory (2Gig to 3 Gig)  VTS is tested for 1 million entries per row. It supports only 32,767 rows  VTS should be installed on your controller(s) and all load generators that you intend to make use of in your load test.  For each machine, do the following:  Extract the zip file and click vtsinstall.exe  VTS automatically selects “C:Program FilesHPLoadRunner as installation directory  Select install  Open cmd prompt with elevated privileges  Cd to “C:Program FilesHPLoadRunnerbin”  Type regsvr32.exe vtsctls.ocx  Type regsvr32.exe msflxgrd.exe
  • 5. Setting up the Server 5  If your tests involve large data creation and consumption, please plan to have a separate machine as VTS server other than controller and load generator. Working on large sets of data will have its impact on the memory and network bandwidth thus affecting the load generators and controller. You do not want to introduce bottlenecks in the test design itself.  If your tests have minimal amount of data being operated up on (not more than a few MB), choose a less utilized load generator.  Whatever the machine you choose, determine the physical IP of the machine using “ipconfig /all” command from cmd prompt.  Once you determined the IP, check what ports are available on the machine. Use the command “netstat –an”. Choose a port that is available (I am choosing 8888 here)  Once you do the above, open a notepad and type the following  ECHO ON  CD “C:Program FilesHPLoadRunnerbin”  START vtconsole –port 8888 –launch
  • 6. Setting up the Server 6  Save the notepad as “START_VTS.bat” on a location you prefer (I prefer Desktop)  Click the batch file. You should see a window like this –
  • 7. Setting up the Server 7  Your VTS server is UP and READY now. You can use this as a database to store and retrieve values during a scenario run.  In the next few slides, we will see how to connect to a VTS from a VUGen script, how to write data, how to retrieve data and error handling.
  • 8. Connecting to VTS from VUGen 8  Include the following at the top of vuser_init, action, vuser_end sections  #include “as_web.h”  #include “vts2.h”  Your init, action and end sections will look like this –  In the vuser init section, write the following code to connect to VTS
  • 9. Connecting to VTS from VUGen 9  In the vuser_end section, write the following code. This disconnects the vuser from vtc.  If your VTS is up and running (remember the START_VTS.bat?), running the above VuGen code should not write any messages to the output screen. It should look like below:
  • 10. Connecting to VTS from VUGen – Error Codes 10  If you have any problems with VTS, the following error codes are returned:  #define VTCERR_INVALID_CONNECTION_INFO -10000 > verify the server name attribute.  #define VTCERR_FAILED_TO_RESOLVE_ADDR -10001  #define VTCERR_FAILED_TO_CREATE_SOCKET -10002  #define VTCERR_FAILED_TO_CONNECT -10003 > the vtconsole is not running.  #define VTCERR_INCOMPLETE_REQUEST -10100  #define VTCERR_FAILED_TO_RECV_RESPONSE -10101  #define VTCERR_INCOMPLETE_RESPONSE -10102  #define VTCERR_RESPONSE_ARGS_UNMATCH -10103  #define VTCERR_OPERATION_ERROR_BASE -11000
  • 11. Writing data into the server - example 11
  • 12. Data Manipulation in VTS 12  Insert Data Element:  Inserts operation data into the column specified by column name  Insert Unique Data:  Inserts operation data only if the data is unique  Update Data Element:  Updates the value of data element in the column name at selected location  Increment Data Element:  Increments the numerical data element in the column name at selected location by the number specified  Query data element:  Obtains the value of the data element in the column name at location specified  Clear Data Value:  Clears the data in the column name at location specified  Clear Entire Column:  Clears the entire column
  • 13. Client side API – LR functions 13  VTS supports two types of functions. Raw VTS functions and LR version of the same functions. The definitions for both the type of functions are available in vts2.  We will discuss and see only LR version of the fuctions  Connect/Disconnect:  PVCI lrvtc_connect(char *servername, int portnum, int options);  Options: 0 for None, VTOPT_KEEP_ALIVE for keep connection alive  PVCI is a typedef int variable  lrvtc_disconnect();  Query a Column: retrieves data from a Column specified by name and index  lrvtc_query_column(char *ColumnName, int RowIndex);  Query a Row: retrieves data from all columns in a row specified by row index  lrvtc_query_row(int RowIndex);
  • 14. Client side API – LR functions 14  Send data to a column: sends data to the next row of the column specified  lrvtc_send_message(char *columnName, char *columnValue);  Send unique data to a column : sends a data to the next row of column only if it is unique in that column  lrvtc_send_if_unique(char *columnName, char *columnValue);  Returns 1 for pass and 0 for fail
  • 15. Client side API – LR functions 15  Send entire row: Sends data into a row with specified column names  lrvtc_send_row1(char *columnNames, char *messages, char *delimiter, unsigned char sendflag);  Status code returned PVCI 1=pass, 0=fail  Update data: Updates data at specified column and index  lrvtc_update_message(char *columnName, int Index, char *message);
  • 16. Client side API – LR functions 16  Update entire row: Updates row data at specified column index  lrvtc_update_row1(char *columnNames, int index, char *messages, char *delimiter);  Clear Message: Clears the data at specified column and Index  lrvtc_clear_message(char *columnName, int index);
  • 17. Client side API – LR functions 17  Clear Column: Clears all data in the given Column  lrvtc_clear_column(char *columnName);  Clear row: Clears all data in a row of specified index  lrvtc_clear_row(int index);
  • 18. Client side API – LR functions 18  Retrieve message: retrieves and clears the first data element from a column  lrvtc_retrieve_message(char *columnName);
  • 19. Client side API – LR functions 19  Retrieve multiple messages: retrieves and clears the first data element from a row as specified by column names  lrvtc_retrieve_messages1(char *columnNames, char *delimiter);