mirror of
https://github.com/bspeice/libcvautomation
synced 2024-12-04 13:58:11 -05:00
Add the mouse scroll functions to the bash wrapper, update documentation
Minor documentation cleanup More documentation cleanup Fix an issue with accidentally copying the opencv2 includes to opencv1 Document mouse scroll functionality, continue cleanup
This commit is contained in:
parent
8bb4925efe
commit
13105e0f44
@ -190,6 +190,8 @@ Available commands:\n\
|
||||
\tmousedown:\tPush and leave down a mouse button.\n\
|
||||
\tmouseup:\tRelease a mouse button.\n\
|
||||
\tmousejiggle:\tJiggle the mouse (helps to activate some widgets).\n\
|
||||
\tmousescrollu:\tScroll the mouse wheel up.\n\
|
||||
\tmousescrolld:\tScroll the mouse wheel down.\n\
|
||||
\tkeyclick:\tClick a keyboard button.\n\
|
||||
\tkeydown:\tPush and leave down a keyboard button.\n\
|
||||
\tkeyup:\tRelease a keyboard button.\n\
|
||||
@ -257,33 +259,37 @@ void checkXTEEnabled ( Display *display )
|
||||
*
|
||||
*
|
||||
* \section commands Full Command List:
|
||||
* mouseclick: Click the mouse in-place.
|
||||
* \c mouseclick: Click the mouse in-place.
|
||||
*
|
||||
* imouseclick: Click the mouse at an image's top-left corner.
|
||||
* \c imouseclick: Click the mouse at an image's top-left corner.
|
||||
*
|
||||
* icmouseclick: Click the mouse at an image's center.
|
||||
* \c icmouseclick: Click the mouse at an image's center.
|
||||
*
|
||||
* mousexy: Move the mouse to the given coordinate.
|
||||
* \c mousexy: Move the mouse to the given coordinate.
|
||||
*
|
||||
* mouserxy: Move the mouse by the given x and y values (relative motion).
|
||||
* \c mouserxy: Move the mouse by the given x and y values (relative motion).
|
||||
*
|
||||
* mouseimage: Move the mouse to an image's top-left corner.
|
||||
* \c mouseimage: Move the mouse to an image's top-left corner.
|
||||
*
|
||||
* cmouseimage: Move the mouse to an image's center.
|
||||
* \c cmouseimage: Move the mouse to an image's center.
|
||||
*
|
||||
* mousedown: Push and leave down a mouse button.
|
||||
* \c mousedown: Push and leave down a mouse button.
|
||||
*
|
||||
* mouseup: Release a mouse button.
|
||||
* \c mouseup: Release a mouse button.
|
||||
*
|
||||
* mousejiggle: Jiggle the mouse (helps to activate some widgets).
|
||||
* \c mousejiggle: Jiggle the mouse (helps to activate some widgets).
|
||||
*
|
||||
* keyclick: Click a keyboard button.
|
||||
* \c mousescrollu: Scroll the mouse wheel up
|
||||
*
|
||||
* keydown: Push and leave down a keyboard button.
|
||||
* \c mousescrolld: Scroll the mouse wheel down
|
||||
*
|
||||
* keyup: Release a keyboard button.
|
||||
* \c keyclick: Click a keyboard button.
|
||||
*
|
||||
* keystring: Input a string of keys to X11.
|
||||
* \c keydown: Push and leave down a keyboard button.
|
||||
*
|
||||
* \c keyup: Release a keyboard button.
|
||||
*
|
||||
* \c keystring: Input a string of keys to X11.
|
||||
*
|
||||
* \section contact Contact Information:
|
||||
* Questions? Comments? Concerns? Suggestions? Send all feedback to Bradlee Speice at <bspeice@uncc.edu>
|
||||
|
@ -25,12 +25,14 @@
|
||||
|
||||
void usage ();
|
||||
|
||||
/// \cond
|
||||
struct list {
|
||||
char *fileName;
|
||||
struct list *next;
|
||||
};
|
||||
|
||||
typedef struct list basic_list;
|
||||
/// \endcond
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ Formula:
|
||||
* \param subImage The sub image (in IplImage format) to search for in \c rootImage
|
||||
* \param searchMethod The search method to use when searching for \c subImage in \c rootImage.
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in \c rootImage.
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \return The center location of the sub image in root image
|
||||
*/
|
||||
|
||||
@ -150,7 +150,7 @@ Formula:
|
||||
* \param subImage_location The location of the sub image to search for in \c rootImage
|
||||
* \param searchMethod The search method to use when searching for \c subImage in \c rootImage.
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in \c rootImage.
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \return The location of the sub image in root image
|
||||
*/
|
||||
|
||||
@ -161,7 +161,7 @@ Formula:
|
||||
* \param subImage_location The location of the sub image to search for in \c rootImage
|
||||
* \param searchMethod The search method to use when searching for \c subImage in \c rootImage.
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in \c rootImage.
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \return The center location of the sub image in root image
|
||||
*/
|
||||
|
||||
|
@ -43,7 +43,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
/* Doxygen information */
|
||||
/** \file libcvautomation-xlib.h
|
||||
* \brief The source code to access Xlib from inside libcvautomation
|
||||
* \details This source file builds in the necessary functionality to use libcv functions inside libcvautomation.
|
||||
* \details This source file builds in the necessary functionality to use xlib functions inside libcvautomation.
|
||||
* \author Bradlee Speice
|
||||
* \date 6/21/2012
|
||||
*/
|
||||
@ -71,7 +71,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage The sub image (in IplImage format) to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The location of the sub image in root X11 window
|
||||
*/
|
||||
|
||||
@ -82,7 +82,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage The sub image (in IplImage format) to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The center location of the sub image in the root X11 window
|
||||
*/
|
||||
|
||||
@ -93,7 +93,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage_location The location of the sub image to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The center location of the sub image in the root X11 window
|
||||
*/
|
||||
|
||||
@ -104,7 +104,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage_location The location of the sub image to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The center location of the sub image in the root X11 window
|
||||
*/
|
||||
|
||||
|
@ -362,7 +362,7 @@ XF86AudioRaiseVolume
|
||||
XF86KbdBrightnessDown
|
||||
XF86MonBrightnessDown
|
||||
\endcode
|
||||
\warning Please note that each key string above is first translated into a key code, and then into the actual key click. Thus, while you might intend to press "dollar", it will actually come out as "4".
|
||||
\warning Please note that each key string above is first translated into a key code, and then into the actual key click. Thus, while you might intend to press "dollar", it will actually come out as "4". If you need a <tt>'$'</tt> to come out, use the <tt>'keystring $'</tt> command to \ref xte_commandString() or <tt>'key_str $'</tt> function in the BASH wrapper - see the \ref wrapper_functions.
|
||||
*/
|
||||
|
||||
/** \page XTest_command_strings xte_commandString() Command Strings
|
||||
|
@ -72,34 +72,17 @@ typedef struct {
|
||||
* \date 7/11/2012
|
||||
* \section intro Introduction
|
||||
* Welcome to Libcvautomation!
|
||||
* Libcvautomation is a GUI automation and testing tool based on image recognition and response. This program was designed as a direct replacement for <a href="http://sikuli.org">Sikuli</a> and <a href="https://wiki.ubuntu.com/Xpresser">Xpresser</a>. I was having incredible difficulty getting either of these solutions to work - Sikuli would crash whenever I tried to take a screenshot, and Xpresser was both too new for our RHEL 5 systems, but also died, or didn't work, or something else. I really liked the way each of these programs approached GUI automation, but they simply didn't work. Additionally, I wanted to create a simple solution - it does what you want it to, and that's it.
|
||||
* Libcvautomation is a GUI automation and testing tool based on image recognition and response. This program was designed as a direct replacement for <a href="http://sikuli.org">Sikuli</a> and <a href="https://wiki.ubuntu.com/Xpresser">Xpresser</a>. I was having incredible difficulty getting either of these solutions to work - Sikuli would crash whenever I tried to take a screenshot, and Xpresser was both too new for our Prominent North American Enterprise Linux systems, but also didn't work or \c import correctly. I really liked the way each of these programs approached GUI automation, but they simply didn't work. Additionally, I wanted to create a simple solution - it does what you want it to, and that's it.
|
||||
* \section how_it_works How Libcvautomation Works
|
||||
* Libcvautomation represents two software products coming together - <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a> and the <a href="http://www.x.org/docs/Xext/xtest.pdf">XTest extension</a> to the X11 server. OpenCV is used for image recognition, and XTest is used to actually drive the X server. You can dig into \ref libcvautomation-xtest.h to get an idea of what all this library is capable of. <br>
|
||||
* Basically what happens is that for whenever you need to do image recognition, OpenCV is used to find the images, and XTest is used to generate any events needed. Libcvautomation is mostly a wrapper to integrate both of these products, but also adds some functions like matchSubImage_X11() that allow you to match an image against the X11 root window in place. This means no more <tt>'xwd | convert "<out_name>"'</tt>.
|
||||
* \section using Jump in - Using Libcvautomation
|
||||
* \section main_using Using Libcvautomation And Writing Application Tests
|
||||
* So how does one go about using libcvautomation? <br>
|
||||
* I'm so glad you asked! I've provided a few reference programs - \c cva-match and \c cva-input - that can be used to demonstrate most of libcvautomation's capabilities. I've even provided a BASH wrapper to make it incredibly easy to use BASH with libcvautomation as well (requires that cva-match and cva-input are installed). Python bindings are on their way too. <br>
|
||||
* Finally, if you want to know how to write your own application tests, please see \ref writing_app_tests for more information on that. I've provided code to give you a good idea of how they work.
|
||||
* Finally, if you want to know how to write your own application tests, please see \ref writing_app_tests for more information on that. I've provided code to give you a basic idea of how they work.
|
||||
* \section questions Questions? Comments? Concerns?
|
||||
* Please send any feedback to <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>. Pull requests can be submitted to <a href="https://github.com/DjBushido/cvautomation">my github repository</a>.*/
|
||||
|
||||
/** \page libcvautomation Libcvautomation
|
||||
* \author Bradlee Speice <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>
|
||||
* \date 7/11/2012
|
||||
* \section intro Introduction
|
||||
* Welcome to Libcvautomation!
|
||||
* Libcvautomation is a GUI automation and testing tool based on image recognition and response. This program was designed as a direct replacement for <a href="http://sikuli.org">Sikuli</a> and <a href="https://wiki.ubuntu.com/Xpresser">Xpresser</a>. I was having incredible difficulty getting either of these solutions to work - Sikuli would crash whenever I tried to take a screenshot, and Xpresser was both too new for our RHEL 5 systems, but also died, or didn't work, or something else. I really liked the way each of these programs approached GUI automation, but they simply didn't work. Additionally, I wanted to create a simple solution - it does what you want it to, and that's it.
|
||||
* \section how_it_works How Libcvautomation Works
|
||||
* Libcvautomation represents two software products coming together - <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a> and the <a href="http://www.x.org/docs/Xext/xtest.pdf">XTest extension</a> to the X11 server. OpenCV is used for image recognition, and XTest is used to actually drive the X server. You can dig into \ref libcvautomation-xtest.h to get an idea of what all this library is capable of. <br>
|
||||
* Basically what happens is that for whenever you need to do image recognition, OpenCV is used to find the images, and XTest is used to generate any events needed. Libcvautomation is mostly a wrapper to integrate both of these products, but also adds some functions like matchSubImage_X11() that allow you to match an image against the X11 root window in place. This means no more <tt>'xwd | convert "<out_name>"'</tt>.
|
||||
* \section using Using Libcvautomation
|
||||
* So how does one go about using libcvautomation? <br>
|
||||
* I'm so glad you asked! I've provided a few reference programs - \c cva-match and \c cva-input - that can be used to demonstrate most of libcvautomation's capabilities. I've even provided a BASH wrapper to make it incredibly easy to use BASH with libcvautomation as well (requires that cva-match and cva-input are installed). Python bindings are on their way too. <br>
|
||||
* Finally, if you want to know how to write your own application tests, please see \ref writing_app_tests for more information on that.
|
||||
* \section questions Questions? Comments? Concerns?
|
||||
* Please send any feedback to <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>. Pull requests can be submitted to <a href="https://github.com/DjBushido/cvautomation">my github repository</a>.
|
||||
*/
|
||||
|
||||
/** \page writing_app_tests Writing Application Tests
|
||||
* \author Bradlee Speice <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>
|
||||
* \date 7/11/2012
|
||||
@ -305,8 +288,9 @@ typedef struct {
|
||||
* </ul>
|
||||
* <li>If you have questions, comments, concerns, suggestions, or feedback in general, feel free to let me know at <a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>.
|
||||
* </ul>
|
||||
*
|
||||
* \section wrapper_functions Appendix of Wrapper Functions
|
||||
*/
|
||||
/** \page wrapper_functions Appendix of Wrapper Functions
|
||||
* \section appendix_click Click the mouse
|
||||
* \code click \endcode
|
||||
* Click the mouse where it is currently located
|
||||
* <br><br>
|
||||
@ -327,11 +311,7 @@ typedef struct {
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \code image_location <filename> \endcode
|
||||
* Get the location of an image on screen
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \section appendix_move Move the mouse
|
||||
* \code hover_xy <x-coordinate> <y-increment> \endcode
|
||||
* Move the mouse to a location on screen using absolute positioning
|
||||
* <br><br>
|
||||
@ -346,6 +326,19 @@ typedef struct {
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \code mouse_scrollu \endcode
|
||||
* Scroll the mouse wheel up one
|
||||
*
|
||||
* \code mouse_scrolld \endcode
|
||||
* Scroll the mouse wheel down one
|
||||
*
|
||||
* \section appendix_find Find an Image
|
||||
* \code image_location <filename> \endcode
|
||||
* Get the location of an image on screen
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \section appendix_keyboard Click the keyboard
|
||||
* \code key_str "<string>" \endcode
|
||||
* Enter a string of characters on the keyboard rather than a single character at a time.
|
||||
* \warning This function <b>does not</b> accept key strings like "Space" as \c key_down, \c key_up, and \c key_click do. If you pass in "Space", that is exactly what will be typed.
|
||||
@ -366,6 +359,7 @@ typedef struct {
|
||||
* \note This function accepts special keys like "Space" - see \ref XTest_key_strings for a full list of characters allowed.
|
||||
* <br><br>
|
||||
*
|
||||
* \section appendix_utilities Useful extras
|
||||
* \code run_process "<process-name>" \endcode
|
||||
* Start a process on the system, background it, and return the PID of the created process.
|
||||
* <br><br>
|
||||
@ -373,6 +367,10 @@ typedef struct {
|
||||
* \code is_running "<process-name>" \endcode
|
||||
* \code is_running "<process-id>" \endcode
|
||||
* Check if a program name or PID is currently running
|
||||
*
|
||||
* \code notify "<string_to_display>" \endcode
|
||||
* Display a notification to the user, and wait for a response
|
||||
* \warning Uses \c zenity - if \c zenity isn't available, will return an error without pausing, and will not display anything.
|
||||
*/
|
||||
|
||||
/** \def LIBCVAUTOMATION_VERSION
|
||||
@ -391,7 +389,7 @@ typedef struct {
|
||||
* \param resultPoint Holder for a result - for example, storing where this sub image was located in its root image
|
||||
* \param searchMethod The search method to use when searching for this sub image in a root image
|
||||
* \param tolerance The tolerance to use when searching for this sub image in a root image
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
*/
|
||||
|
||||
/** \struct cvaPoint
|
||||
|
@ -139,7 +139,7 @@ Formula:
|
||||
* \param subImage The sub image (in IplImage format) to search for in \c rootImage
|
||||
* \param searchMethod The search method to use when searching for \c subImage in \c rootImage.
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in \c rootImage.
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \return The center location of the sub image in root image
|
||||
*/
|
||||
|
||||
@ -150,7 +150,7 @@ Formula:
|
||||
* \param subImage_location The location of the sub image to search for in \c rootImage
|
||||
* \param searchMethod The search method to use when searching for \c subImage in \c rootImage.
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in \c rootImage.
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \return The location of the sub image in root image
|
||||
*/
|
||||
|
||||
@ -161,7 +161,7 @@ Formula:
|
||||
* \param subImage_location The location of the sub image to search for in \c rootImage
|
||||
* \param searchMethod The search method to use when searching for \c subImage in \c rootImage.
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in \c rootImage.
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \return The center location of the sub image in root image
|
||||
*/
|
||||
|
||||
|
@ -43,7 +43,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
/* Doxygen information */
|
||||
/** \file libcvautomation-xlib.h
|
||||
* \brief The source code to access Xlib from inside libcvautomation
|
||||
* \details This source file builds in the necessary functionality to use libcv functions inside libcvautomation.
|
||||
* \details This source file builds in the necessary functionality to use xlib functions inside libcvautomation.
|
||||
* \author Bradlee Speice
|
||||
* \date 6/21/2012
|
||||
*/
|
||||
@ -71,7 +71,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage The sub image (in IplImage format) to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The location of the sub image in root X11 window
|
||||
*/
|
||||
|
||||
@ -82,7 +82,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage The sub image (in IplImage format) to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The center location of the sub image in the root X11 window
|
||||
*/
|
||||
|
||||
@ -93,7 +93,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage_location The location of the sub image to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The center location of the sub image in the root X11 window
|
||||
*/
|
||||
|
||||
@ -104,7 +104,7 @@ CvPoint matchSubImage_X11_location_center( Display *displayLocation, const char
|
||||
* \param subImage_location The location of the sub image to search for in the root X11 window
|
||||
* \param searchMethod The search method to use when searching for \c subImage in the root X11 window
|
||||
* \param tolerance The tolerance to use when searching for \c subImage in the root X11 window
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
* \returns The center location of the sub image in the root X11 window
|
||||
*/
|
||||
|
||||
|
@ -362,7 +362,7 @@ XF86AudioRaiseVolume
|
||||
XF86KbdBrightnessDown
|
||||
XF86MonBrightnessDown
|
||||
\endcode
|
||||
\warning Please note that each key string above is first translated into a key code, and then into the actual key click. Thus, while you might intend to press "dollar", it will actually come out as "4".
|
||||
\warning Please note that each key string above is first translated into a key code, and then into the actual key click. Thus, while you might intend to press "dollar", it will actually come out as "4". If you need a <tt>'$'</tt> to come out, use the <tt>'keystring $'</tt> command to \ref xte_commandString() or <tt>'key_str $'</tt> function in the BASH wrapper - see the \ref wrapper_functions.
|
||||
*/
|
||||
|
||||
/** \page XTest_command_strings xte_commandString() Command Strings
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <opencv2/highgui/highgui_c.h>
|
||||
#include <opencv2/imgproc/imgproc_c.h>
|
||||
|
||||
|
||||
/* X11 includes */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
@ -74,34 +75,17 @@ typedef struct {
|
||||
* \date 7/11/2012
|
||||
* \section intro Introduction
|
||||
* Welcome to Libcvautomation!
|
||||
* Libcvautomation is a GUI automation and testing tool based on image recognition and response. This program was designed as a direct replacement for <a href="http://sikuli.org">Sikuli</a> and <a href="https://wiki.ubuntu.com/Xpresser">Xpresser</a>. I was having incredible difficulty getting either of these solutions to work - Sikuli would crash whenever I tried to take a screenshot, and Xpresser was both too new for our RHEL 5 systems, but also died, or didn't work, or something else. I really liked the way each of these programs approached GUI automation, but they simply didn't work. Additionally, I wanted to create a simple solution - it does what you want it to, and that's it.
|
||||
* Libcvautomation is a GUI automation and testing tool based on image recognition and response. This program was designed as a direct replacement for <a href="http://sikuli.org">Sikuli</a> and <a href="https://wiki.ubuntu.com/Xpresser">Xpresser</a>. I was having incredible difficulty getting either of these solutions to work - Sikuli would crash whenever I tried to take a screenshot, and Xpresser was both too new for our Prominent North American Enterprise Linux systems, but also didn't work or \c import correctly. I really liked the way each of these programs approached GUI automation, but they simply didn't work. Additionally, I wanted to create a simple solution - it does what you want it to, and that's it.
|
||||
* \section how_it_works How Libcvautomation Works
|
||||
* Libcvautomation represents two software products coming together - <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a> and the <a href="http://www.x.org/docs/Xext/xtest.pdf">XTest extension</a> to the X11 server. OpenCV is used for image recognition, and XTest is used to actually drive the X server. You can dig into \ref libcvautomation-xtest.h to get an idea of what all this library is capable of. <br>
|
||||
* Basically what happens is that for whenever you need to do image recognition, OpenCV is used to find the images, and XTest is used to generate any events needed. Libcvautomation is mostly a wrapper to integrate both of these products, but also adds some functions like matchSubImage_X11() that allow you to match an image against the X11 root window in place. This means no more <tt>'xwd | convert "<out_name>"'</tt>.
|
||||
* \section using Jump in - Using Libcvautomation
|
||||
* \section main_using Using Libcvautomation And Writing Application Tests
|
||||
* So how does one go about using libcvautomation? <br>
|
||||
* I'm so glad you asked! I've provided a few reference programs - \c cva-match and \c cva-input - that can be used to demonstrate most of libcvautomation's capabilities. I've even provided a BASH wrapper to make it incredibly easy to use BASH with libcvautomation as well (requires that cva-match and cva-input are installed). Python bindings are on their way too. <br>
|
||||
* Finally, if you want to know how to write your own application tests, please see \ref writing_app_tests for more information on that. I've provided code to give you a good idea of how they work.
|
||||
* Finally, if you want to know how to write your own application tests, please see \ref writing_app_tests for more information on that. I've provided code to give you a basic idea of how they work.
|
||||
* \section questions Questions? Comments? Concerns?
|
||||
* Please send any feedback to <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>. Pull requests can be submitted to <a href="https://github.com/DjBushido/cvautomation">my github repository</a>.*/
|
||||
|
||||
/** \page libcvautomation Libcvautomation
|
||||
* \author Bradlee Speice <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>
|
||||
* \date 7/11/2012
|
||||
* \section intro Introduction
|
||||
* Welcome to Libcvautomation!
|
||||
* Libcvautomation is a GUI automation and testing tool based on image recognition and response. This program was designed as a direct replacement for <a href="http://sikuli.org">Sikuli</a> and <a href="https://wiki.ubuntu.com/Xpresser">Xpresser</a>. I was having incredible difficulty getting either of these solutions to work - Sikuli would crash whenever I tried to take a screenshot, and Xpresser was both too new for our RHEL 5 systems, but also died, or didn't work, or something else. I really liked the way each of these programs approached GUI automation, but they simply didn't work. Additionally, I wanted to create a simple solution - it does what you want it to, and that's it.
|
||||
* \section how_it_works How Libcvautomation Works
|
||||
* Libcvautomation represents two software products coming together - <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a> and the <a href="http://www.x.org/docs/Xext/xtest.pdf">XTest extension</a> to the X11 server. OpenCV is used for image recognition, and XTest is used to actually drive the X server. You can dig into \ref libcvautomation-xtest.h to get an idea of what all this library is capable of. <br>
|
||||
* Basically what happens is that for whenever you need to do image recognition, OpenCV is used to find the images, and XTest is used to generate any events needed. Libcvautomation is mostly a wrapper to integrate both of these products, but also adds some functions like matchSubImage_X11() that allow you to match an image against the X11 root window in place. This means no more <tt>'xwd | convert "<out_name>"'</tt>.
|
||||
* \section using Using Libcvautomation
|
||||
* So how does one go about using libcvautomation? <br>
|
||||
* I'm so glad you asked! I've provided a few reference programs - \c cva-match and \c cva-input - that can be used to demonstrate most of libcvautomation's capabilities. I've even provided a BASH wrapper to make it incredibly easy to use BASH with libcvautomation as well (requires that cva-match and cva-input are installed). Python bindings are on their way too. <br>
|
||||
* Finally, if you want to know how to write your own application tests, please see \ref writing_app_tests for more information on that.
|
||||
* \section questions Questions? Comments? Concerns?
|
||||
* Please send any feedback to <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>. Pull requests can be submitted to <a href="https://github.com/DjBushido/cvautomation">my github repository</a>.
|
||||
*/
|
||||
|
||||
/** \page writing_app_tests Writing Application Tests
|
||||
* \author Bradlee Speice <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>>
|
||||
* \date 7/11/2012
|
||||
@ -307,8 +291,9 @@ typedef struct {
|
||||
* </ul>
|
||||
* <li>If you have questions, comments, concerns, suggestions, or feedback in general, feel free to let me know at <a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>.
|
||||
* </ul>
|
||||
*
|
||||
* \section wrapper_functions Appendix of Wrapper Functions
|
||||
*/
|
||||
/** \page wrapper_functions Appendix of Wrapper Functions
|
||||
* \section appendix_click Click the mouse
|
||||
* \code click \endcode
|
||||
* Click the mouse where it is currently located
|
||||
* <br><br>
|
||||
@ -329,11 +314,7 @@ typedef struct {
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \code image_location <filename> \endcode
|
||||
* Get the location of an image on screen
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \section appendix_move Move the mouse
|
||||
* \code hover_xy <x-coordinate> <y-increment> \endcode
|
||||
* Move the mouse to a location on screen using absolute positioning
|
||||
* <br><br>
|
||||
@ -348,6 +329,19 @@ typedef struct {
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \code mouse_scrollu \endcode
|
||||
* Scroll the mouse wheel up one
|
||||
*
|
||||
* \code mouse_scrolld \endcode
|
||||
* Scroll the mouse wheel down one
|
||||
*
|
||||
* \section appendix_find Find an Image
|
||||
* \code image_location <filename> \endcode
|
||||
* Get the location of an image on screen
|
||||
* \note This is affected by the \c CENTER, \c TOLERANCE, and \c SEARCH_METHOD variables. See \ref testing_test_wrapper for more information on these.
|
||||
* <br><br>
|
||||
*
|
||||
* \section appendix_keyboard Click the keyboard
|
||||
* \code key_str "<string>" \endcode
|
||||
* Enter a string of characters on the keyboard rather than a single character at a time.
|
||||
* \warning This function <b>does not</b> accept key strings like "Space" as \c key_down, \c key_up, and \c key_click do. If you pass in "Space", that is exactly what will be typed.
|
||||
@ -368,6 +362,7 @@ typedef struct {
|
||||
* \note This function accepts special keys like "Space" - see \ref XTest_key_strings for a full list of characters allowed.
|
||||
* <br><br>
|
||||
*
|
||||
* \section appendix_utilities Useful extras
|
||||
* \code run_process "<process-name>" \endcode
|
||||
* Start a process on the system, background it, and return the PID of the created process.
|
||||
* <br><br>
|
||||
@ -375,6 +370,10 @@ typedef struct {
|
||||
* \code is_running "<process-name>" \endcode
|
||||
* \code is_running "<process-id>" \endcode
|
||||
* Check if a program name or PID is currently running
|
||||
*
|
||||
* \code notify "<string_to_display>" \endcode
|
||||
* Display a notification to the user, and wait for a response
|
||||
* \warning Uses \c zenity - if \c zenity isn't available, will return an error without pausing, and will not display anything.
|
||||
*/
|
||||
|
||||
/** \def LIBCVAUTOMATION_VERSION
|
||||
@ -393,7 +392,7 @@ typedef struct {
|
||||
* \param resultPoint Holder for a result - for example, storing where this sub image was located in its root image
|
||||
* \param searchMethod The search method to use when searching for this sub image in a root image
|
||||
* \param tolerance The tolerance to use when searching for this sub image in a root image
|
||||
* \see libcv_search_methods
|
||||
* \see \ref libcv_search_methods
|
||||
*/
|
||||
|
||||
/** \struct cvaPoint
|
||||
|
@ -317,6 +317,33 @@ jiggle_mouse ()
|
||||
eval '$CVAINPUT -s "mousejiggle" >> $OUTFILE'
|
||||
} # ---------- end of function jiggle_mouse ----------
|
||||
|
||||
#--- FUNCTION ----------------------------------------------------------------
|
||||
# NAME: mouse_scrollu
|
||||
# DESCRIPTION: Scroll the mouse wheel up one
|
||||
# PARAMETERS:
|
||||
# RETURNS:
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
mouse_scrollu ()
|
||||
{
|
||||
out "mouse_scrollu"
|
||||
eval '$CVAINPUT -s "mousescrollu" >> $OUTFILE'
|
||||
|
||||
} # ---------- end of function mouse_scrollu ----------
|
||||
|
||||
|
||||
#--- FUNCTION ----------------------------------------------------------------
|
||||
# NAME: mouse_scrolld
|
||||
# DESCRIPTION: Scroll the mouse wheel down one
|
||||
# PARAMETERS:
|
||||
# RETURNS:
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
mouse_scrolld ()
|
||||
{
|
||||
out "mouse_scrolld"
|
||||
eval '$CVAINPUT -s "mousescrolld" >> $OUTFILE'
|
||||
} # ---------- end of function mouse_scrolld ----------
|
||||
|
||||
#--- FUNCTION ----------------------------------------------------------------
|
||||
# NAME: key_str
|
||||
|
Loading…
Reference in New Issue
Block a user