Synchronize on a Citrix Event
Citrix Event Validation
Validating a particular Citrix event provides a method of synchronizing the VU on playback. The recorder intercepts Citrix events sent by the server, which updates the client screen following a particular user action.
Following a user action, enter capture mode and click the Record event button on the toolbar. This will list all Citrix events captured by the recorder up to that point. Events are added to the bottom of the list.
The screen shot below shows the Citrix event list displayed by the Record Event dialog. Here the user has selected a WindowCreate
event for the Save As window in the foreground. Synchronizing on the creation of the Save As window would ensure the dialog had been launched before performing actions on the dialog.
Recording of any event during the recording will add a WaitForEvent
call in the generated script. An example of this is shown below for the recorded WindowCreate
Citrix event in the screen shot.
WaitForEvent(CitrixEventType.WindowCreate, @"Save As");
You can edit the generated script to change the event type or the text to search for in the window caption. You can also pass an extra parameter to change the way text is matched within the window caption:
WindowCaptionMatchType.Equals
WindowCaptionMatchType.Contains
(default if the extra parameter is omitted)WindowCaptionMatchType.StartsWith
WindowCaptionMatchType.EndsWith
If the event is does not occur before the timeout period expires, a Facilita.Exception.TimeoutException
is raised that causes the script to exit. This will need to be caught if the virtual user is to continue.
try
{
WaitForEvent(CitrixEventType.WindowCreate, @"Save As");
}
catch (Facilita.Exception.TimeoutException)
{
Warn("Save As Dialog timed out");
NextIteration(); // optionally call the next iteration
}