EV Observe - Synthetic Monitoring Module - Install Citrix Features

Last modified on 2023/09/28 16:54

When you run a scenario that opens a Citrix session, specific processes are launched locally under the names wfica32 and wfcrun32. If for any reason the connection to the Citrix server is lost, the processes launched in the session Citrix itself remain. Reconnecting using the same name, user and password restore the Citrix session graphic context as it was at the time of disconnection. This is normal behavior.

Things are a little different in the context of the Synthetic Monitoring module. When recording a scenario, the process launched is recorded at the end of the scenario in a section called Sub KillScriptProcess(). If the script goes into error, this subprogram will be automatically executed to clean up the local graphic context and remove all local Citrix processes. But the Citrix session on the Citrix server processes remains active.

KillScriptProcess example.png

In other words:

  • The steps to reconnect to the Citrix session are different.
  • The GUI of the recovered Citrix session may be different.
     

To solve this problem, two Citrix features can be added to scripts:

  • CitrixLogoff() function.
  • CitrixGetServerName() function.

Role of the Citrix features

The two Citrix features are based on developed API and interfaced directly with the Citrix receiver.

CitrixLogoff() function

The function sends a request to the Citrix receiver, via the API, to properly close the Citrix session on the server and terminate the session process.

You can then reconnect the session in the normal way.

CitrixGetServerName() function

The function retrieves from the database the name of the Citrix server that delivers the session service.

You must add the function in the scenario source code in a point after the session has been connected to the Citrix server.

Caution

  • Add the CitrixLogoff() function in the sub KillScriptProcess() subprogram of the scenario.
             Add CitrixLogoff function.png

Implementing the Citrix features

Implementation via the Visual Basic code

1. Launch the Recorder from the Systray. Open url.png See the procedure.

          Recorder from Systray.png

2. Click Open Source.

The scenario will open in Visual Basic. The Citrix service is inserted at the most appropriate point in the scenario. No additional setting is required.

          Citrix features inserted in VB code 1.png
         Citrix features inserted in VB code 2.png

3. Save the code.

The Visual Basic will close.

4. Click Build.

The scenario will be recompiled.

Implementation via the Scripts Manager tool

1. Launch the Scripts Manager tool.

2. Go to the Scripts menu.

3. Load the scenario.

4. Right-click on the action where you want to add the Citrix servic and select the VB Code option.

          Citrix features contextual menu to insert.png

5. Select the Citrix feature then click Add icon.png.

          Citrix features selected in list.png

The function will appear in the list of user actions.

          Citrix features inserted in user actions.png

6. Click Build.

The scenario will be recompiled.

Running the Citrix features

First launch of a scenario with a Citrix function

When you first launch a scenario with one of the Citrix functions, you must validate the local session configuration.

1. Make sure that the Citrix receiver dll, WfIcaLib.dll, is in the correct directory.

  • For 32-bit machines, by default C:\Program Files\Itexis\XWCF.
  • For 64-bit machines, by default C:\Program Files (x 86) \Itexis\XWCF.

2. Add the Citrix keys to the Registry.

          Add Citrix keys to Registry.png

PowerShell environment

If the PowerShell environment is configured in restricted mode, you will get an error message at the launch of the scenario. In this case, follow the procedure below.
         PowerShell error.png

1. Click OK.

2. Continue the procedure.

3. Open the PowerShell environment in administrator mode.

For 32-bit machines

  • Launch the Windows PowerShell.
             PowerShell run as admistrator on 32 bits machines.png
     

For 64-bit machines

  • Launch the Windows PowerShell (x 86).
             PowerShell run as admistrator on 64 bits machines.png
  • Type the following commands at the prompt.
Set-executionPolicy RemoteSigned - force
Get-executionpolicy with as return RemoteSigned
Tags:
Powered by XWiki © EasyVista 2024