|Example||Citrix Synchronization Functions|
The function checks if the expected text is found in the rectangle specified by the coordinates, using optical character recognition (OCR).
Important: OCR might consume a substantial amount of the hardware resources for the load generator machine, causing high CPU consumption warnings and/or limiting the amount of Vusers that can run in parallel.
int ctrx_sync_on_text_ocr( long xpos, long ypos, long width, long height, const char *value, const char *filename, char* WaitFor, [CONTINUE_ON_ERROR,] CTRX_LAST );
|xpos||The horizontal distance in pixels from the left border of the ICA client window.|
|ypos||The vertical distance in pixels from the upper border of the ICA client window.|
|width||Of rectangle in pixels.|
|height||Of rectangle in pixels.|
|value||The text to for which to wait.|
|filename||The snapshot file. Do not edit this value.|
(Optional) The event to occur on one of the specified areas and images.
Possible values are:
|CONTINUE_ON_ERROR||A constant, entered as shown without quotes. Overrides the error behavior runtime setting for this step so that script behaves as though the runtime setting was Continue on error.|
|CTRX_LAST||A marker that indicates the end of the argument list.|
ctrx_sync_on_text_ocr is a synchronization function that checks if a specified string (identified with OCR) is found in a specified rectangle, before continuing.
This function is useful for applications that do not use Windows GDI API to render text. For example, Internet Explorer uses DirectWrite API for text rendering.
The xpos, ypos are relative to the ICA client .
OCR should not be used for text that is small.
Known issue: The OCR engine removes the spaces from the recognized text.
No parameterization is available for this function.
In this example, ctrx_sync_on_text_ocr causes script execution to pause until text "test" appears at the specified location in Notepad window.
ctrx_sync_on_text_ocr(304, 119, 30, 15, "test", "snapshot_109", "Appear", CTRX_LAST); ctrx_obj_mouse_click("<class=Notepad>", 310, 125, LEFT_BUTTON, 0, "Untitled - Notepad=snapshot_110", CTRX_LAST);