My first post ever... I'm excited
I am writting a script which extract data from an e-mail and searches for one of my customers. Once the name appears, the mouse moves over the name and clicks to go to the customer info page. the process of locating a customer varies from 2 seconds to about 60 seconds, depending on how our server is going on the day. Sometimes the info in the e-mail is incorrect and there is no customer.
this is what i have so far:
Code: Select all
Let>WSI_TIMEOUT=60
WaitScreenImage>%HomePath%Arrow.bmp,5
if>WSI_TIMEDOUT=TRUE
Let>ErrMsg=Error message 1
GoTo>ExitRoutine
EndIf
FindImagePos>%HomePath%Arrow.bmp,SCREEN,5,1,X,Y,NumFound
If>NumFound=0
Let>ErrMsg= Error message 2
GoTo>ExitRoutine
EndIf
// Wait for Customer window to display and populate
SetFocus>%CustomerInfo%
GetActiveWindow>%CustomerInfo%,XX,YY
Add>XX,275
Add>YY,193
MouseMove>XX,YY
LClick
// Wait for up to 20 seconds for Information screen to display
Let>WSI_TIMEOUT=20
WaitScreenImage>%HomePath%customer_info_loaded.bmp,5
//Look for the customer found button and click it
FindImagePos>%HomePath%customer_found.bmp,SCREEN,5,1,X,Y,NumFound
If>NumFound=0
Let>ErrMsg= Error message 3
GoTo>BailOut
EndIf
//Rest of script
However, when i run it. I get Error message 2, after less than 60 seconds which means it is finding Arrow.bmp (which i can assure you is not on the screen anywhere - or anythign remotely similar)
I then attempted to change WSI_TIMEOUT from 60 to 5:
Error message 1 appears
If i leave WSI_TIMEOUT at 10 but change WaitScreenImage>%HomePath%Arrow.bmp,5 to WaitScreenImage>%HomePath%Arrow.bmp,2
Error 1 appears.
If i leave WaitScreenImage>%HomePath%Arrow.bmp,2 and change WSI_TIMEOUT to 15
Error message 2 appears
Please help me, why is does changing how long my script waits for a particular image to display affecting it finding the image or not.
Thank you very much in advance guys, this forum rocks!
It has solved all my other problems