Page 1 of 1

Desktop Access and Synchronization

PostPosted: Sat Mar 28, 2009 8:23 am
by Rafe08
Just posted about dynamic index values, but I have another problem: I issue a "Focus 0" command to focus the main window -- this is for a multiple-instance playback of scripts that need desktop access. But the script fails some times...because the Focus command doesn't seem to work every time.

Any hints on this one?

TIA, guys. --Rafe08

Re: Desktop Access and Synchronization

PostPosted: Wed Apr 01, 2009 5:09 pm
by eValid
This is a question that comes up from time to time and the problem
is that you have this command "Focus wid" that interacts not only
with the eValid browser but also with the desktop.

Windows is a multi-programming, multi-tasking operating system and
actions in it, while they appear to be instantaneous to you, the user,
usually involve a lot of cooperation between many processes.

So, as a result of this when eValid processes the "Focus wid" command in
your script it may take a few microseconds or milliseconds before the
required focus actually changes the state of that window.

We have found that a good practice is to have your commands set up
like this:

...
Focus 0
Wait 100
SyncOnText "some text"...
...(take some action on the window)...
...

This forces a 0.1 second delay and also requires, as an extra
insurance policy, that eValid verify the "some text" is really
visible on the screen BEFORE you take an action.

Just safer that way.