Navigation: home >capturemock>texttest
Capture-Replay Mocking with CaptureMock
Using CaptureMock from TextTest
TextTest comes with builtin CaptureMock integration. The first thing to do is to enable it. You do this by adding the following to your TextTest config file, and then restarting TextTest:
import_config_file:capturemock_config
Alternatively, from TextTest 3.26 you can enable it directly from the initial application creation dialog.
This will enable a new kind of "definition file", which will be called "capturemockrc" (with application/version suffices if desired). This can then be created using "Create/Import" from the context menu under "Definition Files", and can be placed at any level of the TextTest hierarchy where it will apply to the tests under that point. If more than one rc file is found for a particular test, they will be amalgamated together, much as the environment files are. You can then study the documentation here for what to put in it, depending on what you want to intercept.
On running the test, you will notice that a new "CaptureMock" radio button has appeared on the Running/Basic tab. This allows you to choose between CaptureMock's three modes of running : replaying, recording, or replaying when possible and recording when not ("Mixed Mode"). This can also be done from the TextTest command line via the flag "-rectraffic" to TextTest.
Python interaction will be stored in a test result file called "pythonmocks.<app>", while command line and client-server interaction will be placed in a file called "externalmocks.<app>".
Users of the "TextTest traffic mechanism" from TextTest 3.20 and earlier
CaptureMock has grown out of the "traffic mechanism" in TextTest. If you were using this before you'll need to migrate to CaptureMock. See the migration notes in the TextTest help menu for how to do that.


Last updated: 07 April 2014