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 to 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 script to change type of text match is to be performed on the window caption. The default is WindowCaptionMatchType.Contains if this parameter is omitted. The WindowCaptionMatchType allows you to set four ways of performing the caption match; Equals, Contains, StartsWith & EndsWith.
If the event is does not occur before the timeout period expires, a Timeout Exception (Facilita.Exception.TimeoutException is raised that causes the script to exit. This will need to be caught if the virtual user is to continue.
Example:
try
{
WaitForEvent(CitrixEventType.WindowCreate, @"Save As");
}
catch (Facilita.Exception.TimeoutException)
{
Warn("Save As Dialog timed out");
NextIteration(); // optionally call the next iteration
}