|
TSMFCAPI - the TestSmith C++ API (with Microsoft Foundation Classes Support)
See also TSMFCAPI Specification.
The TestSmith C++/MFC API provides the TestSmith user with the power of the C++
programming language and the MFC framework. Scripts can be recorded as C++/MFC
source files (see Language in
Recording Options) which can
then be edited and compiled using the Microsoft Developer Studio Visual C++ IDE.
The TSMFCAPI files are arranged in the
\QualityForge\TestSmith\TSMFCAPI directory as follows:
- \mfcsmith
Contains the .cpp tests and the compiled .exe files.
Newly recorded .cpp files will be placed here by default.
New projects (if the MFC 'New Project' option is selected)
will be created in an appropriately named sub-directory.
- \include
Contains the tsmfcapi.h file for including in your projects.
Newly created .h files can also be moved to this directory if required.
- \lib
Contains the tsmfcapi.obj file for linking to your projects.
To use TSMFCAPI you should have Microsoft Developer Studio correctly installed
on your system. You will also need to update your system environment as follows:
- Add the full path of the \include directory to the MFC INCLUDE path.
Assuming you installed to the top-level C:\ directory this will be
C:\QualityForge\TestSmith\TSMFCAPI\include .
- Add the full path of the \lib directory to the MFC LIB path.
Assuming you installed to the top-level C:\ directory this will be
C:\QualityForge\TestSmith\TSMFCAPI\lib .
- Add the full path of the directory containing TSAPI.dll to your system PATH.
Assuming you installed to the top-level C:\ directory this will be
C:\QualityForge\TestSmith .
See the TSMFCAPI specification for
full details of the TSMFCAPI classes and methods.
See the two sample C++/MFC source files
YahooLogin.cpp and
DataDriver.cpp for examples of usage.
To run these two files (both of which are already compiled as .exe files) open
a command prompt and change the working directory to be the directory where
these two files exist (by default this is
<install_location>\QualityForge\TestSmith\TSMFCAPI\mfcsmith).
Then use the following syntax to run the scripts:
-
YahooLogin
-
DataDriver n
where n is a positive integer value (suggested range, 1-20)
These two files are equivalent in functionality to the two sample .smith
scripts included in the \Scripts directory.
|