Ajax TrueClient VTS Functions

Ajax TrueClient VTS Functions

Below are the list of Ajax TrueClient VTS Functions present in loadrunner and there examples.

TC.vtcConnect :

  • It is used to established the connection from the scripts to the VTS server.
  • So it will open the connection from the script to VTS server and the connection will be open until it is disconnected.
  • Equipment function used in web script  is  : vtc_connect.
  • Syntax : TC.vtcConnect(serverName, port, vtsName);
    • serverName. (String) Either the IP or server name.
    • port. (Integer) The port number
    • vtsName. (String) The alias of the VTS server.
  • Example : TC.vtcConnect("MyServer", 8888, "MyVts");

TC.vtcAddCell :

  • Used to add or send a value to a column specified.
  • So the values will be added to the end of the column.
  • But if the column name is not present in the VTS server, then it will create the column name and add the value.
  • Equipment function used in web script  is  : lrvtc_send_message.
  • Syntax : TC.vtcAddCell(colName, value, vtsName);
    • colName. (String) The name of the column.
    • value. (String) The value as a string.
    • vtsName. (String) The alias of the VTS server.
  • Example :  TC.vtcAddCell("P_Address", "1665656 Road", "VTS_Name");

TC.vtcAddCells :

  • It is used to add multiple values into the VTS using this function.
  • So the values will be added to the end of the specified column.
  • But if the column name is not present in the VTS server, then it will create the column name and add the value.
  • Equipment function used in web script  is  : vtc_send_row1.
  • Syntax : TC.vtcAddCells(colNames, values, option, vtsName);
    • ColNames. (String) Column names delimited by a semi-colon.
    • values. (String) The values as a string delimited by a semi-colon.
    • option. (Integer) Define how the values are added.
      • 0. Add as same row in all columns based on the column with the highest row count. The created row will be n+1 for all columns.
      • 1. Add as stack - last row in every column.
      • 2. Add as unique stack - last row in every column only if the value is unique in the column.
  • vtsName. (String) The alias of the VTS server.
  • Example : TC.vtcAddCells( "MyColumn1;MyColumn2;MyColumn2", "MyValue1;MyValue2;MyValue3", 0, "MyVts");

TC.vtcGetCell :

  • It will return the first row value of the column specified.
  • But it will not delete the value from the cell.
  • It will just copy the values from the column.
  • Equivalent method in web script is : lrvtc_query_column.
  • Syntax : TC.vtcGetCell(colName, rowIndex, vtsName);
    • colName .(String) The name of the column.
    • rowIndex. (Integer) The index number of the field as an integer. 1 is the first field in the column.
    • vtsName. (String) The alias of the VTS server.
  • Example : TC.vtcGetCell("MyColumn",1,"MyVts");

TC.vtcPopCell :

  • It will return the first row value of the column specified.
  • But it will delete the value from the cell.
  • Equivalent method in web script is : lrvtc_retrieve_message.
  • Syntax : TC.vtcPopCell(colName, vtsName);
    • colName .(String) The name of the column.
    • vtsName. (String) The alias of the VTS server.
  • Example : TC.vtcPopCell("MyColumn","MyVts"); 

TC.vtcClearCell :

  • It is used to clear the value in the column.
  • By default it will clear the first value in the columns. But you can specific the cell number also which one you want to delete.
  • Equivalent method in LoadRunner: lrvtc_clear_message.
  • Synatax : TC.vtcClearCell(colName, rowIndex, vtsName);
    • colName. (String) The name of the column.
    • rowIndex. (Integer) The index number of the field as an integer. 1 is the first field in the column.
    • vtsName. (String) The alias of the VTS server.
  • Example : TC.vtcClearCell("MyColumn",1,"MyVts");

TC.vtcClearColumn :

  • It will clear all the values in the column.
  • Equivalent method in LoadRunner: lrvtc_clear_column.
  • Syntax : TC.vtcClearColumn(colName, vtsName);
    • colName.(String) The name of the column.
    • vtsName. (String) The alias of the VTS server.
  • Example : TC.vtcClearColumn("MyColumn","MyVts");

TC.vtcDisconnect :

  • It is used to disconnect the VTS connection from the server.
  • Equivalent method in LoadRunner: lrvtc_disconnect.
  • Syntax : TC.vtcDisconnect(vtsName);
  • Example : TC.vtcDisconnect( "MyVts");

Leave a Reply

Your email address will not be published. Required fields are marked *