# Use your own frameworks with LeanFT

When you create your tests using the LeanFT project templates provided with the LeanFT plugin, your projects are created with everything you need to use the LeanFT SDK, communicate with the LeanFT runtime engine, and generate LeanFT HTML run reports.

You can also work with LeanFT using your own frameworks. You can build on top of the LeanFT-provided templates or create everything from scratch.

In this topic:

## Initialize the SDK

1. Reference the SDK files:

   Visual Studio | Add references to the DLLs located in: <LeanFT installation>\SDK\DotNet
   Eclipse, Spring Tool Suite, JBoss Developer Studio, or IntelliJ IDEA | Add the jar files (except the javadoc.jar) from: <LeanFT installation>\SDK\Java to your build path

2. Use SDK.Init to initialize the SDK:

   SDK.Init applies the required test settings and enables communication with the LeanFT runtime engine.

   You must initialize the SDK once, at the beginning of each run.

   If you want to use default values for the SDK, you need only the following line to initialize the SDK:

   SDK.Init(new ModifiableSDKConfiguration());

3. Optional. To generate the LeanFT HTML report:

   - Initialize the report by running Reporter.Init after SDK.Init at the beginning of each run.

   - Use the relevant ReportConfiguration and Reporter properties and methods to control the way the report is generated. Make sure to use Reporter.GenerateReport as shown in the examples below, to ensure the report gets generated. For details, see the relevant SDK reference.

Back to top

## Initialize the SDK and report - Code samples

The samples below demonstrate how to initialize both the SDK and Report, and to modify one of the SDK default values:

SDK+Reporter.Init Code Sample (C#) :

    public void Test()
    	{
    	//Initialize the SDK and report once per process

      //Modify the default value for the SdkConfiguration ServerAddress

      //Initialize the Reporter with default values
    		SDK.Init(new SdkConfiguration
    		{
    			ServerAddress = new Uri("ws://myServerAddress:5095")
    		});
    			Reporter.Init(new ReportConfiguration() {
    			TargetDirectory = "C:\Results\"
    		});
    		//Put your test code here

              //Generate the report and cleanup the SDK usage
    		Reporter.GenerateReport();
    		SDK.Cleanup();
    	}

SDK+Reporter.Init Code Sample(Java):

        public static void main(String [] args){
            // initialize the SDK and report only once per process
            try{
                ModifiableSDKConfiguration config = new ModifiableSDKConfiguration();
                config.setServerAddress(new URI("ws://myServerAddress:5095"));
                SDK.init(config);
                Reporter.init();

                //put your test code here.

                //Generate the report and cleanup the SDK usage.
                Reporter.generateReport();
                SDK.cleanup();
            }
            catch(Exception e){
            }

Back to top

See also:

- LeanFT with Cucumber

https://admhelp.microfocus.com LeanFT 8942
Tips to improve your search results...TOC Lean Functional Testing Help Center LeanFT Help Center 14.50 - 14.53 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:(Undefined variable: _rscC_Basic_Variables.FloatingTocShow)