mirror of
https://github.com/bspeice/libcvautomation
synced 2024-12-04 13:58:11 -05:00
166 lines
11 KiB
HTML
166 lines
11 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<title>libcvautomation: Libcvautomation</title>
|
|
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
|
</script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
</script><script src="http://www.mathjax.org/mathjax/MathJax.js"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div! -->
|
|
|
|
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
|
|
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">libcvautomation
|
|
 <span id="projectnumber">2.0</span>
|
|
</div>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Generated by Doxygen 1.7.6.1 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Libcvautomation </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Bradlee Speice <<a href="mailto:bspeice@uncc.edu">bspeice@uncc.edu</a>> </dd></dl>
|
|
<h2><a class="anchor" id="intro"></a>
|
|
Introduction</h2>
|
|
<p>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 Prominent North American Enterprise Linux systems, but also didn't work or <code>import</code> 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. </p>
|
|
<h2><a class="anchor" id="how_it_works"></a>
|
|
How Libcvautomation Works</h2>
|
|
<p>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 <a class="el" href="libcvautomation-xtest_8h.html">libcvautomation-xtest.h</a> 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 <a class="el" href="libcvautomation-xlib_8h.html#abdedf5cd2aceeda00f665747bf1eeece" title="Return the location of a sub image in the X11 root window.">matchSubImage_X11()</a> that allow you to match an image against the X11 root window in place. This means no more <code>'xwd | convert "<out_name>"'</code>. </p>
|
|
<h2><a class="anchor" id="main_installing"></a>
|
|
Installing Libcvautomation</h2>
|
|
<p>Installing Libcvautomation is easy. You can either manually install packages, add the Libcvautomation repository, or install from tarball (the first option is recommended). </p>
|
|
<h3><a class="anchor" id="main_rpm"></a>
|
|
Install Libcvautomation RPM Repository</h3>
|
|
<p>If you want to make sure that you're using the latest (stable) version of Libcvautomation, you can add the Libcvautomation repository to yum. First, a new configuration file for the Libcvautomation repository: </p>
|
|
<div class="fragment"><pre class="fragment"> sudo vim /etc/yum.repos.d/libcvautomation.repo
|
|
</pre></div><p> After you have the file open, put the following content in it: </p>
|
|
<div class="fragment"><pre class="fragment"> [libcvautomation]
|
|
name=Libcvautomation RPM repository
|
|
baseurl=http:<span class="comment">//djbushido.github.com/libcvautomation/rpm</span>
|
|
enabled=1
|
|
gpgcheck=0
|
|
</pre></div><p> And once this is done, clean out the cache, and you should be good to go! </p>
|
|
<div class="fragment"><pre class="fragment"> sudo yum clean all
|
|
</pre></div><p> Finally, if you want to begin developing application tests, you will need the following packages: <code>libcvautomation</code>, and <code>libcvautomation-examples</code>. </p>
|
|
<h3><a class="anchor" id="main_apt"></a>
|
|
Install Libcvautomation APT Repository</h3>
|
|
<p>If you want to make sure that you're using the latest (stable) version of Libcvautomation, you can add the Libcvautomation repository to APT. First, open up your <code>sources.list</code> </p>
|
|
<div class="fragment"><pre class="fragment"> sudo vim /etc/apt/sources.list
|
|
</pre></div><p> Add the following content at the end: </p>
|
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #Libcvautomation Repository</span>
|
|
<span class="preprocessor"></span> deb http:<span class="comment">//djbushido.github.com/libcvautomation/apt libcvautomation/</span>
|
|
deb-src http:<span class="comment">//djbushido.github.com/libcvautomation/apt libcvautomation-source/ </span>
|
|
</pre></div><p> Run an update to make sure your packages refresh, and then you should be good to go! </p>
|
|
<div class="fragment"><pre class="fragment"> sudo apt-<span class="keyword">get</span> update
|
|
</pre></div><p> Finally, if you want to begin developing application tests, you will need the following packages: <code>libcvautomation-dev</code>, and <code>libcvautomation-examples</code>. </p>
|
|
<h3><a class="anchor" id="main_download"></a>
|
|
Manual Download Packages</h3>
|
|
<p>If you want to manually download the packages, see the Github downloads page for libcvautomation: <a href="https://github.com/DjBushido/libcvautomation/downloads">https://github.com/DjBushido/libcvautomation/downloads</a> </p>
|
|
<h3><a class="anchor" id="main_tarball"></a>
|
|
Manual Tarball Installation</h3>
|
|
<p>If you want to install Libcvautomation via tarball, you can do that too. Download a release tarball from the Downloads page on Github: <a href="https://github.com/DjBushido/libcvautomation/downloads">https://github.com/DjBushido/libcvautomation/downloads</a> The source itself uses autotools, so it's incredibly easy to work with: </p>
|
|
<div class="fragment"><pre class="fragment"> cd <location_of_tarball>
|
|
tar xf <tarball_file>
|
|
cd libcvautomation-<release_number>
|
|
./configure
|
|
make
|
|
sudo make install
|
|
</pre></div><h2><a class="anchor" id="main_using"></a>
|
|
Using Libcvautomation And Writing Application Tests</h2>
|
|
<p>So how does one go about using libcvautomation? <br/>
|
|
I'm so glad you asked! I've provided a few reference programs - <code>cva-match</code> and <code>cva-input</code> - 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 <code>cva-match</code> and <code>cva-input</code> are installed). Python bindings are even included too! <br/>
|
|
Bash wrapper documentation: <a class="el" href="wrapper_functions.html">Appendix of Wrapper Functions and Environment Variables</a> <br/>
|
|
Python wrapper documentation: <a class="el" href="libcvautomation__funcs_8py.html">libcvautomation_funcs.py</a> <br/>
|
|
Finally, if you want to know how to write your own application tests, please see <a class="el" href="writing_app_tests.html">Writing Application Tests</a> for more information on that. I've provided code to give you a basic idea of how they work. </p>
|
|
<h2><a class="anchor" id="questions"></a>
|
|
Questions? Comments? Concerns?</h2>
|
|
<p>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/libcvautomation">my github repository</a>. </p>
|
|
</div></div><!-- contents -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Defines</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
|
|
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Thu Oct 11 2012 17:42:49 for libcvautomation by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.7.6.1
|
|
</small></address>
|
|
|
|
</body>
|
|
</html>
|