[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xnee-devel] Verifying GUI-Testresults with xnee using the tools "xcutse

From: Veijo Ryhänen
Subject: [Xnee-devel] Verifying GUI-Testresults with xnee using the tools "xcutsel" and "xprop"
Date: Mon, 16 Jan 2006 16:53:05 +0200


Currently screen capture based test results verifying seems to be too difficult, too
time consuming and too complicated solution for me: Verifying GUI-Testresults with
xnee using the Tool "xgrabsc" (http://savannah.gnu.org/support/?func=detailitem&item_id=103871).
Anyway, I gave 50 vote for this "picture based" solution. Hopefully it will be
easier to do in the future.

Instead I tried character based test results verifying. This is how I did it:


1. Start your application, xcutsel and cnee to recording mode. For example:

   gnome-calculator &
   xcutsel &
   cnee -rec --event-range 2-13,15-31 -sk s -o gnome-calculator.xnee
2. Record when calculating "1+1="
3. Paint result number (=2) and open "Edit" -menu and select "Copy"
4. Close gnome-calculator
5. Change focus to xcutsel -window and click button "copy PRIMARY to 0"
6. Quit xcutsel
7. Stop xnee recording by using stop -key s (if it works) or use Ctrl+c.


Make a script, for example calculator-test.sh

xprop -root -remove CUT_BUFFER0
gnome-calculator &
xcutsel &
cnee -rep --no-sync -t 3 -f gnome-calculator.xnee
RESULT=`xprop -root -len 100 CUT_BUFFER0|cut -d \" -f 2`
echo xprop_ret=$xprop_ret
echo -n "Test result was $RESULT = "
if [ $RESULT = "2" ] ; then
      echo "OK"
      echo "FAILED!"


1. Works fine when running first time. But when running second time
   there is already result "2" in clipboard. If xnee does not sync when
   replaying second time, xprop will get old clipboard value and
   script will happily print out: "...2 = OK"
   Solution is to clear clipboard content before xnee replay:
     rm ~/.kde/share/config/klipperrc
     killall -9 klipper
     klipper &

2. If there is xclipboard and xcutsel running at the same time, closing
   xcutsel will prevent to use "mouse paint, Edit -menu, Copy", because
   painted text is copied automatically to clipboard.
   Solution: close the xclipboard.

Wish list:

How about "--cut_buffer 0" -switch in cnee ? I would like to use
it instead of xcutsel. If "--cut_buffer 0" switch is defined, then
cnee will "copy PRIMARY to 0" when pressing stop key.
When using "--cut_buffer 0", only thing to remember before pressing
stop key is to copy test result string to clipboard. It would be
little bit easier to record tests when using "--cut_buffer 0" -switch.

Veijo Ryhänen, Finland

reply via email to

[Prev in Thread] Current Thread [Next in Thread]