How to add VTS functions in Ajax TrueClient script

Adding Ajax TrueClient VTS functions to the Script

We will see how to add the vts function to the trueclient script step by step.

Step 1 :

  • Launch the trueclient protocol in the Vugen.
  • And click on Develop script option in the script.
  • And record the flow or you can add the functions before itself.

Add Ajax TrueClient VTS functions : Script

Click Here to know how to record the script in trueclient

Step 2:

  • Drag and drop the Evaluate Java script into the trueclient panel from the miscellaneous section.
  • And click on the js option present in the Evaluate Java script option.
  • Once you click on the js option, the working area will be displayed.

Add Ajax TrueClient VTS functions : Java script

Step 3 :

  • You should be knowing the VTS server name and port number. If not then fellow the steps.
    • Launch the VTS Server where it has installed..
    • And the copy the server name of the VTS. Here the VTS server name is localhost.
    • And also copy the port number which is used to communicate with the server. Port number is 8888.

Add Ajax TrueClient VTS functions: VTS Server

  • So if you know the server and port number of the VTS then you can skip to step number 4.

Step 4 :

  • And the working area will be displayed once the js option is clicked.
  • Add the vts connect function which is used to connect to the VTS server.
    • TC.vtcConnect(serverName, port, vtsName);
    • serverName: which we copied from the VTS server.
    • Port : Number which is used to communicate to the server which we copied in the last step.
    • vtsName: It the alias name which will be used to add,get,clear or disconnect from the VTS server.
  • So the function will be as below
    • TC.vtcConnect("localhost", 8888, "vtsdemo");
  • But to verify the connection let add a verifying logic to check if the connection is successful to the VTS server or not.
  • So click on OK after entering the details.

 

Step 5:

  • Now add¬†Evaluate Java script again for sending the data to the VTS server.
  • And add the below code in the editor and click on ok button.
  • TC.vtcAddCell("P_Address", "1665656 Road", "vtsdemo");

Step 6 :

  • And again add one more Evaluate Java script from the miscellaneous section for disconnecting from the VTS server.
  • Add the vts disconnect function which is used to disconnect from the VTS server.
    • TC.vtcDisconnect(vtsName);
    • vtsName: The same alias name which will be used during connecting to the VTS server.
  • So the function will be as below
    • TC.vtcDisconnect("vtsdemo");
  • But to verify the connection let add a verifying logic to check if the connection is successful disconnected the VTS server or not.
  • Click on OK after entering the details.

Step 7 :

  • And save the script and click on run button.
  • You will see count of data sent to the VTS on the Refresh button.
  • So once you see the count click on Refresh button and the data will reflect which is sent to the VTS server from the script.
  • But the output message will not be displayed in the developer mode. Check next step to see the output message.

Step 8 :

  • So once the script is running end to end without any error message.
  • Close the developer mode of the trueclient.
  • Save the script again and click on run button.
  • So you will see the message on the output panel for connecting and disconnecting from the server.
  • And also the data will be entered in the VTS server.

Leave a Reply

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