Citrix Synchronization functions (for instance,"CitrixWaitFor****") sometimes return errors at TryScript or during a load test, a typical error being:

CitrixWaitForWindowCreation(CitrixEngine: 32 - GetWindowSizefailed, Could not find the specified window)

The three most common causes of these Windows Synchronization errors are addressed below, together with suggested solutions.

Step 1: look for BDL scripting errors:
Firstly, ensure that it is not caused by a BDL scripting error. You can verify this after TryScript by checking that the problematic Citrix Windows Function was not modified after it had been recorded.  This is best confirmed by comparing the current Citrix bdf script to the original record.bdf script and investigating any differences. You should also ensure that no changes have been made to the height, width or the position of the actual Window on the Citrix Server.

Step 2: examine why sporadic Tool Tips and Dialog Boxesappear, and determine whether or not they are essential to theworkings of the application:
Determine whether the window which cannot be found during replay is actually required for subsequent user interactions/workflow of the application. For example, it is common for some Windows applications to sporadically launch tool tips or other dialog boxes/messages during execution... such windows will be recorded by SilkPerformer. Consequently, SilkPerformer will assume that the window is required for successful operation and will script a Citrix Windows Synchronization function to check for its presence.  SilkPerformer"s Citrix Recorder cannot determine which windows are important for the application workflow and which are not, and so it lies with the load tester to determine whether or not they are required. If the load tester has verified that a specific window is not required, (for example, the user may not need to click this window to launch a subsequent window for data input) then the easiest solution is to simply remove the relevant "CitrixWaitFor****" function, or group of functions, associated with the Window from the .bdf script and run a fresh TryScript.

Step 3: performing analysis when Windows Applications behave differently under load:
The final issue occurs in those scenarios where a user performs a click-action on a specific window of an application and then waits for the subsequent window to appear (for example, a dropdown menu). Here, the generation of the subsequent Window is clearly necessary for the workflow to continue, but an application underload may simply ignore the click-action (as Windows GUIs often do not respond immediately to click-actions when under load).  In this case, the first troubleshooting step should be to decide if the Windows Synchronization has returned an error which you see as important. For example, you could decide that the average user will not worry if the Window is not generated immediately and, after realizing that a window (e.g. a dropdown menu) does not appear, they will simply repeat their last action until it is generated. If you have decided that such behavior is occurring, you must implement the same behavior in the script. To do this, you can create logic in the script which will wait a small period of time for the window to be created (by modifying the "nTimeout"and "bNoError" parameters of the"CitrixWaitFor...." function), then redo the last user action if the window does not appear (CitrixWaitForWindow returnsfalse) and wait again. This behavior could be reiterated in a loop to simulate a patient virtual user which is waiting on the Windows GUI application to eventually return the associated dropdown window. However it is essential that the final iteration of the CitrixWaitForWindow does not contain the modified parameters (nTimeout and the bNoError)... that is, so that the SilkPerformer Citrix Replay Engine will eventually be able to throw an error if the window does not appear on the last attempt (and not become caught in an endless loop).

Example Code demonstrating a patient user:

hWnd11 := CitrixWaitForWindowCreation("File",MATCH_Exact, 0x96000000, 25, 40, 152, 322, true, 1, true);

if hWnd11 < 0 then
CitrixMouseClick(39, 42, hWnd10,MOUSE_ButtonLeft);
hWnd11 :=CitrixWaitForWindowCreation("File", MATCH_Exact,0x96000000, 25, 40, 152, 322);
CitrixMouseClick(65, 291, hWnd11,MOUSE_ButtonLeft); print(string(hWnd11));