Skip to main content

Optical Character Recognition (OCR)

When a Citrix virtual user (VU) is running during a test, you can use optical character recognition (OCR) to either find the location of some specified text on the screen, or to read text from a particular location on the screen. The Eggplant Performance OCR engine uses the same algorithm as Eggplant Functional for OCR.


Because OCR is a complex task, you must install an additional component alongside the injector software: the Eggplant Performance OCR engine. This component requires an extra gigabyte of disk space, so you should only install it if you are using OCR functionality.

The methods FindText() and WaitForText() (available in both CitrixVirtualUser and CitrixVirtualUserScript classes) both look for a specific piece of text on the screen, and return a Rectangle of the text's location if it was found. ReadText() looks in a specified location on the screen, and returns a string containing whatever text was found there.

The OCR engine can consume a large amount of memory, so it is a good idea to stop the OCR engine if it is no longer required. To do so, call StopOCREngine() after any of the above methods have been called.