LeanFT ApplicationModel project setup and overview on ECLIPS.

Hello, lets look at how to create your first test using application model with LeanFT step by step.

Once you install and configure the LeanFT for eclips ( LeanFT quick setup for ECLIPS IDE) you can create new ApplicationModel project.

  • Select  file -> new -> Project in ECLIPS IDE.
  • Select ApplicationModel Project
  • newProject
  • you can opt out Maven project or you can choose maven depending on your project requirement, I am going ahead without maven since it is just for demo.
  • CAUTION : If you are creating without maven, then you might have to add decencies manually.
  •       MavenProject
  • Give a name to project and give a package name (example com.demo) After click on finish you should see project default structure like below.
  • ProjectDefaults
  • Now if you see the com.demo it is disabled and it contains the application model which is nothing but object structure or object repository in old UFT terms.
  • ApplicationModel
  • As you see you have Hat icon and + icon on the top right side of the Application Model which indicates Inspecting and  Adding the objects to Object Repository.
  • Lets look at test case where we want to open googole site and search for LeanFT.
  • Lets first make sure in the system tray  LeanFT runtime Engine is running. As discussed in earlier post, leanFT runtime engine is responsible for the identifying the objects and running the created tests.
  • SystemTray
  • We must select web engine in the UFTRuntime settings so that objects will be identified as web objects. Right click on the icon in system tray and select Web as option, once you do it Runtime Engine will automatically restarts. If not do it manually and check if all objects are identifying as web objects.
  • DefineENgine.PNG
  • To create test first we need to define UI objects and pages you want to test on.
  • Lets click on Had Icon to identify the objects, and use add icon (+CUBE icon) on the inspect screen to add objects. Add text box object and google search button too.
  • googleTextBox
  • Once you add objects, you should see Application Model as follows.
  • AddedObjects
  • Notice few things here
    • WebPages – Hierarchic objects
    • WebElements – Child elements in the WebPages.
  • In the left hand side, you see name and Code name, Code name is what we use to invoke the object, it is like function that returns this object.
  • LeanFT automatically creates the associated page classes and creates objects in ApplicationModel.java class.
  • Do not modify this class as code gets regenerated everytime you update ApplcationModel.
  • ApplicationModel_Class
  • Now lets look at test case and some of the jar files that are needed to run the test cases.
  • The ApplicationModel.java has all methods that returns the UI objects with code names.
  • TestClass can make use of it and create test cases. Following is the way to generate the test case.
import java.net.URI;
import java.net.URISyntaxException;
import org.junit.Test;
import com.demo.ApplicationModel;
import com.hp.lft.report.Reporter;
import com.hp.lft.sdk.*;
import com.hp.lft.sdk.web.*;
import com.hp.lft.sdk.GeneralLeanFtException;
import com.hp.lft.sdk.web.Browser;
import com.hp.lft.sdk.web.BrowserFactory;
import com.hp.lft.sdk.web.BrowserType;

public class TestClass { 
public void test() throws Exception 
Browser browser = BrowserFactory.launch(BrowserType.CHROME); 
ApplicationModel app = new ApplicationModel(browser); 

in the above @Test method, you can see application model app is being created as object.

After creating the “app” object, the first thing model returns is pages, and each page returns all objects in it. You can invoke the object with their code names and perform actions on it.

Going back to import statements , there are are lot of them, along with already loaded jar files. LeanFT requires these jar files to include in the test to avoid sdk loading issues.


After adding you project should look like below.


Now you are ready to start the execution of created test.

When you run your tests you might get following exception for loading sdk. Also you might not see view las run results enabled.

SDK Load Issue

to avoid above issues, include loading sdk and generating report part through code. I have got this from micro focus site after running around few hours. Please find below link for detailed explanation. I have added code from same to my test and it worked like charm.

load SDK

@Test public void test_modified() throws Exception 


//code to resolve sdk lodaing issues 
ModifiableSDKConfiguration config = new ModifiableSDKConfiguration(); 

Browser browser = BrowserFactory.launch(BrowserType.CHROME); 
ApplicationModel app = new ApplicationModel(browser); 

//Code to generate report and cleanup 

Now the issue got resolved and I got the report link enabled after I run the script. if it is not enabled we can get the latest report from RunResults directory. Sample leanFT report for the above test will look like below.


This is how we can quickly setup the project for leanFT and execute the tests for Application model.


LeanFT quick setup for ECLIPS IDE

Hello, recent days I have been working with LeanFT and faced some hiccups in installing configuring and setting up for ECLIPS IDE.

LeanFT is plugin for integrated development environments. It supports ECLIPS and MS Visual Studio and ItelliJ.

In this blog, I will quickly discuss about setup for ECLIPS IDE and issues I have faced with step by step instructions.

  1. First of all we have to down load ECLIPS IDE. As per LeanFT documentation ECLIPS Oxygen 32 bit version is most supported. you can view from the same.                Eclips download link
  3. Now got to micro focus site and download the LeanFT installable.
  4. In the installation follow the instructions carefully to avoid the issues later.
  5. The most important instruction is, you have to select the path of the ECLIPS exe folder.
  6. You might have several ECLIPS installations, but which one you want to use it, carefully keep the same path and use the same ECLIPS exe to see the LeanFT plugin.
  7. After installation, restart the machine.
  8. Boom!! now if you open LeanFT menu will appear in ECLIPS. But, unfortuantely we have few more steps to see the LeanFT plugin.
  9. Download and copy (gson-2.8.1.jar) file to plugins directory in ECLIPS folder, it is mentioned as known sssue in the leanFT instructions manual a, see below.    LeanFT KnownIssues


9. Once everything is done, lets open the ECLIPS exe. There is another .exe file gets generated in the ECLIPS directory, see below.

ECLIPSFolder10.  Use eclipsec.exe to launch the IDE.  You should see below menu in the ECLIPS.


11. You should see leanFT related projects when you click File->New->Project from ECLIPS. See below


12. LeanFT is UFTPro, if you are worked with UFT its like cake walk for automating anytype of project, if you are UFT guy better to start project as Application Model project.

13. In LeanFT, there is run time engine called LFTRuntime, when you start project LFTRuntime will start on port 5095. This is responsible for detection of objects and running the created tests. Lets see how to kick start project as Application Model project and resolving starting hiccups in next section.