Waiting for OCR checkpoint to appear as screen loads
I'm using a OCR checkpoint to wait for a Citrix application and display a login prompt. When the window appears there's a brief loading screen that displays before the login prompt that I'm using the checkpoint to validate. The OCR checkpoint ends up detecting the loading screen and then failing because it's not the login prompt.
Is there a way to set up a delay/wait for the login prompt to appear despite what TestComplete first detects from the object window? It would need to actually wait the specified timeout for the text to appear instead of failing at what it first detects.
Thanks in advance
AlexKaras Discovered the reason for the "Invalid Text" error. When selecting the parameters in the Keyword test area, for setting the parameter I was using a String type instead of Object type. The solution from the support site actually works really well for me. The only issue with it is that it's a infinite loop, so I modified the sample code and used a for loop instead to emulate a 10 second timeout (I could also pass another parameter for the seconds)
function CheckTextContents(textToSearch) { // Recognize the text contents of the specified onscreen object (Citrix window) var text = OCR.Recognize(Aliases.wfica32.wndTransparentWindowsClient).FullText; // Search for the occurrence of the specified substring in the recognized text return (aqString.Find(text, textToSearch, 0, false) > -1) } function WaitForText(textToWait) { for (x = 0; x < 10; x++) { if (! CheckTextContents(textToWait)) Delay(1000); else break; } }