Customize test settings

Every testing project includes a test settings file (App.config or leanft.properties), which includes the runtime engine settings and run result report options. The settings options have default values, which you can customize according to your needs.

This topic is relevant for .NET and Java projects. For JavaScript projects, see JavaScript: Configure the runtime engine and HTML report.

Change test settings

The test settings file that you need to change depends on the project template that you are using:

  • NUnit/MSTest: App.config
  • JUnit/TestNG: leanft.properties

To change the test settings

  1. In your IDE, in your test project, open the test settings file, App.config or resources/leanft.properties.

  2. Remove the comment from the required setting and change the value. The initial values are the default values. For details, see Test setting options.
  3. Save your changes and Deploy the settings in the project's settings file.

Back to top

Deploy the settings in the project's settings file

Follow the instructions relevant for your IDE.

Visual Studio

If you modify the App.config file in your OpenText Functional Testing for Developers NUnit/MSTest project, follow the steps below to deploy the project's configuration together with your testing project.

Note: If you want to use the same settings for multiple testing projects, you can override the default test settings file (the project's local App.config) and instead use a centrally maintained App.config file. For details, see Externally maintained test setting files

To deploy your changes:

  1. Compile the project containing the modified App.config.
  2. If you are running your test on another machine or from another location, ensure that you deploy the compiled configuration file together with your testing project.

    In the App.config properties, make sure the Copy to Output setting is set to Copy Always. This copies the compiled myProjectName.dll.config file to the same location as the testing project (myProjectName.dll) when you build it.

    When you run the project, make sure that the corresponding *.config.dll is in the same folder.

Eclipse, Spring Tool Suite, JBoss Developer Studio, IntelliJ IDEA, or Android Studio

If you are working with a UFT Developer JUnit/TestNG project template, ensure that the resources folder is exported into the project .jar (this is the default).

The UnitTestBase class defines that the resources\leanft.properties file is used unless you provided an external .properties file when the project .jar runs, as described in Externally maintained test setting files).

Back to top

Test setting options

This section lists the default settings in the test settings file (App.config or leanft.properties) in your project.

SDK settings

Option Description
sdk mode

Determines how the OpenText Functional Testing for Developers runtime engine behaves during a run.

  • replay. In general, the mode should always be replay.
  • interactive. Used by the runtime engine for design-time tools that use the OpenText Functional Testing for Developers SDK, such as the Object Identification Center (OIC).

    In interactive mode, if a test object is not found, the runtime engine returns a failure immediately. It does not wait until the object identification timeout elapses.

Default: replay

connection address

The URL or IP address where the runtime engine is located.

Default: The local machine (ws://localhost:5095)

If you are running tests remotely using a secure connection, you must change this address. For details, see Run tests.

In addition, if you want to ensure a secure run, change the address to wss and make the appropriate configuration changes as described in the Security Reference, available from the OpenText Support Portal.

connection timeout

The maximum time to try to connect to the runtime engine at the specified connection address.

Default: 60 seconds

response timeout

The maximum time to wait for a response to any command sent to the runtime engine.

Default: 60 seconds

server autolaunch

Indicates whether the runtime engine is launched when the OpenText Functional Testing for Developers SDK is initialized.

Default: true

This is relevant only for local test runs.  When running tests remotely (that is, the runtime engine and the AUT are on a different machine than the test DLLs), this value must be set to false.

For more details, see Run tests.

Report settings

Option Description
report enabled

Indicates whether a report is generated for the test. The default is true.

If set to false, a report is not generated and all the report steps in the test are ignored.

separate-report

Indicates whether to generate reports for each test or class that ran as part of this test run, in addition to the report for the whole test run.

PerTest. In addition to the full report, generate a separate report for each test that ran as part of this test run.

PerClass. In addition to the full report, generate a separate report for each class that ran as part of this test run.

Off. Generate only the full report.

Default: Off

title

The title heading in the run results report. When not defined, the title displayed is Run Results.

Default: Empty

description

Text to be displayed directly below the title in the run results report.

Default: Empty

target directory

The root folder where run results report folders are generated.

Make sure you have write permissions for the specified folder.

Default: "."

If the default value is not modified

  • If an environment variable named LEANFT_REPORTS_TARGETDIR exists on the machine running the test, the value in that variable is used.

    This is useful when running tests using Jenkins or another CI system. For details, see: Run tests using a CI system.

  • If the environment variable does not exist, the report generates to the project output path.

report folder

The name of the generated report folder under the target directory.

Default: RunResults

override existing

Indicates whether the existing report folder is overwritten on each run.

Default: true

If this option is set to false, each report folder name gets an ordinal suffix.

filter level/ reportLevel

Indicates the minimal level of events to include in the report.

  • All. Every step performed on an object in the application is displayed as a node in the results tree.
  • Warning. Only steps with a warning or error status are included in the results tree.
  • Error. Only steps with an error status are included in the results tree.
  • Off. The run results report is not generated.

Default: All

Note: The steps reported based on this setting are in addition to steps added to the report using the Reporter.ReportEvent method.

snapshots level

Indicates when snapshots are captured for a step and displayed in the report.

  • All. Captures images for all steps performed on the application during the run.
  • OnError. Captures images only for failed steps.
  • Off. Images are not captured for the report.

Default: Off

Note: Snapshots are captured for each step after the relevant test object is identified.

Depending on the technology of the application being tested, the snapshot is taken before or after the operation is performed on the object:

Before: AI-based testing, and the following application types: .NET, AgGrid, Java, Mobile, Oracle, PowerBuilder, SAPUI5, Standard Windows, TE, UiGrid, Web.

After: Insight testing and SAPGUI and WPF applications.

Back to top

Externally maintained test setting files

If you want to use the same settings for all or many of your testing projects, it can be useful to maintain a single test settings file and supply that external configuration to all relevant testing projects.

Follow the instructions relevant for your IDE.

Visual Studio

  1. Create a testing project, and edit the App.config file as required.

  2. Compile the project and store the assembly in an accessible location.

  3. For each testing project, override the ConfigurationAssembly in UnitTestClassBase and provide the assembly containing the central App.config file:

    protected override Assembly GetConfigurationAssembly()
    {
    return Assembly.LoadFrom("MyCentralSettingsProject.dll");
    }

    You can also choose to override only the Report elements or only the SDK elements of the configuration, using the GetSdkConfiguration or GetReportConfiguration methods. For example:

    protected override SdkConfiguration GetSdkConfiguration()
    {
    return new SdkConfiguration(Assembly.LoadFrom("MyCentralSettingsProject.dll"));
    }
  4. Ensure that you deploy the referenced override assembly together with your testing project .dll.

Eclipse, Spring Tool Suite, JBoss Developer Studio, IntelliJ IDEA, or Android Studio

  1. Create a testing project, and edit the leanft.properties file as required.

  2. Store the properties file in an accessible location.

  3. When you run any testing project, pass the properties as an external variable using the lftConfigFile option.  When supplying an external .properties file, the file does not have to be named leanft.properties.

    Example (Windows): 

    java "C:\MyTests\MyTest1.jar" –DlftConfigFile="c:\tests\myConfig.properties"

Back to top

See also: