Highlighted
Absent Member.
Absent Member.
674 views

HP Loadrunner issue due to upgrade from version11 to 12.53

We were using LR11.00 version with Desktop version of VTS. Now, as the requirement changed, we have to upgrade to LR12.53. is it possible to use the same VTS as that od LR11 in LR12.53? Or what changes can be required.
0 Likes
4 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: HP Loadrunner issue due to upgrade from version11 to 12.53

Hi

VTS made a big change in 11.52 and then have been upgraded with every release, so current version is 12.53.

I can see no reason to stay with old VTS, only disadvantages. I have not seen the help/documentation online for VTS, but it is available once it is installed. Installation-media for VTS is included with LoadRunner additional components, so just install it and test. Fast and uncomplicated.

VTS 11.52 chnages /t5/LoadRunner-and-Performance/The-New-Virtual-Table-Server-VTS-in-LoadRunner-11-52/ba-p/6069435

Migrating scripts from old to new version is documented in the help in VTS, but in short:

  1. Remove all lr_load_dll ("vtclient.dll") functions from the Vuser script.
  2. Remove all instances of #include "vts2.h" from all sections of the Vuser script.
  3. In the Vuser script, change all instances of PVCI to PVCI2.
  4. In the Vuser script, change all instances of VTCERR to VTCERR2.



br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: HP Loadrunner issue due to upgrade from version11 to 12.53

#ifndef _XEROX_VTS
#define _XEROX_VTS

//#include "vts2.h"  // file that defines all the functions in the dll, stored in the lr folder

#define EQ ==
#define ok 0


#define VTS_SERVER_NAME 	"gbrlon05vm208.eu.xerox.net:4000"
#define VTS_ERROR_PORT		"8850"
// call functions using "lr_eval_string( VTS_SERVER_NAME )"





/* VTS Port Definitions, Use port 8889 for debug */
#define VTS_CSO001_OUTPUT_PORT 	"8867"	// Save service order number created
#define VTS_CSO002_INPUT_PORT  	"8867"	// Get the service order created by cso001
#define VTS_CSO002_OUTPUT_PORT	"8872"	// Save the engineering assignments information
#define VTS_CSO003_INPUT_PORT 	"8872"
#define VTS_MTO260_OUTPUT_PORT	"7786"	// Donedeal Creation




//******************************************************************************************************/
			//#include "\\gbrlon05vm092\psv\shareddata\xerox_vts.h"
			//#include "\\gbrlon05vm092\psv\shareddata\xerox_portal.h"

//======================================================================================================
/*
	Calling Order for the NEW VTS functions:

	Initialization:

		vuser_init()
		{
			initVTS();
			return ( 0 );
		}

	Where the data is ready to be saved or written:

			rc = saveDataToVTS( "DataName", lr_eval_string( "{DataValue}" ),
					lr_eval_string( "{PORT}" ) );

	OR for example, for CSO_002:
			rc = saveDataToVTS( "Assign_Service_Order;Assign_Engineer_Id;Assign_Engineer_Pwd;Assign_Engineer_Number",
				lr_eval_string("{Service_Order};{engineer_id_in};{engineer_pwd_in};{engineer_no_in}"),
				lr_eval_string( "{VTS_CSO002_OUTPUT_PORT}" ) );

	where the data is ready to be retrieved or read:

			rc = getDataFromVTS( "DataName", lr_eval_string( "{PORT}" ) );

	OR for example, for CSO_003:
			rc = getDataFromVTS( "Assign_Service_Order;Assign_Engineer_Id;Assign_Engineer_Pwd;Assign_Engineer_Number", 
				 lr_eval_string( "{VTS_CSO003_INPUT_PORT}" ) );


			
*/
//======================================================================================================
//******************************************************************************************************/


//
//******************************************************************************************************/
//======================================================================================================
// Saves the converted error message to the "VTCErrorMsg" parameter for later reporting by the caller
// Can then print the message using:  lr_eval_string( "{VTCErrorMsg}" );
//
static void saveVTCErrorMsg ( int rcFromVTC ) 
{			
	switch ( rcFromVTC ) {
//		case VTCERR_OK:
//			break;
		case VTCERR_INVALID_CONNECTION_INFO:
			lr_save_string( "VTCERR: Invalid Connection Info", "VTCErrorMsg" );
			break;
		case VTCERR_FAILED_TO_RESOLVE_ADDR:
			lr_save_string( "VTCERR: Failed to resolve addr", "VTCErrorMsg" );
			break;
		case VTCERR_FAILED_TO_CREATE_SOCKET:
			lr_save_string( "VTCERR: Failed to create socket", "VTCErrorMsg" );
			break;
		case VTCERR_INCOMPLETE_REQUEST:
			lr_save_string( "VTCERR: Incomplete request", "VTCErrorMsg" );
			break;
		case VTCERR_FAILED_TO_RECV_RESPONSE:
			lr_save_string( "VTCERR: Failed to receive response", "VTCErrorMsg" );
			break;
		case VTCERR_INCOMPLETE_RESPONSE:
			lr_save_string( "VTCERR: Incomplete response", "VTCErrorMsg" );
			break;
		case VTCERR_RESPONSE_ARGS_UNMATCH:
			lr_save_string( "VTCERR: Response args unmatch", "VTCErrorMsg" );
			break;
		case VTCERR_OPERATION_ERROR_BASE:
			lr_save_string( "VTCERR: Operation error base", "VTCErrorMsg" );
			break;
		case VTCERR_SERVER_IS_BUSY:
			lr_save_string( "VTCERR: Server is busy", "VTCErrorMsg" );
			break;
		case VTCERR_CLIENT_REQUEST_ERROR:
			lr_save_string( "VTCERR: Client requst", "VTCErrorMsg" );
			break;
		default:
			lr_save_string( "VTCERR: Unknown Error", "VTCErrorMsg" );
			break;
		}
	}
