test.ocrTextPresent how to use Regular Expressions
-
I have image with more text. Part of text looks like "Hello(word), today(all) and other text". I want to search "Hello(word)" with regexp "Hello*".
I usetest.ocrTextPresent('Hello(word)', {1000, message}, window)
and Squish returned boolean True
if I senttest.ocrTextPresent('Hello*', {3000, message}, window)
Squish returned boolean False, it means that could not found word in text.
How can to set regexp for this method?
Description:
https://doc.qt.io/squish/squish-api.html#test-ocrtextpresent-function -
@Danil-Sh-rf said in test.ocrTextPresent how to use Regular Expressions:
Squish returned boolean False, it means that could not found word in text.
How can to set regexp for this method?
Description:
https://doc.qt.io/squish/squish-api.html#test-ocrtextpresent-functionHi,
This function is for verifying a single, hardcoded piece of text.
You can implement this yourself by having it fetch all text (ideally from the smallest area/region/scope possible, for example just a single window, instead of all windows/the complete desktop), and then perform any kind of search you desired in the string returned by the OCR functionality.
Best regards,
Clemens Anhuth -