Run Tests
- 4 minutes to read
Run Tests in Visual Studio
Supported Platform: .NET Framework
With EasyTest, you can test your applications from Visual Studio while developing them. EasyTest supplies a set of actions for a context menu available when you are editing ETS script files in the Visual Studio text editor, and in the Solution Explorer when you click over an ETS file.
The context menu contains the following actions.
Action | Description |
---|---|
Run | Performs a whole test. |
Run Next Step | Performs a test script on a by-command basis. To perform the whole test, this action must be performed as many times as there are test commands in the test file. |
Run to Cursor | Active only in the Visual Studio text editor when editing an ETS file. Performs the test up to the cursor’s position, after which test execution is paused. |
Stop Running | Stops a running test. |
All these commands are also available on the EasyTest toolbar, which is disabled by default.
Run Multiple Tests in Visual Studio
You can run multiple tests in a batch in the following ways:
- Select the required test script files in the Solution Explorer, open the context menu and click the Run command.
- Invoke the context menu for the module project or the FunctionalTests folder and click Run.
“Run Next Step” Command
When running multiple tests, the Run Next Step command works with the selected tests as if they were represented in a single test.
Process Failed Tests
When performing multiple tests, if a test command cannot be executed, the current script file execution is interrupted. Then, the next script file is executed.
When a test fails, EasyTest does the following:
Displays an error message in the Output Window.
The error and the corresponding script row number are written to the Output Window. The Output Window contains a simple log describing the process and the result of the test.
Captures an application’s screenshot.
The screenshot (a JPEG file) allows you to see a state of the application’s UI at the time of failure. You can double click the screenshot name in the Visual Studio Output window to open it. To learn how to set up associations, refer to the How to: Change or Add a Default Editor MSDN article.
You can set up a breakpoint, as in a regular Visual Studio solution.
When a test execution is paused at a breakpoint, you can resume execution of the test up to the last command or step-by-step, using appropriate context menu actions.
Run Tests in Console
Supported Platforms: .NET Framework, .NET 6
The test executor utility is a command-line tool that is used to run EasyTest functional tests and produce XML output logs.
DevExpress installer ships two instances of TestExecutor utility:
For .NET Framework applications:
C:\Program Files\DevExpress 24.1\Components\Tools\eXpressAppFramework\EasyTest\TestExecutor.v24.1.exe
For .NET 6 applications:
C:\Program Files\DevExpress 24.1\Components\Tools\eXpressAppFrameworkNetCore\EasyTest\TestExecutor.v24.1.exe
If a test did not pass, then in addition to the log file, a screenshot (a JPEG file) is created, capturing the state of the application’s UI at the time of failure. The following image demonstrates how the test executor works.
Note
Build your solution in the EasyTest solution configuration before running the TestExecutor tool.
The test executor utility has the following command-line syntax:
TestExecutor.v24.1.exe <script_file> | <scripts_dir> [-p:<profile_name>] [-d:<script_line_number_to_stop>] [-l:<LogFileName>] [-o:<alias_name>=<alias_value>]
Parameter | Type | Description | Example |
---|---|---|---|
script_file | Required | Specifies the name of the script file containing the test that must be performed. | TestExecutor.v24.1.exe D:\MySolution.Tests\ContactTest.ets |
scripts_dir | Required | Specifies the name of the directory containing the script files to be executed sequentially. | TestExecutor.v24.1.exe D:\MySolution.Tests\ |
-p | Optional | Specifies the EasyTest configuration profile that must be used when performing a test. | TestExecutor.v24.1.exe D:\MySolution.Tests\ContactTest.ets -p:Global |
-d | Optional | Specifies that a test script should be run in debug mode. To start execution of the script, you will need to press the ENTER key after the “Press <Enter> to start test” message has been displayed. The script will be executed up to the line specified by this parameter’s argument. After that, the “Press <Enter> to process command” message is displayed and you will need to press the ENTER key after each script file line to continue script execution. | TestExecutor.v24.1.exe D:\MySolution.Tests\ContactTest.ets -d:9 |
-l | Optional | Specifies the XML log file name. If this parameter is not specified, the log file name specified in the TestExecutor.v24.1.exe.config is used. | TestExecutor.v24.1.exe D:\MySolution.Tests\ContactTest.ets -l:MyLog.xml |
-o | Optional | Overrides the value of an alias declared in the test configuration file. | TestExecutor.v24.1.exe D:\MySolution.Tests\ContactTest.ets -o:Port=4126 |
-c | Optional | Specifies the path to the test configuration file. | TestExecutor.v24.1.exe D:\MySolution.Tests\ContactTest.ets -c:D:\MySolution.Tests\MyConfig.xml |
Run Multiple Tests on Console
To run a single test script, pass its file name. To sequentially run all test scripts located within a certain directory, pass this directory name.
Note
EasyTest requires interactive UI on the test server (a user must be logged in).