|
TSJAPI - the TestSmith Java API
See also TSJAPI JavaDoc Specification.
The TestSmith Java API provides the TestSmith user with the power of the Java
programming language. Scripts can be recorded as Java source files
(see Language in
Recording Options) which can
then be compiled in the usual way with javac or through a Java IDE.
The TSJAPI files are arranged in the
\QualityForge\TestSmith\TSJAPI directory as follows:
- \jsmith
Contains the .java tests and the compiled .class files.
Newly recorded .java files will be placed here by default.
- \lib
Contains the jsmith.jar file (the compiled TSJAPI classes)
To use TSJAPI you must have the JDK or JRE correctly installed on your system.
You will also need to update your system environment as follows:
- Add the full pathname of the jsmith.jar file to your system CLASSPATH.
Assuming you installed to the top-level C:\ directory this will be
C:\QualityForge\TestSmith\TSJAPI\lib\jsmith.jar .
- 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 javadoc help files for
full details of the TSJAPI classes and methods.
See the two sample Java source files
YahooLogin.java and
DataDriver.java for examples of usage.
To run these two files (both of which are already compiled) 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\TSJAPI\jsmith).
Then use the following syntax to run the scripts:
-
java YahooLogin
-
java 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.
Important Note: TSJAPI uses Java Native Interfaces
and is only intended for use on Windows Systems.
|