swWxGuiTesting Simpleware Logo

© 2004-2007 Reinhold Füreder (reinholdfuereder_AT_gmx_DOT_at)

John Ralls' proactive distinguished enhancements of swWxGuiTesting have made my strong wishes with respect to further developement -- that were there from the very beginning -- come true, and confirmed my trust and confidence in it's enormous power and potential:

That is, starting from 25 January 2008 development of swWxGuiTesting will continue in the fully open space of sourceforge.net -- "the world's largest destination for Open Source" -- under the slightly different name wxGuiTesting and lead developer John Ralls. This renaming denotes that the project is no longer under the auspices of the company Simpleware Ltd (Exeter, UK), however, tribute is paid to the original project sponsor Simpleware Ltd, foremost company directory Dr Philippe G Young.



Introduction & documentation

While I developed swWxGuiTesting as part of my MPhil study at the University of Exeter, UK, in collaboration with Simpleware Ltd -- a spin-off company from this university --, the company director Dr Philippe G Young is embracing the idea of contributing it to the open source community. For the sake of simplicity and striving/hoping for an integration into the wxWidgets framework we have decided to put it under wxWindows licence (thanks to Julian Smart's explanations and advise).

As discussed in the wxWidgets developers mailing list under subject "Contributing an automated wxWidgets GUI testing framework to the open source community" this site hosts the offered automated wxWidgets GUI testing framework -- named swWxGuiTesting. However, ideally this site will be only the temporary home of the project until it finds a better place that is hopefully within wxWidgets itself.

A first overview about swWxGuiTesting is given in the mailing list postings:

Reinhold Füreder, 30 Jan 2006    <<< recommended introductory starting point

Much more details on the motivation and especially concepts of swWxGuiTesting are found in the standalone MPhil thesis chapter at MPhilThesisChapterSwWxGuiTesting.pdf (1.3MB). While this chapter also lists the required steps to make any wxWidgets based GUI application testable by this pragmatic framework, it admittedly does not replace a more developer-friendly tutorial...


The sources (including building instructions and via Doxygen generatable API documentation) are zipped into: For version details please see Updates.


Instructions for building are found in Building.txt, that is also part of the source archive.

The building was tested under Microsoft Windows (2000, XP) for Microsoft Visual C++ 6, Mac OS X 10.4 with GCC 4 (for versions >= 1.5 of swWxGuiTesting) and Ubuntu Dapper Linux with GCC 4 (for versions >= 1.2 of swWxGuiTesting; version 1.0 was tested with an ancient Red Hat 8 Linux installation with GCC 3.2 -- choosing this version is reasoned in the aforementioned mailing list postings).

The build process is based on the open source tool CMake (a release version >= 2.4.5 is required for wxWidgets 2.8.x), after the third party dependencies are built independently according to their respective standard build rules (including e.g. "make install" for the sake of simplicity, but not mandatory if additional CMake option adaptations are not frightening; non-standard building settings are outlined below, and potentially specified in some detail in the doxygen documentation).

There is an optional dependency on VTK (tested with versions 4.x - 5.0 built with CMake) to allow Capture & Replay (C&R) of VTK render window interactions. However, the generated test cases for such interactions do not fulfil the ultimate goal of being easily maintainable.

Building notes/hints for Linux (Ubuntu Dapper):

Remaining internal dependencies

Dependencies from swWxGuiTesting to SimplewareFramework (whose subcomponent it originally was) were removed to some extent by:
  1. replacing wxWidgets based extensions again with wxWidgets base classes
  2. removing any non-core classes, and related methods (e.g. ViewFrame + FrameFactory's CreateViewFrame() method)
Nevertheless, there are still dependencies that demand that the user of the testing framework builds her system under test (SUT) with some constraints (cf. so-called FrameFactory). In case swWxGuiTesting will be integrated into wxWidgets, one could get rid of these dependencies if wxWidgets takes over their strictly required responsibilities.

Automatic skeleton code generation of test cases and test drivers

As outlined in the MPhil thesis chapter test case skeletons and test drivers can be generated by means of the free tool wxCRP. It should be sufficient to point the installed wxCRP application to the decompressed swWxGuiTesting wxCRP repository. A movie (4.4MB) with crap quality (sorry) shows the process and result of utilising wxCRP.

Example usages for swWxGuiTesting

  1. Simple Test (UsingSwWxGuiTesting/Cxx/SimpleTest.*):
    • Test case source file: SimpleTest.cpp
    • Movie: SimpleTest.avi (2.0MB), step-by-step protocol
    • Based on original test of Capture & Replay (C&R) in Testing/Cxx/swWxGuiTesting/CppGuiTest/swCRCaptureTest.cpp
    • Artificially sleep for 1 second after each event simulation: wxThread::Sleep(1000) at end of WxGuiTestHelper::FlushEventQueue() method
    • Using temporary interactivity (breakpoint afterwards is not reached) to demonstrate control flow splitting and easy visual inspection
    • Using breakpoint to demonstrate control flow splitting and easy debuggability
  2. Simple Capture & Replay Test (UsingSwWxGuiTesting/Cxx/SimpleCRTest.*):
    • Test case source file: SimpleCRTest.cpp
    • Movie: SimpleCRTest.avi (7.9MB), step-by-step protocol
    • Bootstrap GUI test case built solely upon a GUI initialisation in setup() and the CAPTURE macro in the test case:
      • during bootstrapping the test case is written directly into backup file (*.cr*)
      • each key stroke in a text control results in an event => collect them
    • Fix pragmatic code generation of capture phase:
      • adding include directories
      • removing duplicate container lookups and variable declarations
      • adding assertions
    • Replay captured test case like a normal test case
  3. Complex Test - ScanCAD

Further work

Most importantly see the conclusion section of the MPhil thesis chapter and the mailing list discussions so far. This project is more than a proof of concept for easy and maintainable cross-platform automated wxWidgets GUI tests, but by no means a product.

Must: Fix: Improve: Comments:


21.11.2007 - Release 1.5 supporting wxWidgets 2.8.6 (including Unicode) under Mac OS X, Linux GTK and MSW: Special thanks to John Ralls for his great work and feedback!!!
18.12.2006 - Release 1.4 supporting wxWidgets 2.8.0 under MSW and Linux GTK: Known bug with wxWidgets 2.8.0 under Linux GTK2:
26.11.2006 - Minor release 1.3.3 with some minor fixes/improvements:
18.10.2006 - Minor release 1.3.2 demonstrating another approach (as in the MPhil thesis chapter) to handle user-defined modal dialogs (cf. CppGuiTestModalDialog test case):
13.10.2006 - Minor release 1.3.1 supporting building with latest release of CMake: Version 2.4.3 required a few tiny but critial modifications in the CMakeLists.txt.
05.10.2006 - Release version 1.3 supporting wxWidgets 2.7 plus removed Xerces-C++ dependency in favour of the expat library which already comes with wxWidgets. Plus minor improvements:
14.08.2006 - Minor release version 1.2.2 supporting VTK 5; plus fix building for C&R of VTK render window interactions under Linux.
07.07.2006 - Release version 1.2 supporting latest stable release wxWidgets 2.6.3 also under Linux (GTK2).
27.06.2006 - Move website to new host, because the previous free webspace provider has shut down the page without any notice some time ago. Thanks to my friend Werner Fischer for hosting it.
09.06.2006 - Recreate VNC movies in the shape of MPEG videos to allow playing them on all systems. Thanks to Carl Godkin for reporting the problem.
03.05.2006 - Release version 1.1 supporting latest stable release wxWidgets 2.6.3 with patch 2 under MSW. Initiated by Carl Godkin.
14.04.2006 - Uploaded recompiled MPhil thesis chapter: now recognizable full sequence diagrams in Appendix A, Section 1.5 (page 95).
17.02.2006 - Initial "release".