[Full-disclosure] help about tool to control x window client (xterm) script-like way

hi,
In our research, we need to generate some X traffic through network. The
current approach is let human actor sit manipulate a "xterm" window to type
keys, move mouse, resize window. Is there any tool that can automatically do
this? The ideal one might trigger key press, button press, window change
event following a pre-defined script file. We have used Expect package to do
it for normal TELNET, SSH traffic. But Expect can not control X window
Client.