I was wondering how SearchRectangle works in EggPlant to detect text. I am talking in regard to TIG not OCR.

So when I set the SearchRectangle to a certain size at a certain location, I was able to find certain text. However, when I slightly changed (5 to 10 increment values added in) the size and location of the search rectangle, the text cannot be found. In both cases, the image inside the search rectangle was given ample of spacing around it. Why is this the case?

This would only be the case if you’re not really using the TIG. The OCR is quite sensitve to the search rectangle, but the TIG is just doing a standard image search, so unless your rectangle does not cover the whole image, there should be no difference at all. I’d need to see the code you’re using and what your settings are in the Text preferences to know for sure, but it sounds like you’re really using the OCR.

Thanks for the reply. I am not very familiar with TIG and OCR. Let say I give EggPlant a text to match on the SUT, does EggPlant do TIG or OCR to find the given text?

Since v11, the default has been to perform an OCR search.

For TIG searches, if you are running against a Windows SUT, you need to have a TIG executable running on it. If you’re testing Windows and you’ve never downloaded and installed the TIG executable, then you’re doing OCR searches. You should review this page on improving the results of OCR.

How does the SearchRectangle works in relation to the OCR?

It works the same way it does with an image search; it restricts the area that is searched for the text. As I mentioned, the OCR is sensitive to the search rectangle and depending on the text you are looking for, changing it only slightly can change whether the text is found or not. There is no rubric for this – it’s a case by case thing.

Could you please further elaborate.

  1. What you mean by the OCR being sensitive to the search rectangle?
  2. What are the criteria for making it sensitive?

I know one is that the region of searching cannot be too close to the text being search.


No, I can’t really elaborate. Sometimes changing the search rectangle by a pixel or two is the difference between reading and not reading text. There are no criteria, you just have to experiment with your particular screens. There are too many variables to define any rules.