Citrix - Automatic Synchronization
During recording, VuGen automatically generates steps that help synchronize the Vuser's replay of the script.
Sync on Window
The Sync on Window step instructs the Vuser to wait for a specific event before resuming replay. The available events are Create and Active. The Create event waits until the window is created. The Active event waits until the window is created and then activated (in focus). Usually VuGen generates a function with a Create event. If, however, the next instruction is a keyboard event, VuGen generates a function with an Active event.
In the Editor, the corresponding function call to the Sync on Window step is ctrx_sync_on_window.
Sync on Obj Info
The Sync on Obj Info step instructs the Vuser to wait for a specific object property before resuming replay. The available attributes are Enabled, Visible, Focused, Text, Checked, Lines, or Item. The Enabled, Visible, Focused, and Checked attributes are boolean values that can receive the values true or false. The other attributes require a textual or numerical object value.
A primary objective of this step is to wait for an object to be in focus before performing an action upon it.
VuGen automatically generates sync_on_obj_info steps when the Citrix agent is installed and the Use Citrix Agent Input in Code Generation option is enabled in the Recording Options. By default, this Recording option is enabled. For more information, see Citrix > Code Generation Recording Options.
ctrx_sync_on_obj_info("Run=snapshot9", 120, 144, TEXT, "OK",
Sync on Text
A text synchronization step, Sync on Text, instructs the Vuser to wait for a text string to appear at the specified position before continuing. When replaying Sync on Text, the Vuser searches for the text in the rectangle whose modifiable coordinates are specified in the step's properties.
- The maximum allowable length of a text string is 255 characters.
- The Citrix agent does not support this function on Windows 10, Windows Server 2016, or later versions of Windows.
By default, automatic text synchronization is disabled. However, with the Citrix Agent installed (see Agent for Citrix Presentation Server - Overview), you can instruct VuGen to automatically generate a text synchronization step before each mouse click or double-click. After this option is enabled, it applies both to newly recorded scripts and also to existing scripts if you choose the Record > Regenerate Script option. For more information, see Citrix > Code Generation Recording Options.
In the Editor, the corresponding function call to the Sync on Text step is ctrx_sync_on_text_ex.
The following segment shows a ctrx_sync_on_text_ex function that was recorded during a Citrix recording with the Citrix Agent installed and text synchronization enabled.
ctrx_sync_on_window ("ICA Seamless Host Agent", ACTIVATE, 0, 0,391,224, "snapshot1", CTRX_LAST); ctrx_sync_on_text_ex (196, 198, 44, 14, "OK", "ICA Seamless Host Agent=snapshot2", CTRX_LAST); ctrx_obj_mouse_click ("<class=Button text=OK>", 196, 198, LEFT_BUTTON, 0, "ICA Seamless Host Agent=snapshot2", CTRX_LAST);
For more information on this function, see the Function Reference.
See Citrix - Additional Ways to Synchronize Your Script for additional information.