Android: Open-source Scripting For Testing and Automation
by Larry Smith and Cameron Laird


Example 1:
(a)
set CloseBtn @302,404

(b)
send_xevents $CloseBtn click 1

(c)
proc CloseBtn {} {
  send_xevents @302,404 click 1
}
CloseBtn

Example 2:
(a)
send_xevents @100,100 click 1

(b)
send_xevents @100,100
send_xevents click 1

Example 3:

% puts [dispinfo installed]
AccessX Multi-Buffering SHAPE MIT-SHM Shared-Memory Transport
XInputExtension XTEST Keyboard-Management-Extension
MIT-SUNDRY-NONSTANDARD MIT-SCREEN-SAVER SYNC DEC-XTRAP XVideo Xie XIE
Adobe-DPS-Extension DPSExtension

% puts [dispinfo installed AccessX XVideo]
1

% puts [dispinfo installed AccessX No-Such-Extension]
0


Listing One
exec /usr/X11R6/bin/xwd -silent -out snapshot.tmp &
after 3000
send_xevents @596,305 click 1
after 3000
set err 0
set result [ catch {
     exec cmp snapshot.tmp xcalc.tst.ss.0
} err ]
if { $result == 0 } {
  puts "Test 0: succeeded First Test"
} else {
  puts "Test 0: failed    First Test ($err)"
  incr failures
}




1

