Share this page

# JavaScript: Configuring the UFT Developer runtime engine and HTML report

In this topic:

## Configure the UFT Developer runtime engine and HTML report

The LFT.init() method provides a default configuration for the UFT Developer runtime engine address and the HTML report of the test run's results.

You can customize these settings.

In the Command line

UFT Developer runtime engine address | In the command line, add the address, address, using the format used by the framework you are testing on. For example, in Jasmine, use the following format: `jasmine` `--address=``<path to` `UFT Developer runtime engine>:<port>`
Report fields | In the command line, add the report field and the value using the format used by the framework you are testing on. For example, in Jasmine, use the following format:
    jasmine --<report field>=<value>
Examples:
    jasmine --title="Run Results"
    jasmine --reportFolder=RunResults
For the report fields and descriptions, see the Report Settings section in Customize test settings. Note for Mocha users: Use mochaReporter.js to generate the report, as follows: `<node.js installation path><path to mocha module>``--reporter <path to UFT Developer mochaReporter.js>``--<report field><value>` For example: `"C:\Program Files\nodejs\node.exe" C:\Dev\node_modules\mocha\bin\_mocha --ui bdd --reporter C:\Dev\leanft\report\mocha\mochaReporter.js --title "Run Results"`
UFT Developer runtime engine autolaunch | Indicates whether the UFT Developer runtime engine is launched when the UFT Developer SDK is initialized. Default: true Example: jasmine --autoLaunch=false This is relevant only for local test runs. When running tests remotely (that is, the UFT Developer runtime engine and the AUT are on a different machine than the tests), this value must be set to false. Note: autolaunch is not supported in LFT.SDK.init(). For more details, see Run UFT Developer tests.

In a configuration file

1. Create a text file for JavaScript configurations. Call it, for example, JSconfig.json. If you already have one, open it.

2. Copy in the following code:

       {
       	"address":"ws://localhost:5095",
       	"autoLaunch": "true",
       	"report":{
       		"enabled":"true",
       		"reportFolder":"RunResults",
       		"title":"Run Results",
       		"description":"",
       		"targetDirectory":".",
       		"overrideExisting":"true",
       		"reportLevel":"All",
       		"snapshotsLevel":0
       		}
       }

3. Use this code as is, or modify the field values.

   Tip:

   - For report field descriptions, see the Report Settings section in Customize test settings

   - reportLevel can be "All", "Warning", "Error", "Off"

   - snapshotsLevel can be "All" or 0, "onError" or 1; "Off" or 2

     For example: snapshotsLevel:"All" or snapshotsLevel:0

4. Save the file.
5. In your computer's environment variables, add a user variable called LFT_TEST_CONFIG. For the value, enter the name of your configuration file, for example <path>\JSconfig.json.

Inside the test code

In the LFT.init() method, add the following code:

    LFT.init({
              address:'ws://localhost:5095',
              autoLaunch: true,
              report:{
    	           reportFolder:"RunResults",
    	           title:"Run Results",
    	           description:"",
    	           targetDirectory: ".",
    	           overrideExisting:true,
    	           reportLevel:LFT.Reporter.ReportLevel.All,
    	           snapshotsLevel:LFT.Reporter.CaptureLevel.All
                     }
              });

Tip:

- For report field descriptions, see the Report Settings section in Customize test settings

- reportLevel can be "All", "Warning", "Error", "Off"

- snapshotsLevel can be "All" or 0, "onError" or 1; "Off" or 2

  For example: snapshotsLevel:LFT.Reporter.CaptureLevel.All or snapshotsLevel:0

Back to top

## Override the default report settings during runtime

You can configure report settings in your test script so that, during runtime, these settings will override your project's default report settings.

You can configure the following settings:

- title
- description
- reportLevel
- snapshotsLevel

For example, to configure the report so that test object replay errors do not appear in the report, you can include the following in your test script:

    LFT.Reporter.config().reportLevel = LFT.Reporter.ReportLevel.Off;

Note:

Make sure to add LFT.init() to your code before you configure the report settings.

The reportFolder, targetDirectory, and overrideExisting settings cannot be configured to override the default report settings. Attempting to configure these settings will throw an exception.

Back to top

See also:

- UFT Developer JavaScript SDK

https://admhelp.microfocus.com UFT Developer 8942
Tips to improve your search results... UFT Developer Help Center UFT Developer Help 15.0-15.0.2 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: