LeanFT’s object identification center offers features that can give UFT’s object spy a run for its money !
You can invoke it by clicking the “HAT” icon on the Eclipse toolbar. After the Spy has opened, you can click on the Start Spying button to spy on a particular object.
In the below example, I spied on the Google search button on the google homepage and it shows all the properties of the button:-
After I click on the Sort by Recommended button as well as Edit Mode button, I will get check boxes in front of each property so that I can select which ones I will be using:-
As you can see above, clicking on the “STAR” icon on the right of a property will make it as a regular expression and we can use the standard ones like .* and others.
After we are done with the property selection, we can click on the highlight button to check whether the properties are fine or not. A New feature here is that if there are multiple objects matching the description, LeanFT will highlight all the objects rather than giving an error.
So now we have decided the properties and confirmed by highlighting, its time to click the Generate code button which will copy the Java equivalent of the code to our clipboard and we can readily use this in the test.
The code will look something like:-
browser.describe(Button.class, new ButtonDescription.Builder() .buttonType("submit").tagName("INPUT").name(new RegExpProperty(".*Search.* ")).build());
Happy Automating !