Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Visitor.. Aloysius

Problem clicking Java app button with LeanFT

Hi, I'm a fairly new user to LeanFT but I have used UFT and QTP in the past for many years.  I'm working on getting LeanFT integrated in with our custom Java automation framework but I'm running into issues.

This is all using 14.51 version of LeanFT and UFT

I'm running into issues with a couple of Java button objects that work fine in UFT.  The click method call is not actually performing a click on the object, or at least the button object is not registering the click.  I have verified that it is finding the correct object by calling the highlight method and visually seeing that the correct button is highlighted.  Also after click is called focus does switch to the button as it has the visual focus dashed lines around button text, so the click is interacting with the button in some way.  I have also tried converting a UFT Object Repository that contains the button object to a LeanFT Application Model and using the application model approach to identify and click the object but I have the exact same result .  I've even went so far as to do a record and playback using LeanFT and still get the same results using the code generated from the record and playback.

UFT has absolutely no issue clicking this same Java button ojbect.

UFT Object Repository identification properties used that works in UFT:
JavaWindow("AUT"): *Parent window object
to_class: JavaWindow
title: AUT
No visual identifier
Enable Smart Identification: False

JavaButton("New"): *Button to click
to_class: JavaButton
label: New
No visual identifier
Enable Smart Identification: False

LeanFT descriptive identification taken from LeanFT Object Identification tool:
import com.hp.lft.sdk.java.*;

Button newButton = Desktop.describe(Window.class, new WindowDescription.Builder()
.describe(Button.class, new ButtonDescription.Builder()

newButton.click(); --Click is not working


My last approach was to straight convert the UFT OR with the button object that works to the LeanFT app model but I get the exact same results.  Doesn't seem to matter which approach I use to identify the object, the click doesn't work.  I've also tried doubleClick() and calling click() multiple times on the ojbect.

I'm not really sure what else I can try with this.  Anyone have any ideas for me to try out?



2 Replies
Micro Focus Expert
Micro Focus Expert

Re: Problem clicking Java app button with LeanFT



If highlight operation is working for you, that means that the description is correct.

This sounds like a focus issue to me.

How are you executing your test? from an IDE? maybe the IDE is taking the focus? does your application becomes the top window during the test?

Maybe try to create a JAR artifact of your test and then execute it from the command line to eliminate the possibility of the IDE stealing the focus during the execution.

Also if you do have UFT installed, it would be helpful if you could try the same scenario in UFT using descriptive programming and let me know if that works (that simulates what LeanFT is doing more accuratly).




Visitor.. Aloysius

Re: Problem clicking Java app button with LeanFT

Hi Anton,

Thank you very much for you reply.  

It is running from an IDE, IntelliJ to be specific.  The application does has focus while the test is running.  In fact the test has multiple Java object interaction steps leading up to the button clicks that are not working.  Throughout all of those steps the AUT has focus.

I did run a test in UFT using descriptive programming 


The click worked as expected.

I am going to continue to dig into this today in hopes of finding some solution.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.