Working with LeanFT Reports

Hello Friends,

we will discuss about LeanFT reports in this article,

When you create a LeanFT project from the existing templates, LeanFT will automatically configure the generation of the HTML reports. When you run this project HTML reports will be generated under bin\debug\RunResults\runresults.html.

The generated reports will look like this


How it works?

LeanFT installation will copy classes which can be used for the generation of the tests. LeanFT’s main classes for the report generation will reside in “HP.LFT.Report” for .Net and “” for Java.

With template projects

When you use the installed templates for the creation of the tests, LeanFT will automatically generate the reports at the end of the executions.

For automatic generation of results LeanFT templates will extend the Test Class with UnitTestClassBase, this base class will initiate the reporter class and will generate the results automatically at the end of the executions.

Because initializations are already done, we can use the reporter methods directly to report the events.

Reporter.ReportEvent “Test Step”,”Test Description”

Now this is very similar to what we have used in UFT.

Without Template projects

When you don’t use the installed templates then you will have to add the reference of the libraries to the project and call the SDK.Init and Reporter.Init methods for the initialization of the LeanFT SDK and Reporter object.

.Net SDK’s are available below

LeanFT installation>\SDK\DotNet

Java SDK’s are available below

LeanFT installation>\SDK\Java

You should initialize the Reporter Object if you want to generate the reports.

Custom code for your own framework will look like this

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HP.LFT.Report;
using HP.LFT.SDK;
using HP.LFT.SDK.Web;
using HP.LFT.Common;

namespace ConsoleApplication1
 class Program
 static void Main(string[] args)
 //initialize the sdk and report here
 SDK.Init(new SdkConfiguration());// Modify the SDK with default values.
 Reporter.Init(new ReportConfiguration());// Initialize the Reporter with default values

 //Test goes here
 IBrowser OBrowser = BrowserFactory.Launch(BrowserType.InternetExplorer);

 Console.WriteLine("Navigating to");



 Reporter.ReportEvent("Browser Sync", "Browser sync completed", HP.LFT.Report.Status.Passed);


 //test code

 Console.WriteLine("Generatig reports and closing SDK");

 Reporter.GenerateReport(); //Genera

Now once you initialize the Reporter Object, you can use all of the available methods and properties for it.

Changing the report configuration settings

You can change the following configurations for the reporter object

  • Title : Title of the reports
  • Description : Text below the title of the reports
  • Report Folder: Name of the generated report folder under the target directory.
  • Override existing: If this option is set to true, LeanFT will overwrite the results of previous run.
  • Report Level: This the reporting level for the generated reports. This supports the following four arguments.
    1. ALL: Report everything.
    2. Warning: Report only errors or warnings.
    3. Error: Report only errors.
    4. Off: No Report will be generated.
  • Snapshot level: This argument will decide, for what snapshots will be captured.
    1. All: for each step.
    2. OnError: for errors.
    3. Off: No snap shots.

With template projects

If you are using the template project, the easiest way to change the report configuration settings will be to change the test configuration settings.

You can find these settings in the app.config file for C# and leanft.project file for java.

Without template projects

If you are not using the template projects, then you can create new configuration during the initialization of the Reporter object.

static void Main(string[] args)


SDK.Init(new SdkConfiguration());// Modify the SDK with default values.
Reporter.Init(new ReportConfiguration


Title = "SumeetKushwah.Com test execution results",

Description = "This is an automation blog",

IsOverrideExisting = true,

ReportFolder = "WebappResults",

ReportLevel = ReportLevel.All,

SnapshotsLevel = CaptureLevel.All,


//test code
Reporter.GenerateReport(); //Generate the Report
SDK.Cleanup(); //Cleanup the SDK


Let me know, if you have any question.


2 responses to “Working with LeanFT Reports

  1. Hello Sumeet,

    The reports generated by UFT for a test scenario is generically named as run_results.html, Is there a way i could configure with in UFT to save the HTML file as the name of the test.?, Please advise.

    Due to its nature of saving generically, Running test suites with multiple test cases caused confusion when the reports are mailed out as attachments.

    I had tried the generation of results in Word and Pdf, still it remains to be the same.

    Liked by 1 person

  2. Hi, what version of LeanFT are you using here. With 14.0 version and by following the same code above, I cannot get the report generated.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s