...
- Copy the
<INSTALL_DIR>/coverage/dotNET/dottest_agent
folder to the machine where IIS is installed and the web application is deployed. - Run a console as an Administrator on this machine.Invoke the Agent Client tool on this machine to enable runtime coverage collection inside IIS
- To launch the dotTEST application coverage UI, run the agent client in the console using the following command:
Code Block agent_client.exe
Note: If you want to collect coverage information for multiple users that are simultaneously accessing the same web application server, invoke the Agent Client with the
-multiuser
switch:Code Block agent_client.exe -multiuser
agent_client
initializes the environment for the web server (IIS) and behaves like a service, enabling you to execute tests and collect coverage. The service is ready and waiting for commands as long as the following message is printed to the output:Code Block Write 'exit' and hit Enter to close agent_client
Info A test session and test can be started even if the tested website or application has not been loaded yet.
- Ensure that port 8050 (default port for the coverage agent) allows HTTP traffic in firewall settings on this machine. You can change the coverage agent port number if the default port is unavailable.
- Choose IIS Web Application and click Next.
- (Optional) Configure the following settings:
- Application URL: Specifies the URL of an application which you will be able to run from the application coverage UI.
- Advanced settings:
- Enable simultaneous collection of coverage for multiple users: Enables collecting coverage information for multiple users.
- Coverage output directory: Specifies the path to the coverage data output directory.
- Coverage scope file: Specifies the path to the coverage scope configuration file. It is required if the scope is other than the default.
- Agent REST API port: Specifies the custom port number to use when starting the coverage agent if the default port is unavailable.
- Agent connection timeout (milliseconds): Specifies the timeout for a connection with the coverage agent. The default value is 1500 ms.
Info If you provide 0 or a negative value, the connection attempt will not timeout, which may lead to a considerable slowdown or cause the tool to hang indefinitely.
- Data flushing interval (milliseconds): Specifies how often to flush data.
- Maximum number of coverable lines: Specifies a limit for the number of lines that can be covered.
- Skip SSL for connecting to the agent: Enables connecting via HTTPS.
- Skip SSL certificate validation: Enables using a self-signed SSL certificate.
- Certificate path: Specifies the path to a PFX file that stores the SSL certificate.
- Certificate hash: Specifies the hash of the SSL certificate for the port that is used by the coverage agent.
- Certificate password: Specifies the password for the SSL certificate stored in a PFX file.
- Click Next. Coverage will be collected for all applications residing on the IIS server.
- (Optional): Perform tests on the specified application and view the coverage API:
- Start Application - Allows you to run the specified application and perform tests on it.
- Swagger - Allows you to view coverage API in Swagger, start/stop a session, and download a coverage file.
- Scalar - Allows you to view coverage API in Scalar, start/stop a session, and download a coverage file.
- Click Stop Coverage Agent to finish collecting coverage from all applications.
- Click Finish to close the application coverage UI, or New Session to configure a new coverage collection session.
- Ensure that port 8050 (default port for the coverage agent) allows HTTP traffic in firewall settings on this machine. You can change the coverage agent port number if the default port is unavailable.
Start the application and Start the application and verify that the agent is ready by opening
<host>:8050/status
in your browser. You should receive the following response:Code Block {"session":null,"test":null}
Configure soatest.properties to collect coverage for the AUT. Several application coverage parameters are supported (see Application Coverage Settings), but configuring the following settings is suitable for most cases:
Code Block application.coverage.enabled=true application.coverage.agent.url=http://localhost:8050 application.coverage.binaries=c:/<PATH_TO_APPLICATION_PDB_FILES>/bin application.coverage.binaries.include=<INCLUDE_PATTERN> application.coverage.binaries.exclude=<EXCLUDE_PATTERN>
Be sure the path for the application binaries is to the folder containing the application PDB files.
...
- Copy the
<INSTALL_DIR>/coverage/dotNET/dottest_agent
folder to the machine where you intend to run the standalone application. - Run the coverage_wizard.exe in that folder, specifying the following:
- Full path the application
- Command line arguments
- Working directory
- Select the .NET CLR version used by the application.
- Enter the directory where the scripts generated by the wizard will be saved in the Target scripts directory field.
- Enable the Use Coverage Agent option and enable or disable the Collect coverage without admin privileges option as appropriate.
- By default, admin privileges are required to collect coverage with coverage agent, but you can configure the tool to collect coverage by users without admin privileges. Doing so will cause two additional .bat scripts to be generated: runCamAgentInit.bat and runCamAgentUninit.bat. Run the runCamAgentInit.bat script with admin privileges to setup and initialize the coverage agent. When testing is completed, run the runCamAgentUninit.bat script to stop the process.
- Click Finish. The wizard will generate scripts in target script directory specified above.
- Run a console as an Administrator on this machine and change directories to where the scripts were generated.
- Execute runCamAgent.bat.
- Run another console as an Administrator and execute monitorCoverage.bat.
- intend to run the standalone application.
- To launch the dotTEST application coverage UI, run the agent client in the console using the following command:
Code Block agent_client.exe
- Choose Desktop Application and click Next.
- Configure the following settings:
- Full path to the tested application: Specifies the full path to the tested application for which coverage will be collected. You will be able to run this application from the application coverage UI.
- Application command-line arguments: Specifies the application command line arguments.
- Application working directory: Specifies the path to the working directory.
- (Optional) Advanced settings:
- Enable simultaneous collection of coverage for multiple users: Enables collecting coverage information for multiple users.
- Coverage output directory: Specifies the path to the coverage data output directory.
- Coverage scope file: Specifies the path to the coverage scope configuration file. It is required if the scope is other than the default.
- Agent REST API port: Specifies the custom port number to use when starting the coverage agent if the default port is unavailable.
- Agent connection timeout (milliseconds): Specifies the timeout for a connection with the coverage agent. The default value is 1500 ms.
Info If you provide 0 or a negative value, the connection attempt will not timeout, which may lead to a considerable slowdown or cause the tool to hang indefinitely.
- Data flushing interval (milliseconds): Specifies how often to flush data.
- Maximum number of coverable lines: Specifies a limit for the number of lines that can be covered.
- Skip SSL for connecting to the agent: Enables connecting via HTTPS.
- Skip SSL certificate validation: Enables using a self-signed SSL certificate.
- Certificate path: Specifies the path to a PFX file that stores the SSL certificate.
- Certificate hash: Specifies the hash of the SSL certificate for the port that is used by the coverage agent.
- Certificate password: Specifies the password for the SSL certificate stored in a PFX file.
- Click Next. The specified application will be run and coverage will be collected. Perform tests on the application.
- (Optional): View the coverage API:
- Swagger - Allows you to view coverage API in Swagger, start/stop a session, and download a coverage file.
- Scalar - Allows you to view coverage API in Scalar, start/stop a session, and download a coverage file.
- Click Stop Coverage Agent to finish collecting coverage from the application.
- Click Finish to close the application coverage UI, or New Session to configure a new coverage collection session
Configure soatest.properties to collect coverage for the AUT. Several application coverage parameters are supported (see Application Coverage Settings), but configuring the following settings is suitable for most cases:
Be sure the path for the application binaries is to the folder containing the application PDB files.Code Block application.coverage.enabled=true application.coverage.agent.url=http://localhost:8050 application.coverage.binaries=c:/<PATH_TO_APPLICATION_PDB_FILES>/bin application.coverage.binaries.include=<INCLUDE_PATTERN> application.coverage.binaries.exclude=<EXCLUDE_PATTERN>
Note |
---|
Multiuser coverage is not currently available for standalone applications. |
...