The Lock/Unlock command is used to assure exclusive access to the Windows desktop and/or the Browser cache during eValid operation.
These extrinsic commands have the syntax shown below. These commands can be edited to a script using the Script Window editing commands or by using the Extrinsic Command facility within the Script Window dialog box.
The Lock command is used to lock the current eValid window in the desktop foreground to facilitate working with ModalDialogs, to provide for unique access to cache data, and to prevent other eValid's commands that require window focus from interfering with the current playback.
Any concurrently executing eValid windows that use the Lock & Unlock commands will wait until there are no windows locked (i.e. in focus) before proceeding.
The Lock [n] command accepts an optional number parameter that specifies the number of milliseconds before the lock times out. This is only effective if no Unlock command is given or if the Unlock command is not reached before the timeout.
Note that if no overtime parameter is included with the Lock command the overtime default is pre-set to 60000 msecs.
The Lock & Unlock commands are essential for scripts that involve ModalDialog commands, or for scripts which require focus to be maintained on a particular window. The block of eValid playback script commands that need to have exclusive focus locked should be wrapped in a Lock ... Unlock block, for example:
... Commands... Lock SubmitClick [params] ModalDialogWait 4000 ModalDialogEnter ... Unlock OtherCommands... ...
Lock & Unlock can be used at other times to ensure that the script runs in the foreground and all other eValid processes will wail until no other eValid windows are locked before continuing script playback.
Technical & Performance Notes
Note 1: AbsMouse and Keyboard events implicitly lock the playback process for the duration of the command. However, use of Lock/Unlock will enhance the reliability.
Note 2: SyncOnScreenRect locks the playback process before each attempt to validate the screen, and release it after each attempt. It will NOT lock the process for the whole time it is attempting to validate. It will also be released when the validation has succeeded or has timed out. This allows multiple validations in different scripts to work concurrently.
Note 3: A lock that has been set in the current script will be unlocked (cleared) if the user issues a STOP or CLOSE. A set lock also will be cleared at the end of a playback if it was not cleared by the script itself (but it is never recommended practice to rely on this feature). A MESSAGE will be written to the logfile when eValid has to release the lock automatically after script playback.
Note 4: If for any reason a lock has been set it will be cleared when restarting eValid. This feature checks for the number of eValid instances active and clears a set lock only in case playback begins when there is only one instance of eValid present. This feature makes sure that even if multiple eValids result in hard failures the machine will not be locked up permanently.
Note 5: These commands control an internal "logical lock" whose current value is stored in the registry and is not directly accessible to the evalid user.