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.
Ricardo_R5
Visitor.
85 views

LeanFT Java.IButton.click() fails inside a cycle

Hi,

I have a for each cycle which should go thrue a List and search and item then click a java.IButton.

Everything works fine for the first iteration, but on the second iteration leanft fails to detect the button object and throws the following exception:

HP.LFT.SDK.ReplayObjectNotFoundException : Cannot identify the object "Java.IButton".
Verify that this object's properties match an object currently displayed in your application.

 

 

My cycle:


for (var i = 0; i < list.Count; i++)
            {
                appmodel.MainPage.MenuLeft.ButtonClear.Click();
appmodel.MainPage.MenuLeft.TxtBoxGID.Click(); appmodel.MainPage.MenuLeft.TxtBoxGID.SetText(list[i].ToString()); appmodel.MainPage.MenuLeft.ButtonSearch.Click(); Thread.Sleep(1000); }


why does the ButtonClear fail to be clicked on the second iteration but not on the first?

I also tried to use foreach instead with:

 

foreach (var item in list)

but it also fails

0 Likes
3 Replies
Ricardo_R5
Visitor.

Re: LeanFT Java.IButton.click() fails inside a cycle

So here is what i found, by using the app model it fails, but if i describe the objects inside the cycle it works.

Why? i don't know.

0 Likes
Ricardo_R5
Visitor.

Re: LeanFT Java.IButton.click() fails inside a cycle

Any idead why it behaves like this?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: LeanFT Java.IButton.click() fails inside a cycle

Hello Ricardo,

 

Could you please provide the code with the describe statements that is working for you and your tsrx (AppModel) file?

 

Thanks,

Anton

0 Likes
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.