Citrix Tips & Tricks
Citrix Tips & Tricks
Citrix Tips & Tricks
REQUIREMENT...............................................................................................................2
For LoadRunner7.51 ..................................................................................................2
For LoadRunner7.6 and above:..................................................................................2
HOW TO FIND OUT THE CURRENT CITRIX SERVER VERSION ......................2
For MetaFrame XP:....................................................................................................2
For MetaFrame 1.8:....................................................................................................2
WHAT CITRIX METAFRAME VERSIONS DOES LOADRUNNER SUPPORT....2
WHICH CITRIX CLIENT TYPE DOES LOADRUNNER SUPPORT?....................3
For running Vusers as threads:...................................................................................3
For running Vusers as process:...................................................................................3
COMMON PROBLEMS...................................................................................................4
Record..........................................................................................................................4
Replay..........................................................................................................................8
BITMAP SYNC INFORMATION.................................................................................14
256-Colors settings....................................................................................................15
Windows Terminal ....................................................................................................15
CITRIX FUNCTIONS – ADDITIONAL INFORMATION........................................15
COMMON PRACTICE..................................................................................................16
REQUIREMENT FOR CITRIX MONITOR...............................................................17
ADDITIONAL INFORMATION...................................................................................17
1
4/23/2003
Requirement
Recording against Citrix ICA client is supported starting with LoadRunner 7.51.
For LoadRunner7.51
a. Install LoadRunner 7.51 and apply the liveupdate (SP1)
b. Install Citrix_ICA_Add-in.exe patch from LoadRunner’s patches database under
LoadRunner LR7.51SP1 Citrix LR751SP1P1
c. Install Citrix client (6.30.1060.zip) and Citrix_patch_27.exe from LoadRunner’s
patches database under LoadRunner LR7.51SP1 Citrix LR751SP1P27
1. For MetaFrame XP, all versions (a, e and s) are supported. You must have at least
Feature Release 1 (FR1) applied on top of MetaFrame XP in order for LoadRunner to
support your environment. Citrix MetaFrame XP comes in three flavors:
2. For MetaFrame 1.8, you must have SP3 applied on top of it in order for LoadRunner
to support your environment.
2
4/23/2003
As of current, LoadRunner does not support the ICA Java client. However, since the
communication between the Java client and the Windows client in identical, using the
Windows client will simulate the same load on the server.
3
4/23/2003
Common Problems
Record
b. The port-mapping tab should look like the following after both entries are entered:
c. Record a new script and the error should not occur again.
4
4/23/2003
Q. During recording, there is a window titled “ICA Seamless Host Agent” that
pops up. When manually logging into the application there is no such popup.
R. This popup is a result of the mode that VuGen is recording in. The Citrix solution
requires that LoadRunner record in this mode. This is an informative window
popup and not an error. To work around it, simply click on OK and it will go
away.
Q. During recording, VuGen launches the Citrix ICA client but NOTHING is
recorded.
R. This happens when you have your own Citrix client installed on the recording box in
addition to Mercury’s. Go to the Control Panel and uninstall ALL PREVIOUS Citrix
ICA and Citrix Web clients on the box PRIOR to installing Mercury’s.
Q. VuGen cannot launch the Citrix ICA client during a Citrix recording. When
launching the application, the following error pops-up
R. You will get the error if you are recording against your own Citrix client instead
of LoadRunner’s Citrix client (runDlg.exe) thru VuGen. The solution is to specify
the path to <LoadRunner>\bin\runDlg.exe in the Program to record field, and
have <LoadRunner>\bin in the Working directory.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\WindowsAppInit_DLLs
and check to see if it’s pointing to bbhook.dll. If it is then remove the entry and
then reboot the machine.
5
4/23/2003
• AVSyncManager
• McShield
If you have Norton Anti-Virus installed, shut down the Norton Antivirus service
from the services menu.
For Windows 2000 machine, go to Start -> Settings -> Control Panel ->
Administrative Tools -> Services.
For Windows NT machine, go to Start -> Settings -> Control Panel -> Services.
Q. The Recording Options in VuGen is NOT reflecting the changes being made
in it. The user changes the information, clicks on OK, but when going back
to the Recording Options the information is still not changed.
R. Click on the “Use Defaults” button to clear the information and then re-enter it
again. Or, you can go to the LoadRunner\dat directory and look for citrix_ro.ini.
This file contains information from the Recording Options. Make sure the
changes are being reflected here.
Q. Recording against a drop down menu does not work. During replay it fails on
the ctrx_mouse_click when it is supposed to select an item from the drop down.
R. Use arrow keys instead of mouse click to select an item from the drop down during
recording.
Q. When performing bitmap sync during recording, the following error pops up:
6
4/23/2003
R. Make sure that you are not connecting to another Citrix server within the first Citrix
session. If this is true, then the hashing mechanism will not work and you will see an
error. This is because an ICA session cannot create an OffScreen surface when
embedded in another ICA session. It is this OffScreen mechanism that allows the
Screen Capture/hashing functionality
Q. When recording a Citrix ICA script, only 3 events are recorded. Afterwards,
mouse click movements are not being recorded. When logging off, the server
gets the following error:
R. This can happen when the OS that LoadRunner’s installed on is NT 4.0 SP6.
Please connect to the Citrix server without VuGen first and then try recording in
VuGen again.
Q. Upon login, the user is getting a popup window indicating the user is using an
older version of the Citrix client.
7
4/23/2003
Q. During recording, user recorded bitmap sync. User then opened the <hash
value>.bmp file in the <script directory>\data folder. The bitmap does not look
the same as the one taken during recording.
R. Sometimes when you use 256-colors setting, the recorded bitmaps in the script's data
directory do not have the same color as you saw during recording. This should not
matter as long as the bitmap hash value stays the same during replay. For further
information, refer to Bitmap Sync Information section.
Replay
8
4/23/2003
Q. Sometimes, VuGen records an index after the window name. For example,
sometimes it records “EMPOWER By Eastern Software Corporation_2”, while
other times it just records “EMPOWER By Eastern Software Corporation”.
Because of this, replay fails if the window name does not match exactly.
R. Sometimes, during recording the server is sending LoadRunner 2 windows with the
same name, and therefore LoadRunner will put an index after it. The workaround is
to put some logic in the script to handle it. Below is an example.
else
Q. The Citrix ICA client window is minimized during replay. Clicking on the
icon on the taskbar does not bring it up.
R. Right click on the Citrix ICA Client icon on the taskbar and select maximize. This
will bring the client back to the restored view. Adjust the window size as
necessary. Do not minimize the Citrix ICA Client window during replay, as this
will cause the same problem to occur again.
9
4/23/2003
R. Check that the nfuse_1.ica file is successfully created in the script directory
during replay. The contents of the ICA file should look similar to the following
(HINT: Open in Notepad or else it will try to connect to the server!):
Nfuse_1.ica
If the file contains something else then you can do the following:
1. Check that the cookie and header information is handled properly in all the
web requests prior to the ctrx_nfuse_connect statement. It may be
necessary to manually add some web_add_header or web_add_cookie
statements. An easier approach is to record a single protocol web script up
to the point where the published application is launched. Stop the
recording, copy the web requests recorded and paste it above the ctrx_xxx
functions in the Multi protocol script. You need to comment or delete the
original web requests that are recorded above the ctrx_xxx functions.
web_url("Word",
"URL=http://xxx.xxx.xxx.xxx/citrix/nfuse16/launch.asp?NFuse_Application
=Word”,
"Resource=0", "RecContentType=application/x-ica",
"Referer=http://xxx.xxx.xxx.xxx/citrix/nfuse16/applist.asp?NFuse_currentFo
lder=",
"Mode=HTTP", LAST);
ctrx_nfuse_connect("http://xxx.xxx.xxx.xxx/citrix/nfuse16/launch.asp\?NFuse_U
ID=<NFuse_UID>&NFuse_Application=Word&NFuse_MIMEExtension=.i
ca");
Q. How to increase the number of Citrix Vusers that can be executed on each
Load Generator machine.
R. Machines running Citrix Vusers may be limited in the number of Vusers that can
run, due to the graphic resources available on that machine. To increase the
10
4/23/2003
number of Vusers, open multiple Terminal Server sessions to the load generator
machine and relate each terminal server session to the load generator. This means
a Terminal Server must be running on the load generator. Windows 2000 Server
and Advanced Server both come with Terminal Server. If you are not using one
of these OS then please contact Microsoft on how to purchase Terminal Server
separately. Please follow the instructions below:
2. From any computer that has the Terminal Services Client installed, create
at least two connections to the load generator. If the load generator has
Terminal Services Client installed, then create a connection to itself.
Then, startup the LoadRunner Agent Process in each Terminal Server
Session.
3. From the Controller, define your load generators using the following
convention:
<machine_name or IP>:1
<machine_name or IP>:2
<machine_name or IP>:3
11
4/23/2003
You need to define one load generator in the Controller for each terminal server
session that you have created. The above example is for 3 terminal server
connections to the load generator.
NOTE: Unfortunately, there is no sure way to tell how many Citrix Vusers each
terminal session can support. You may need to experiment with ramping up
Vusers on each load generator until the graphic resource is exhausted (i.e. by
looking at the terminal session you just created, the screen refresh is not optimal).
4. Test and make sure you can connect and run 1 Vuser on each load generator
before running the full load test.
12
4/23/2003
1. Go to the script’s data directory. There should be a bitmap file with the
name of the recorded hash value. For example,
ea58db927f9135863b6deccf9e38c81d.bmp
2. The execution log from the replay should indicate the new hash value
obtained on the ctrx_sync_on_bitmap if you enabled extended log with
“Advanced Trace” checked.
EXAMPLE:
vuser_init.c(15): Wait for bitmap=ea58db927f9135863b6deccf9e38c81d
the current bitmap is 7e7fec50972aba43a19dda56d19c6b4a
vuser_init.c(15): Waiting for event ...
vuser_init.c(15): Exit on timeout..
3. Look for a bitmap file with the name of this new hash value inside the
script folder. For the example above, look for
7e7fec50972aba43a19dda56d19c6b4a.bmp inside the script folder.
4. Compare the recorded bitmap with the new bitmap obtained during replay.
There should be a difference, and that is why the ctrx_sync_on_bitmap is
failing.
Q. Some of the Citrix Vusers are failing in the Controller. Is there a way to show
the Citrix client during replay?
R. If you intend to replay the script on another machine, make sure that the following
items are consistent between the record and replay machines: Window Size
(resolution), Window Colors, System Font and the other Default Options settings on
the desktop. These setting affect the hash value of bitmaps and inconsistencies may
cause replay to fail. For more information, refer to Bitmap Sync Information section.
Q. User is able to run one Citrix Vuser from the Controller without a problem.
However, running 2 or more Citrix Vusers gives an error with a “Terminal
Services Warning” for Vusers 2-x.
13
4/23/2003
R. Check and see if you can manually connect 2 users from the Citrix client to the
Citrix server. When booted into Administration mode, only 2 users can connect to
the box at the same time. When booted into Application mode, the limit is
dependent on the Terminal Server license that you have.
Q. User recorded clicking on the OK button inside the “ICA Seamless Host
Agent” window. During replay, this window may not come up and causes the
replay to fail. How to handle this in the script?
R. Put in a condition statement and use the ctrx_win_exist function to check for the
window.
EXAMPLE:
if (ctrx_win_exist("ICA Seamless Host Agent", 9) = = 0)
{
ctrx_mouse_click(206, 195, LEFT_BUTTON, 0, NULL);
}
14
4/23/2003
The color settings of the desktop where VuGen is installed, affects the Color settings (256
color, 16-bit, 24-bit, or 32-bit) recorded for bitmap sync. The colors settings in the Citrix
Client or Server does not matter.
NOTE: In LoadRunner 7.6, the Window Colors option from the recording option in
VuGen is removed in order to avoid the above confusion.
256-Colors settings
1. The bitmaps recorded into the script's data directory may not have the same color as
what is seen on recording. This will be fine, as long as the bitmap hash value stays
the same.
2. 256-color setting is that it is OS dependent. For the same region, you might get a
different hash value on Windows NT compared to Windows 2000. If you use 256-
colors setting to record a script on Windows 2000, it will run fine on terminal session.
LoadRunner does not have such problem with 16-bit color setting or higher.
Windows Terminal
A Terminal Client session uses 256-color setting and this cannot be changed. For such, if
you intend to use Terminal sessions during load test, make sure that the following is true:
• Record in 256-color setting
• Record from a Windows 2000 box
If there is a window name listed for the last argument then the x/y coordinates
(first and second arguments) are relative to this window.
2. ctrx_sync_on_bitmap()
The encrypted code depends on the position/size/resolution/colors and the
contents of the bitmap. The value is supposed to be constant as long as you do not
change any of the mentioned factors.
3. ctrx_set_window()
Sometimes, LoadRunner will record ctrx_set_window() (e.g.
ctrx_set_window("0_37_348_265"); ) for opening of menu list, e.g. File -> Exit
where the menu list box is interpreted as a window. This happens because
LoadRunner always make sure that the menu is already open and ready before
selecting an item. The name in this case depends on the menu position.
4. ctrx_key()
SHIFT_KEY SCROLL_LOCK_KEY
CTRL_KEY
ALT_KEY F1_KEY
BACKSPACE_KEY F2_KEY
TAB_KEY F3_KEY
ENTER_KEY F4_KEY
PAUSE_KE F5_KEY
ESC_KEY F6_KEY
CAPS_LOCK_KEY F7_KEY
PAGE_UP_KEY F8_KEY
PAGE_DOWN_KEY F9_KEY
END_KEY F10_KEY
HOME_KEY F11_KEY
LEFT_ARROW_KEY F12_KEY
UP_ARROW_KEY
RIGHT_ARROW_KEY MULTIPLY_KEY
DOWN_ARROW_KEY ADD_KEY
NUM_LOCK_KEY SUBTRACT_KEY
PRINT_SCREEN_KEY DIVIDE_KEY
INSERT_KEY
DELETE_KEY
Common Practice
16
4/23/2003
1. Reset the connection if a user disconnects from the Citrix session without logging
off. If the server is not configured this way, then there will be a lot of remaining
idle sessions on the server during load test. Below are instructions on how to
configure the server to reset the session (this is taken from the latest Citrix
document):
2. See the “Tips for Working with Citrix Vuser Scripts” section in the Citrix
documentation for recording, replay, and debugging tips.
3. Replay your script with ‘Replay think time as recorded’. This will help to ensure
that the script replay will wait for x amount of time for the windows to come up
before executing the next step.
2. When monitoring a counter under the ICA Session object, please be sure that at
least one session is currently connected to the server. Otherwise, you will not be
able to add any counters.
3. If you are unable to monitor the ICA Session object, try mapping a drive from the
Controller to the Citrix box through Windows explorer first.
Additional information
1. Public webinar replay with Citrix discussing the problems, challenges, solutions and
timeframes for LoadRunner for Citrix.
17