Citrix Protocol on LoadRunner – Tips and Tricks Part 3

I’ve previously published two articles on Tips and tricks helpful to performance test Citrix applications with Loadrunner. The articles can be found here ->

Citrix Protocol on LR – Tips & Tricks (Part 1)

Citrix Protocol on LR – Tips & Tricks (Part 2)

In this article, I will cover the following:

  • Remotely managing hung Citrix sessions
  • Managing ‘Loadrunner Time out’ related failures
  • Handling windows that open during script execution

Remotely managing hung Citrix sessions

While debugging script-issues, one has to stop or restart the script execution abruptly which causes some sessions on the Citrix server to exist in open state – ‘hung sessions’. These ‘hung sessions’ can be terminated at the server, however a performance engineer may not know the required commands and configuration settings on Citrix servers.

A method a performance tester can use to achieve this is to create a batch file and run it through command prompt to reset the server sessions. This is a faster approach compared to the one in which sessions are terminated at Citrix servers by changing configuration settings.

The following two commands are required for this operation –


Server admin privileges are required to perform these commands. The batch file will have a separate command for every server.
Example: In case of 2 presentation servers named Server1 and Server2 the batch file looks like –

 for /f "tokens=2" %%i in ('qwinsta /server:Server1 ^| find /i "ica-tcp#"')
 do echo y | rwinsta /server:Server1 %%i

for /f "tokens=2" %%i in ('qwinsta /server:Server2 ^| find /i "ica-tcp#"')
 do echo y | rwinsta /server:Server2 <a href="">vigorelle huge discounts</a> %%i 

Managing ‘Loadrunner Time-out’ related failures

Some business processes take longer than expected time-duration to respond. Huge data-related transactions, Video-streaming transactions are some examples of such processes. During script execution such transactions fail throwing ‘timeout error’. The resolution of this issue is simple. In the Vugen run time settings, you need to increase the value of ‘Waiting time’ parameter. This change will allow the script to wait on each step longer without throwing ‘timeout failure’.

If you wish to set the higher waiting time only for a limited number of transactions, you can use ctrx_set_waiting_time function before and after the transactions that need additional wait time.

The function is

 ctrx_set_waiting_time ( long waitTime ); 

Handling windows that open during script execution

During script execution some unexpected windows may open/appear in the business flow and cause the vuser to stop script execution unexpected. ‘Warning messages’ or ‘pop-ups’ are examples of such windows. The ctrx_execute_on_window function in the script handles such windows and manages effective script execution.

The function is:

 ctrx_execute_on_window (char *window_name, long handler); 

Eg – Let’s consider a business situation in which application loses connectivity and application sends a popup window that allows the user to click on a button to reconnect. If the ctrx_execute_on_window function is used, the script will automatically recognise the window that opens up and executes the required step (clicking ‘reconnect’ button).  This means that you do not have to put in conditional logic for this scenario (‘Clicking on reconnect’) happening within the performance script.

11 thoughts on “Citrix Protocol on LoadRunner – Tips and Tricks Part 3

  1. Hi,

    Very useful information and I am sure it willbe helpful in mynext upcoming Load Runner + Citix protocol testign work.
    Thanks, Chitra

  2. Hi,

    i m doing 10 user load test using citrix protocol . here i have 10 seperate script for each user. the scripts are working fine in vugen , but while we doing load test in controller the sync on bitmap is failing for different transaction for different users . can u pls give me some guidline to avoid the mismatch in sync on bitmap .


    1. Try This –
      1. While recording ctrx script, go to Options – Code Generation
      2. Uncheck both the boxes
      3. Record the script and try on controller
      Not sure but I think this will resolve the issue. Let me know. [email protected]

  3. Hi Swaraj,
    Great article to begin with. I have a very specific question. Here it is.
    We recorded scripts with citrix + Web protocol.
    Everything works perfect.
    Is there a way to find out whether a window(page) loaded completely? We need to find the response time for a particular window. This particular window has many components in it. It takes time to load all the components in it.
    The following is the code snippet.


    The problem here is, the window exists function succeeds and goes into the if block. We need to put a statemet which tells us that the content in the window is compltely loaded and then PASS the transaction.

    I am not sure which function to use. The window page source has the onload() java script function but I am not sure how to use the same on Loadrunner.

    Any thoughts would be highly appreciated.


  4. Try using ctrx_sync_on_window, it will ensure that the window loads
    int i;

    i= ctrx_sync_on_window(“window name*”, ACTIVATE, 100, 91, 810, 520, “snapshot24”, CTRX_LAST);



  5. Hi Colleagues,

    I was recorded an script in Multiprotocol mode Http/CITRIX the script is working with one iteration but, don´t iterate with more than 2 cyclics, This is my question, is needed add new instructions to work? I need to move or comment lines about the screen to try to find the solution. this script has recorded in VuGen 11.52 with CITRIX.

    From Mexico City

Leave a Reply to Sweta Cancel reply

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