//******************************************************************************************************/
//======================================================================================================
static int openVTS( char *vtsPort )
{
	int iVTSPort;
	int rc;
        PVCI pvci;

	iVTSPort = atoi( lr_eval_string( vtsPort ) );
 
        pvci = lrvtc_connect( lr_eval_string( VTS_SERVER_NAME ), iVTSPort,0);

	rc = vtc_get_last_error( pvci );
	if( rc != ok ) {
		lr_message("*** Unable to connect on port %i",iVTSPort);
		lr_abort();
		}

	return( rc );
	}

//******************************************************************************************************/
//======================================================================================================
// Call the initVTS() function only 1 time in the init of the script, don't know how to "unload_dll"

void initVTS ( void ) 
{
	//lr_load_dll("vtclient.dll");
	}

//*****************************************************************************************************/
//*****************************************************************************************************/
//======================================================================================================
// For saving 1 column or multiple columns
//
// Sample Call for saving 1 column:
//  saveDataToVTS( "DataName1", "DataValue1", lr_eval_string( "{definedPortNumber}" ) );
//
// Sample Call for saving multiple columns of data:
//  saveDataToVTS( "DataName1;DataName2", "DataValue1;DataValue2", lr_eval_string( "{definedPortNumber}" ) );
//
//NOTE:  the delimiter between the data names and data values is ALWAYS ";"
//
//

int saveDataToVTS ( char *columnNames, char *columnValues, char *vtsPort )
// Return code: vts codes, Just check for if ( rc != ok ) then quit
//
{
	int rc; // return code

	rc = openVTS( vtsPort );

	if ( rc EQ ok ) {

		// Send VTS the script output data
		rc = lrvtc_send_row1( columnNames, columnValues, ";", VTSEND_SAME_ROW);

		// Disconnect 
		lrvtc_disconnect();

		//Check Successful VTS create
		/*if ( rc != ok ) {
			lr_error_message("ERROR: ***VTS send failure*** rc = %i, Port = %s, ColumnNames = %s, ColumnValues = %s ", 
	 			rc, vtsPort, columnNames, columnValues );
			}
		else {
			lr_log_message("***Successful Send to VTS Port = %s, Data Saved = %s ***", vtsPort, columnValues );
			}
		}*/

	return( rc );
	}

//******************************************************************************************************
//======================================================================================================
// For getting 1 column or multiple columns of data from the VTS port specified
//
// Sample call for 1 column:  getDataFromVTS( "Service_Order", lr_eval_string( VTS_CSO_001_OUTPUT_PORT ) );
//
// Sample Call for multiple columns:  getDataFromVTS( "DataName1;DataName2", lr_eval_string( "{definedVTSPort}" ) );
//NOTE:  the delimiter between the data names and data values is ALWAYS ";"
//

int getDataFromVTS ( char *dataNames, char *vtsPort )
// Return code: vts codes, Just check for if ( rc != ok ) then quit
//
{
	int rc;  // Return Code 

	rc = openVTS( vtsPort );
	if ( rc EQ ok ) {

		//Retrieve a Service Order generated from CSO_001 through VTS
		rc = lrvtc_retrieve_messages1( dataNames, ";" );

		if (rc != VTCERR2_OK || (strlen( dataNames ) EQ ok ) ) {
			saveVTCErrorMsg( rc );
			lr_error_message( "VTS Retrieve Failed: %s, For Data: \"%s\", From port: %s",
					lr_eval_string( "{VTCErrorMsg}" ), dataNames, vtsPort );
			lr_abort();//Added by Luis
			/* Are retries really needed ? find out */
			}
		else {
			lr_log_message("***Successful Get From VTS Port = %s, Data = %s ***", vtsPort, dataNames );
			}
		}

	// Disconnect 
	lrvtc_disconnect();

	return( rc );
	}

//******************************************************************************************************
//======================================================================================================
//******************************************************************************************************


#endif  //_XEROX_VTS

Thanks for the reply.

 

I have tried this, but getting the error - Redeclaration of PCVI. Attaching the old vts header file we are using. 

for the upgraded version, i changed to PCVI2 and VTCERR2. Redeclaration error received.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: HP Loadrunner issue due to upgrade from version11 to 12.53

Hi

You are trying this in LR 12.53 agaianst VTS 12.53 right?

Point 3 means that you should change (around line 121)

        PVCI pvci;

to

        PVCI2 pvci;

try that.

br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

.
0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: HP Loadrunner issue due to upgrade from version11 to 12.53

Hello,

The “Redeclaration of PVCI” is a compile time error message.

It means when compiler compiles the C source code, It find the symbol “PVCI” has been defined twice or more.  

In 12.53, VTS definitions is auto included by default, no need to include the old VTS header file: "vts2.h" again, and no need for user to define the PVCI or PVCI2 type manually. (the souce code may looks like: typedef int PVCI;  )

The error message should come together with the related file path and line number in source code  (you can see it in the “View->Errors” window) just navigate to that file and comment out the definitions.  

Regards,

Bingle(LoadRunner R&D)

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.