Such a project would be very valuable and I wonder whether this
issue wasn't raised before in this group. In any case, following
is some of my experience in this area in the hope that this is
helpful.
A couple of years ago, we built a GUI test system for a different
toolkit, Tcl/Tk. The system worked very well and allowed testing
GUI applications across different Unix platforms, automatically,
with a low false failure rate.
Key to the success of that GUI test system was that it did *not*
depend on positional information like window size and position,
mouse screen coordinates, etc. since those could differ accross
test environments.
That system used several hooks available in Tcl/Tk to intercept
and insert commands. Since all GUI events in Tcl/Tk are just
like user commands it was pretty straightforward to record and
replay GUI events.
The main problem was filtering and recording GUI events at high
levels along with the necessary context such that the generated
commands could be replayed reliably. For example, most mouse
movement events were ignored, except when leaving and entering
windows. Also, it was critical to record GUI identifiers like
a window, frame, button, etc. identifier along with the GUI
event.
In summary, it can be done, provided the GUI toolkit offers the
proper hooks to intercept and inject events. Most important is
to avoid positional information and instead use GUI identifiers
which must beconstant, idempotent across different invokations
of the GUI application under test.
I am not familiar enough with wxPython internals to state that
the same approach can be used here. Also, it may be difficult
to make a GUI test system work for wxPython across the supported
platforms because the underlying toolkits are very different
and those differences tend to perculate up.
/Jean Brouwers,
ProphICy Semiconductor, Inc.
Thys Meintjes wrote:
ยทยทยท
Greets
I'm in need of a mechanism to facilitate and automate GUI level testing
- in X. (Or user interaction 'macro recording')It will be a facility the testers use to automate their work. The
mechanism will record user interaction events and allow the tester to
play the "macro" back at a later stage. As a first step "test passed"
may simply mean "no exceptions raised" - later excepted values in
nominated target widgets could be added.Things like unit tests does not completely fit the requirement as the
data flow through the system is somewhat convoluted...I think I have 2 options:
1) record all user evts (mouse click/dclick positions) entered text from
within wxPython - Is this viable and if how ?
2) use something like python-xlib - I like this better as it would be
nicely app generic even if is platform specific