rraghvani
it's work for me this post, certainly this snippet:
function VerifyRecognizedText()
{
var textToCheck = "*About*Notepad*";
var p = Sys.WaitProcess("notepad", 3000);
if (p.Exists)
{
// Get the Notepad window
var wndNotepad = p.WaitWindow("Notepad", "*", 1, 3000);
if (wndNotepad.Exists)
{
wndNotepad.MainMenu.Click("Help|About Notepad");
// Get the About Notepad window
var wndAbout = p.WaitWindow("#32770", "About Notepad", 1, 3000);
if (wndAbout.Exists)
{
// Recognize the text that the About Notepad window contains
var recognizedText = OCR.Recognize(wndAbout);
// Verify that the recognized text matches the specified string
recognizedText.CheckText(textToCheck);
}
}
}
else
{
Log.Warning("Notepad is not running.");
}
}
my function for OCR checkpoint which posts or throws warning after failure is:
function OcrCheckpointThrowsWarning() {
let searchAreaObject = Aliases.LMS.CoBorrowersDialog;
let textToCheck = "*client*";
let ApplicationProcess = Sys.WaitProcess("LMS", 300);
if (ApplicationProcess.Exists)
{
let recognizedText = OCR.Recognize(searchAreaObject);
recognizedText.CheckText(textToCheck);
Log.Message("ToolTip: client! - found");
}
else
{
Log.Warning("ToolTip: client! - not found");
}
}