Posted at by Samantha under: winautomation tutorials Wait

It is well known, that different machines work at different speeds, and come up with the same results after a process request, while the process result is the same.

When using WinAutomation to automate tasks, you should be able to determine how long you will allow for a process to run, before it fails.

This is where the "Wait" group of actions come in handy.

 

"Wait" Action

You can use this action when you want to delay the next action from executing, due to the fact you want to wait for something to happen. It is usually used as extra security, when waiting for something to occur on the machine we use this action to make sure we give the machine enough time to give us the desired results prior to continuing with any actions that follow.

Examples

A: You can use it when you are sending in keystrokes to select all, and copy a large amount of text (from a scrolldown-endless webpage or a Word Document that has a lot of formatting, pictures and many many pages). So once you have send the keys {Control}({A}) you add a Wait action, to wait for a couple of seconds, just to make sure that all pages have been selected, before you send in the {Control}({C}) keystrokes to send the selected text to the clipboard.

B: You can use it when you want to send in specific commands after specific amount of time. This is very handy, when parsing the web, so that the server does not realize that the webpage is being parsed by a robot and lock you out.

 

"Wait for File" Action

You can use this action, when you cannot define when a file needed by the process, will be created, in order to proceed.

Examples

A: You can use this action, when the information needed in order to proceed with the process remaining is found in an email that is delivered after a previous action has send an email. So, when the email arrives and the attachment is extracted and saved within a prespecified folder, the action recognizes it and proceeds with the rest's job's completion. That would of course mean that the email is either automatically extracted by a program (for example Thunderbird's plugin AutoExtract) or the user will manually place it within the folder the automation will be looking for within.

 

"Wait for Process" Action

You can use this action, when you need to make sure that specific conditions regarding the programs already running, apply on the machine prior to continuing the job's execution.

Examples

A: You do not want a process to run, while another instance of the same process is already up and running, so you need to wait for the process to finish and terminate.

B: You want to continue with the job's execution, once a process running has finished.

 

"Wait for Window" Action

You can use this action, when you have launched a program, or a process, and you need to make sure that the window is there, or is not there in order to proceed.

Examples

A: Once you have used the "Run Application" action to launch Word, you need to make sure that Microsoft Word has launched and that the window is in focus before you start sending in the keystrokes you want.

B: Once a process has finished, this action can be used to set the ok for another job to proceed, by confirming that the window has appeared and closed, or is not there within a prespecified amount of time the job is waiting for the window to appear.

 

"Wait for Image" Action

You can use this action, when you need to validate specific criteria on your window or screen while running a job. It is most handy when you have no other way of controlling the job's flow.

Examples

A: You need to make sure that a window has opened, and specific information are displayed within, but there's no other way to monitor the screen or window, but searching for a specific image on the screen.

 

"Wait for Mouse" Action

You can use this action to monitor the mouse's state and according to its current state and changes, allow the user to proceed running the remaining actions.

Examples

A: This action can be used when a process execution takes too long, and you are not able to tell when the machine will respond again. It's a handy action in these cases, due to the fact that you can tell the system to wait until the mouse becomes responsive again and allows the user to continue with the job's execution. That would mean that the processing has finished, and the system is ready to proceed executing the remaining actions.

Comments

Juan Orgeira

Apr 3rd, 2013 20:47

Hi, We are evaluating WinAutomation. We need to record a lot of Macros using MacroRecorder option and then play it back, and we are founding the following issue. Macros are recorded using a older version of a application software and we need to play back over a newer version. The older version register the following action: Wait for window:XX class: Centura:Form But the newer version expects this: Wait for window:XX class: Gupta:AccFrame Unfortunately, we could not avoid the class difference in the event Wait for window, so we hope you could help us with a easy way to make WinAutomation record only the caption of the window leaving the class blank. Otherwise, we will be forced to manually edit each job in order to do this manually. (We attempted to edit .WAJ files with an editor, but after this we were unable to import it back to WinAutomation. Hoping that you have a good TIP for this, Kindly regards Juan Orgeira Analist Structured Intelligence

Leave your comment

Copyright 2014 - Softomotive Ltd