Xautomation: visually grepping for gui elements
Posted by Ben Armstrong 1 minute ago
In my first article about testing tuxpaint with xautomation, I mentioned th=
at I wasn=E2=80=99t happy with hardwiring button positions. But before I co=
uld proceed, I discovered a bug in xautomation that prevented me from using=
visgrep to search for the =E2=80=9CYes=E2=80=9D button in tuxpaint screens=
hots. Fortunately, the fix was straightforward enough after reading the lib=
png man page.
At the same time, I also decided to borrow an idea from the example scripts=
in the xmacro package. Running the test script on the tester=E2=80=99s own=
display may be fine for developing the script, but it is nice to be able t=
o run it on a virtual display after the kinks are worked out. For one thing=
, the test doesn=E2=80=99t get in the way of other things when you=E2=80=99=
re waiting for it to finish. For another, it is much easier to control the =
test environment. Xvfb is perfect for this.
The resulting script requires tuxpaint, Xvfb, xautomation with the above pa=
tch applied, xbase-clients and Imagemagick.
,-. nSLUG http://www.nslug.ns.ca synrg@...
\`' Debian http://www.debian.org synrg@...
` [ gpg 395C F3A4 35D3 D247 1387 2D9E 5A94 F3CA 0B27 13C8 ]
[ pgp 7F DA 09 4B BA 2C 0D E0 1B B1 31 ED C6 A9 39 4F ]