Writing Application Tests

Author:
Bradlee Speice <bspeice@uncc.edu>
Date:
7/11/2012

Audience

Purpose

Using Libcvautomation

Application Testing

Now we get into the good stuff. The basic process for application testing is as follows:

Creating the Screenshot Sequence

Create a Testing Wrapper

Testing the Testing Wrapper

Wrapping Up

Appendix of Wrapper Functions

 click 
Click the mouse where it is currently located

 click_xy <x-coordinate> <y-coordinate> 
Click the mouse on an absolute point on screen
Note:
The actual process is to move the mouse to the given location, then click there.

 clickr_xy <x-increment> <y-increment> 
Click the mouse on the screen relative to where the mouse is at
Note:
The actual process is to move the mouse the given distance, then click there.

Also, note that a positive x-increment moves the mouse to the right, and a positive y-increment moves the mouse down.

 click_i <filename> 
Click the mouse on a screenshot from filename
Note:
This is affected by the CENTER, TOLERANCE, and SEARCH_METHOD variables. See Testing the Testing Wrapper for more information on these.

 image_location <filename> 
Get the location of an image on screen
Note:
This is affected by the CENTER, TOLERANCE, and SEARCH_METHOD variables. See Testing the Testing Wrapper for more information on these.

 hover_xy <x-coordinate> <y-increment> 
Move the mouse to a location on screen using absolute positioning

 hoverr_xy <x-increment> <y-increment> 
Move the mouse to a location on screen using relative positioning
Note:
Note that a positive x-increment moves the mouse to the right, and a positive y-increment moves the mouse down.

 hover_i <filename> 
Move the mouse to a location on screen based on screenshot
Note:
This is affected by the CENTER, TOLERANCE, and SEARCH_METHOD variables. See Testing the Testing Wrapper for more information on these.

 key_str "<string>" 
Enter a string of characters on the keyboard rather than a single character at a time.
Warning:
This function does not accept key strings like "Space" as key_down, key_up, and key_click do. If you pass in "Space", that is exactly what will be typed.

 key_down "<key-name>" 
Press a key down and leave it down
Note:
This function accepts special keys like "Space" - see XTest Key Strings for a full list of characters allowed.

 key_up "<key-name>" 
Release a key
Note:
This function accepts special keys like "Space" - see XTest Key Strings for a full list of characters allowed.

 key_click "<key-name>" 
Press a key down and then release it immediately after
Note:
This function accepts special keys like "Space" - see XTest Key Strings for a full list of characters allowed.

 run_process "<process-name>" 
Start a process on the system, background it, and return the PID of the created process.

 is_running "<process-name>" 
 is_running "<process-id>" 
Check if a program name or PID is currently running
Generated on Tue Jul 17 12:19:00 2012 for libcvautomation by  doxygen 1.4.7