Reports in leanft in C sharp

We can customize the HTML report generated by LeanFT in various ways as shown in below example. ReportConfiguration class allows you to configure the report name, target directory, report level etc. We can log custom messages in the report using Reporter.ReportEvent method. Note that ReportEvent method can also take a screenshot image as a parameter Here is the HTML report generated by above code.
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using HP.LFT.SDK;
using HP.LFT.Report;
using System.Diagnostics;
using System.Threading;
using HP.LFT.SDK.Web;
using System.Drawing;

namespace LeanFtTestProject1
    public class Reports
        public void TestReports()

            SDK.Init(new SdkConfiguration
                ServerAddress = new Uri("ws://localhost:5095")

            ReportConfiguration r = new ReportConfiguration();
            r.IsOverrideExisting = true;
            r.Title= "My LeanFT Report";

            IBrowser browser = BrowserFactory.Launch(BrowserType.InternetExplorer);

            // Navigate to

            // Find edit box using Xpath
            IEditField firstName = browser.Describe<IEditField>(new EditFieldDescription
                XPath = "//input[@id='fn']"


            Image img = browser.GetSnapshot();
            Reporter.ReportEvent("Setting value in edit box", "", Status.Passed, img);



Web development and Automation testing

solutions delivered!!