In this section:
Table of Contents | ||
---|---|---|
|
This lesson teaches you how to run tests from the command line, which allows you to configure SOAtest to automatically check the complete project at a specified time each night (or at any other desired interval). This ensures that testing occurs consistently without being disruptive or obtrusive.
SOAtest’s command line mode allows you to perform tests from Windows or UNIX command line shells and to run SOAtest from automated build utilities such as Ant, Maven, and CruiseControl.
The following exercises are designed to demonstrate the basics of using soatestcli
.
Info | ||
---|---|---|
| ||
A command-line license is required to use |
Running a Test Suite From the Command Line
In this example, we will run SOAtestTutorial.tst
from the command line which can be found in the examples
directory.
- Close SOAtest and open a command line window.
- Switch to the directory where SOAtest is installed.
- From the command line window type the following command:
On Windows:
soatestcli.exe -config <configuration name> -resource "C:\Location Of SOAtestTutorial.tst (in the default workspace)" -report MySampleReport
On UNIX (where
Location Of SOAtestTutorial.tst
represents the location of SOAtest on disk).:soatestcli -config <configuration name> -resource "/Location Of SOAtestTutorial.tst (in the default workspace)" -report MySampleReport
For example:soatestcli.exe -config “user://Example Configuration” -resource “user://Examples/SOAtestTutorial.tst” -report MySampleReport
Running all Projects in a Workspace
To run all project in a workspace, use the -data
option.
soatestcli.exe -data "c:\mySOAtestWorkspace" -showdetails -config "user://Example Configuration" -report "c:\mySOAtestReports"
The –data
option specifies the Eclipse workspace location.
The –showdetails
option prints detailed test progress information.
The –config
option specifies test configuration.
The –report
option generates an HTML report.
Running an Individual Project in a Workspace
To run an individual project in a workspace, you must specify the project to be tested with the -resource
option:
soatestcli.exe -data “C:\mySOAtestWorkspace” -resource “MyProject” -exclude “MyProject/somebadtesttoskip.tst” -showdetails -config “user://Example Configuration” -report “C:\mySOAtestReports”
The -exclude
option specifies files to be excluded during testing.
Using a Settings File
Settings files can control things like report settings, DTP settings, and error authorship settings. You can create different settings files for different projects, then use the -settings
option to indicate which file should be used for the current command line test.
Each settings file must be a simple text file. There are no name or location requirements. Each setting should be entered in a single line.
If a parameter is specified in this file, it will override the related parameter specified from the GUI. If a parameter is not specified in this file, SOAtest will use the parameter specified in the GUI.
soatestcli.exe -data "c:\mySOAtestWorkspace" -showdetails -config "user://Example Configuration" -report "c:\mySOAtestReports" -publish -settings "c:\mysettings.properties"
Here is a sample settings file (it must be customized for your environment):
Code Block |
---|
concerto.reporting=true dtp.url=http://dtp.server.com:32323 report.dtp.publish=true concerto.log_as_nightly=true report.mail.enabled=true report.mail.server=smtp.server.com report.mail.domain=server.com report.mail.subject=My Nightly Tests [email protected] report.mail.exclude.developers=false scope.sourcecontrol=true scope.local=false soatest.license.use_network=true soatest.license.network.url=http://ls.server.com:8443 soatest.license.network.edition=server_edition |
Applying an Environment Configuration to a Regression Test from the Command Line
Anchor | ||||
---|---|---|---|---|
|
One of the greatest benefits of environments is the ability to rerun the same regression suites from the command line without having to open the SOAtest GUI and modify host or URL settings.
First, setup environments as described in Running Tests in Different Environments.
Next, from the command line, run a command like:
soatestcli.exe -config <configuration name> -resource <path to test suite name.tst relative to the workspace> -environment "Default Calculator Environment"
Finally, switch environments by using a command like:soatestcli.exe -config <configuration name> -resource <path to test suite name.tst relative to the workspace> -environment "Echo Environment"
This will run the same suite with the second environment applied to it.