PERFORMANCE TESTING FOR
CITRIX USING LOAD RUNNER
BEST PRACTICES BEST PRACTICES
Rupesh Garg & Saket BihariWipro Technologies.
HPs industry standard load testing product Load Runner has been customized to support Citrix environments. This means that customers can now accurately test and monitor their Citrix-based systems to ensure high performance, scalability and availability.
Load Runner works by emulating hundreds or thousands of Load Runner works by emulating hundreds or thousands of ICA clients with just a handful of machines to create a scalable MetaFrame XP load testing solution
This paper details the recording, replaying tips for Citrix scripts using Load Runner and the Best practices that can be implemented while Performance testing the Citrix clients.
Citrix provides server and desktop virtualization, networking, software-as-a-services (SaaS), and cloud computing technologies, including Xen open source products
Citrix Server: Citrix Server work as a remote connection by users and allows multiple users that allows multiple applications at the and allows multiple users that allows multiple applications at the same time.
Citrix Farm: Group of citrix servers with a load balancer which work as a traffic management in all servers using own effective algorithms.
Citrix XenApp: A thin client product that allows users to connect to their corporate applications. XenApp can either host applications on central servers or allow users to interact with them remotely or stream and deliver them to user devices for local execution.
Independent Computing Architecture
A protocol used to provide desktop virtualization across different platforms but it is not bound to any platform.platforms but it is not bound to any platform.
Data transfers from the server to the client generally involve a high-level view of the display rather than a full image of the screen, dramatically saving bandwidth and reducing the dependency on latency.
Utilizing this protocol, thin clients on a variety of end-user platforms may access applications on a centralized server that may not necessarily be supported on the end-user platform.
Recording and Validating the Citrix scripts
Citrix Recording Options:
Using Server Credentials with published applications or by using ICA file.If you have an existing .ica file (provided by Citrix administrator/developer) with the entire relevant configuration information, select Use ICA file for connection parameters.
Citrix Script Validation:
Citrix provides three types of mechanism for Script validation:
A synchronization function that waits for a specified string to appear at the specified position before continuing.
It is a synchronization function that waits for a window to come into existence or become active.
It is a synchronization function that waits for a specified bitmap to appear before continuing. The function can be manually recorded by clicking on the rectangle icon in VuGen's Citrix recording toolbar.
Common problems encountered while running the scriptsIssue:
Error: Connect cannot be established - Last Error=70, Last client error=1030
Error: Failed to create channel agent
Solution: The above mentioned error usually can be resolved by clearing the citrix client cache and registry, and re-running the citrixclearing the citrix client cache and registry, and re-running the citrixregistry patch.
Steps for Clearing the citrix client cache and registry Close all the citrix based applications. Exitfrom "citrix program neighborhood agent.
Right click on the citrix program neighborhood agent icon and select "Exit".
Run command regedit My Computer > HKEY_CURRENT_USER > Software>Citrix
Delete Citrix Folder
Delete Citrix Folder - right click Citrix folder and select Delete Click Yes to 'Confirm key Delete' alert message.
If c:\Documents and Settings\Administrator\Application Data has ICAClient and/or Citrix folders, delete these folders.
Reboot the machine.Run LRCtrxClient10Support_enableVC.reg citrix client loadrunnerregistry patch.
Best Practices:1. Pre-Recording tips2. Recording tips3. Replay tips
Pre-Recording tips: In the recording options we need to specify the user name, password, domain, connection type, citrix server name and published application.
To find out which server to hit, follow these steps:To find out which server to hit, follow these steps: Open the application in Citrix - Right-click on Citrix Program Neighborhood Agent icon and chose the desired application.
Get the server name - Right click on the Citrix Program Neighborhood Agent icon and click on Connection Center.
Recording tips: When recording a session, make sure to perform the complete business process, starting with the connection and ending with the cleanup. End your session at a point from where you could start the entire process from the beginning.
Always make sure that your script is able to run for multiple iterations.
Record the connection process into the vuser_init section, and the Record the connection process into the vuser_init section, and the closing process in the vuser_end section. This will prevent you from performing iterations on the connection process.
Try to use keyboard as much as possible, use mouse only when there is no alternative for keyboard shortcut.
After every screen or step, apply text check. The function ctrx_sync_on_text() can only be used if LoadRunner agent is installed on the Citrix server. Here you cannot take image text from the screen.
Avoid using ctrx_sync_on_bitmap() for synchronization. It is because synchronization on bitmaps can lead to replay failure if different machine is used.
If you still need to use ctrx_sync_on_bitmap() then first of all check for the consistencies between the recorded and replay machines: for the consistencies between the recorded and replay machines: Window Size (resolution), Window Colors, System Font and the other Default Options settings for the Citrix client. These settings affect the hash value of bitmaps, and inconsistencies may cause replay to fail.
Replay Tips: For best results, do not disable think time in the Run-Time settings. Think time is especially relevant before the ctrx_sync_on_window and ctrx_sync_on_bitmap functions, which require time to stabilize.
After replay failure use different Login ID to login to the Citrix Server. Since each login ID has some fixed specific session time span, logging in with the same ID before the session time has expired would cause to take the user to same screen where it had expired would cause to take the user to same screen where it had left when the error occurred.
Use the function ctrx_set_waiting_time before wait functions to set the desired waiting time as shown in below snapshot. The parameters connect and waiting timeout in runtime settings apply only for connection event and synchronization functions, respectively and not for wait functions.
To get proper response time for any particular transaction, keep only the synchronization function inside it without think time in between.
Use think time in between tabs to provide proper time for page loading so that no events/hits are missed while replay.
In some Citrix sessions, the active window name changes while you In some Citrix sessions, the active window name changes while you are recording. If you try to replay the script as is, the Vuser uses the original window name and the replay may fail then in that case we can use wild card (*) in the same place.
E.g.: ctrx_sync_on_window ("User *", ACTIVATE, 187, 83, 427, 351, "snapshot1", CTRX_LAST);
Citrix agent Friend or Foe?
The LoadRunner Citrix agent was designed to make scripting easier by recognizing objects. But sometimes when agent is installed on the Citrix server, VuGen no longer works. Certain windows in the application would not even pop-up when doing a single mouse-click, and the only solution was to turn the Citrix agent off.
If you get to certain screens and everything seems to run at a If you get to certain screens and everything seems to run at a crawl, or it seems like your session is hanging, rename the LoadRunner Citrix agent on the server to turn it off. Then record a new script without it. If things are faster it may be the agent causing the problem. As always, ensure the agent is the same version as the rest of your LR software.
Lost in Citrix Error:
Following code is helpful when you are lost in a Citrix error where expected windows are not appearing where they are supposed to, or they are not the right ones. Many times this will help you expose just what the window and X/y coordinates are that are causing a problem.
At the top of the script initialize the variables, and when you get to At the top of the script initialize the variables, and when you get to a portion of the code where a problematic window has been stopping the script, place the ctrx_get_window_nameand ctrx_get_window_position right before it.
charwindow_name;long xpos,ypos, width,height;ctrx_get_window_name(window_name);ctrx_get_window_position(window_name, &xpos, &ypos, &width, &height);lr_output_message("Window = %s. x= %ld, y= %ld, width= %ld, height = %ld", window_name, xpos, ypos, width, height);
The ctrx_execute_on_window is