Description programming in leanft in Java

Usually in UFT, we use object repository (Application model in LeanFT) to store the objects inside application. So we can use those objects in automation code but we can also use description programming to define new test objects in the code itself. Below example shows how to define new test object using description programming in LeanFT. We have used description programming to define 2 objects of type – EditField and Link. Note that we can multiple property-value pairs to identify the objects.
 
//Navigate to https://www.softpost.org/selenium-test-page/
browser.navigate("https://www.softpost.org/selenium-test-page/");
browser.sync();

//Build edit box object and set value in it
browser.describe(EditField.class,new EditFieldDescription.Builder()
.id("fn").build()).setValue("Sagar");

//Build link object and click on it.
browser.describe(Link.class, new LinkDescription.Builder()
        .tagName("A").innerText("Home").build()).click();  
        
Complex problems, Simple Solutions