A LeanFT (now known as UFT Developer) application model project is made up of a hierarchy of test objects that correspond to the structure of the actual objects in your AUT or a specific area of the AUT. In this article, you will see how to create an Application Model Project in LeanFT.If you would have worked with UFT, you will feel that an application model in LeanFT works in the same fashion as using a shared object repository in UFT.
Adding a Synchronization point is a must thing to make your test scripts robust. Please refer to my post How to Use WaitUntil method in LeanFT to add dynamic wait in automation scripts rather than using hard wait.
Note: The screenshots in this article are of LeanFT. However, the steps of creating a project in LeanFT and UFT Developer are the same. Please select the relevant options while creating the project.
When a new LeanFT application model project is created, two files are created:
- .tsrx . An XML representation of the application model and its objects. It is similar to a shared object repository in UFT. This .tsrx file is empty when the application model project is created and it is automatically when you add new objects in it.
- .tsrx.cs( in visual studio) or .java. A file containing the code for the application model class.
Create Application Model Project in LeanFT | UFT Developer
Step 1: Go to File>New>Project
Step 6: Select the TestNG library and click on the Next button.If TestNG is not installed in the eclipse. Refer to my post Install TestNG in Eclipse IDE.
Step 9: Click on the Finish button. If you get another dialog box named “New module-info.java“, click on the “Don’t Create” button. The application model project will be created in the Package Explorer and an empty ApplicationModel.tsrx file would be displayed under com.test package. This is the object repository of the LeanFT project. You will see two packages with the same name com.test, one under the src directory, and the other one in appmodels directory. You can write your test scripts in your src directory.
Add Test Object To Application Model Or Create LeanFT Object Repository
Step 2: Object Identification Center (OIC) utility for the application model will open.
Step 3: Activate your test application and click on the hat icon on OIC to start spying test objects. Click on the required objects that you want to add them to the application model. Once you are done press the ESC key on the keyboard or stop the spying objects. You will see the added objects in the OIC.
Step 4: Click on the “Add Objects to ApplicationModel” button. All selected objects would be added to the application model.
Create First Test For Application Model Project
Steps to create a Test in LeanFT Application Model
Step 2: Enter a valid class name (LeanFTAppModelDemo) and click on the Finish button.
public class LeanFTAppModelDemoTest
public void test() throws Exception
ModifiableSDKConfiguration config = new ModifiableSDKConfiguration();
Browser browser = BrowserFactory.launch(BrowserType.CHROME);
//Instantiating an object of class ApplicationModel
ApplicationModel appModel = new ApplicationModel(browser);
//Accessing test objects of appmodel and performing required action
Step 4: Now run this script as TestNG Test. Do a right-click anywhere in the Test and select “Run As>TestNG Test”
Add a new Application Model Item in a LeanFT Application Model Project
Follow the following steps to add a new application model item in an existing LeanFT Application Model Item Project.
Step 1: Right-click on the package (com.test) and select New > Other.In the New dialog, select the LeanFT Application Model Item (or UFT Developer Application Model Project in the latest version) and press the Next button.
Step 2: Give the new application model item name and click on the Finish button.
Step 3: The new application model item will be added to the Eclipse project. Now you can add the test objects in it.
You can also refer to my post on Create a UFT Developer | LeanFT Testing Project & Write Your First Test in Java to create an automation script using descriptive programming.