Share this page

# Use VTS in TruClient scripts

This section explains how to use VuGen Virtual Table Server (VTS) parameterization in a TruClient script. VTS is a Web-based application that offers an alternative to standard VuGen parameterization in Vuser scripts. For details on installing and using VTS, see Virtual Table Server.

Note: For details on using VTS in a TruClient 2.0 - Web script, see VTS parameterization.

In this topic:

## Connect to a VTS server

1. Click the Add Step button in the toolbar, select Miscellaneous and drag an Evaluate JavaScript step to the requiredlocation in the script.

2. To connect to a VTS, enter one of the following in the Arguments > Code section of the step:

   - `TCA.vtcConnectEx(“serverName”, port, "UserName", "password", "domain", "alias")` - supports HTTP, HTTPS, basic authentication, and NTLM authentication.

   - `TCA.vtcConnect(“serverName”, port, “alias”)` - supports HTTP.

   You can identify the server either by domain name or by IP address. Creating an alias for the server will make it easier to identify which VTS you are referencing in your code if you are using more than one server.

   Example: `TCA.vtcConnectEx("myServer",8888,"myUser", "myPW", "myDomain", "myVTS");`

3. To disconnect from a VTS, enter TC.vtcDisconnect("alias") in the Arguments > Code section of the step.

Tip:

- Before you replay the script, play the `TCA.vtcConnectEx` step (from within the step) to verify the connection to the VTS server.

- If you are unable to connect to a remote VTS server, configure the firewall on the VTS server machine, making sure the connection to the VTS port or process is enabled.

- Once you have established a connection to the VTS server, you can play other VTS API steps, modify them and replay again.

- Replaying the entire script will automatically disconnect the VTS even if there is no disconnect step in your script.

- The VTS server supports port forwarding that redirects communication requests from one port to another.

Examples

- Using a server name and VTS name (alias):

      TCA.vtcConnectEx(“MyServer”, 8888, “User1”, “userPW”, “userDomain”, “UsersTableVts”);

      TCA.vtcDisconnect(“UsersTableVts”);

- Using the server IP address and VTS name (alias):

       TCA.vtcConnectEx(“192.168.1.133”, 8888, “Worker1”, “WorkersPW”, “WorkersDomain”, “WorkersTableVts”);

       TCA.vtcDisconnect(“WorkersTableVts”);

- Using the server name without a VTS name (alias):

       TCA.vtcConnectEx(“MyServer”, 8888);

       TCA.vtcDisconnect();

- Using the server IP address without a VTS name (alias):

      TCA.vtcConnectEx(“192.168.1.133”, 8888);

      TCA.vtcDisconnect();

Back to top

## Pass VTS parameters to another step

You can use the Evaluate JavaScript code step to pass VTS parameters to another step in your script. The example below shows you how to parameterize a URL.

1. Connect to a VTS server.

   1. Click the Add Step button , select Miscellaneous and drag an Evaluate JavaScript step to the required location in the script.

   2. To connect to a VTS, enter `TCA.vtcConnectEx(“serverName”, port, "UserName", "password", "domain", "alias")` in the Arguments > Code section of the step.

2. Create a step that contains a variable.

   1. Click the Add Step button , select Miscellaneous and drag an Evaluate JavaScript step to the required location in the script.

   2. In Argument > Code section enter define your variable.

      For example, to get data from the server enter `var ws = TCA.vtcGetCell("Web Sites",1,"alias");`

3. Click the Add Step button , select Functions and add an Generic Browser Action step to your script.

4. Enter the variable you defined in Step 2 in Argument > Location.

Back to top

## Use a VTS API function directly in a step

You can use the Evaluate JavaScript code step to call a VTS function in your script. The example below shows you how to parameterize a URL.

1. Connect to a VTS server.

   1. Click the Add Step button , select Miscellaneous and add an Evaluate JavaScript step to your script.

   2. To connect to a VTS, enter `TCA.vtcConnectEx(“serverName”, port, "UserName", "password", "domain", "vtsName")` in the Arguments > Code section of the step.

2. Click the Add Step button , select Functions and add a Generic Browser Action step to your script.

3. Enter `TCA.vtcGetCell("Web Sites",1,"alias");`in the Argument > Location section of the script.

Back to top

See also:

- Use parameters to vary arguments

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1 All View Local Help Center View Online Help Center Version: