libcvautomation
2.0
|
SEARCH_METHOD
This controls how each of the functions searches for an image. See Libcv Search Methods for more instruction on how to use this option.
TOLERANCE USE_SANE_TOLERANCE
These control how tolerant each function is when searching for an image. Acceptable values are anywhere between INT_MIN
to INT_MAX
. See Libcv Search Methods for more information on how the tolerance values work. Additionally, the cva-input and cva-match programs (which this wrapper depends on) implement a "sane-tolerance" option. This allows you to set a tolerance between 1 - 100, where: \( 1 \approx 0 \), and \( 100 \approx INT\_MAX \) By default, functions will not use sane tolerance. To make the functions search using sane tolerance, set
USE_SANE_TOLERANCE="yes"
USE_CENTER
This controls whether each function will return a value based on the center of the sub-image, rather than the top-left corner. By default, functions will use center-based matching. To make the functions use the top-left corner, set
USE_CENTER=""
USE_WAIT TIMEOUT
These control how the "waitfor" function is used. By default, all image-matching functions will wait for an image to appear, and then click on it. This way, it won't click randomly if it can or can't find an image, and provides very easy error recognition. The functions will wait for a period of TIMEOUT
seconds before complaining. To disable waiting before performing an action, set
USE_WAIT=""
Make sure to set the tolerance
(or just leave it as the default value in the wrapper).OUTFILE ERRFILE
These files control the reporting of libcvautomation_funcs. The wrapper generates a decent amount of output to help in debugging application tests, and by default these get redirected to /dev/null. To instead redirect them to a file, you can do something like this:
OUTFILE=`mktemp`; echo "Logfile: " $OUTFILE ERRFILE=`mktemp`; echo "Error file: " $ERR_FILE
This will redirect the output and error output to a file you own, and inform you of what that file is.
mouse_down [mouse-button]
Push the mouse button down where it is currently located, and leave it down. Optionally specify a mouse button to push down
mouse_up [mouse-button]
Release a mouse button. Optionally specify a mouse button to release (default button 1).
mouse_click [mouse-button]
Release the mouse button Optionally specify a mouse button to release
mouse_click_xy <x-coordinate> <y-coordinate> [mouse-button]
Click the mouse on an absolute point on screen Optionally specify a mouse button to click
mouse_click_rxy <x-increment> <y-increment> [mouse-button]
Click the mouse on the screen relative to where the mouse is at Optionally specify a mouse button to click
x-increment
moves the mouse to the right, and a positive y-increment
moves the mouse down. mouse_click_image <filename> [filename-2] ... [filename-n]
Click the mouse on a screenshot from filename
Optionally specify multiple files to search in.
CENTER
, TOLERANCE
, and SEARCH_METHOD
variables. See Environment Variables for more information on these. mouse_doubleclick [mouse-button]
Click the mouse twice Optionally specify a mouse button to click
mouse_doubleclick_xy [mouse-button]
Click the mouse twice on an absolute point on screen Optionally specify a mouse button to click
mouse_doubleclick_rxy [mouse-button]
Click the mouse twice on a relative point on screen Optionally specify a mouse button to click
mouse_doubleclick_image <filename> [filename-2] ... [filename-n]
Click the mouse twice on a screenshot from filename
Optionally specify multiple files to search in.
CENTER
, TOLERANCE
, and SEARCH_METHOD
variables. See Environment Variables for more information on these. mouse_hover_xy <x-coordinate> <y-increment>
Move the mouse to a location on screen using absolute positioning
mouse_hover_rxy <x-increment> <y-increment>
Move the mouse to a location on screen using relative positioning
x-increment
moves the mouse to the right, and a positive y-increment
moves the mouse down. mouse_hover_image <filename> [filename-2] ... [filename-n]
Move the mouse to a location on screen based on screenshot Optionally specify multiple files to search in.
CENTER
, TOLERANCE
, and SEARCH_METHOD
variables. See Environment Variables for more information on these. Very simple wrapper to move the mouse 1 pixel right and 1 pixel down - useful for activating menu items.
Scroll the mouse wheel up one
Scroll the mouse wheel down one
Drag one image to another - i.e. drag a file to a folder.
image_location <filename>
Get the location of an image on screen
CENTER
, TOLERANCE
, and SEARCH_METHOD
variables. See Environment Variables for more information on these. wait_for <filename>
Wait for an image to display on screen, and then return
TOLERANCE
, SEARCH_METHOD
, and TIMEOUT
variables. See Environment Variables for more information on these.key_string "<string>"
Enter a string of characters on the keyboard rather than a single character at a time.
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
key_up "<key-name>"
Release a key
key_click "<key-name>"
Press a key down and then release it immediately after
is_running "<process-name>"
is_running "<process-id>"
Check if a program name or PID is currently running
notify "<string_to_display>"
Display a notification to the user, and wait for a response
zenity
- if zenity
isn't available, will return an error without pausing, and will not display anything.