UVK scripting commands - UVK window automation |
The UVK window automation consists of 11 functions which alow you to automate applications from a UVK script.
These functions must be used in the <Run> mode, but you can automate already running applications. They can be easily inserted from the Log analyzer's Automation tab, of from the Control info tool.
Basically, to automate an application, you insert the <Run> keyword, then optionally the command that runs the application you're going to automate. Then you call ->WaitWindow() to add the application's window to the managed windows list.
Let's start with a quick example. You can find more complete examples in the script collection. This one just runs notepad.exe and sends some text to its text box.
<Run>
notepad.exe
->WaitWindow(20)
->WaitControl(Edit1)
->ControlSend(Edit1,This is my first
automation script.)
In the example above, we start by inserting the <Run> keyword, and running the notepad.exe command.
Then we call ->WaitWindow(20), which waits up to 20 seconds for a new window belonging to the notepad process we just created, and adds the new window to the managed windows list.
Then we call ->WaitControl(Edit1), which waits for the notepad's text box to be visible and enabled.
And finally we call ->ControlSend() to send some text to the control.
Again, this is just an introduction script, you can find more complex scripts in the script collection.
Back to the list