View Single Post
  #1  
Old 05-20-2016, 02:44 PM
ShawnVW ShawnVW is offline
Registered User
 
Join Date: May 2016
Posts: 15
WaitForString doesn't always work

I'm using WaitForString to detect a pop-up box on my screen. (Just to be clear: it's not a Windows dialog box, but part of the application I'm accessing through SecureCRT).

There are cases in which WaitForString simply does not detect these boxes. Here's an example:

Code:
    if .WaitForString ("COUNTRY CHANGE EXPLAINATION", 2) then
        .send "SAP - change 'USA' to 'US'"  & chr(13) & chr(13)
	[more code]
     else
	msgbox ("No Country Change found")
    end if
This snippet was working for a while -- it went to the IF clause when the box opened, but right now it is going to the ELSE clause.

(Yes, I know "Explanation" is misspelled; that how it is on screen. I copied and pasted it into my code.)

In some cases I can use Get() instead, but its not always easier.

Are there some rules or tricks about using WaitForString that I should know about? For instance, I've had trouble trying to detecting a string that was part of a line, instead of the whole line. If a caption said "ENTER NAME AND ADDRESS", then
Code:
 WaitForString("ENTER NAME AND ADDRESS")
would work more often than
Code:
WaitForString("ADDRESS")
Reply With Quote