Highlighted
Member.
542 views

Java table cell which has check box does not get clicked

Hi All,

I am facing a problem in automating the java application. I need to click a  checkbox which is in a cell of java table.  Below is the code I am using

JavaWindow("StructuredFlows -PO is").JavaTable("Product Details").ActivateCell "#2","Value"
wait 2
JavaWindow("StructuredFlows -PO is").JavaTable("Product Details").ClickCell "#2","Value"
JavaWindow("StructuredFlows -PO is").JavaTable("Product Details").SetCellData "#2","Value", true

If I run this ,  the cell is selcted but clicked in check box. Could some one help me with this?

 

Regards,

Arockiaraj M

 

0 Likes
3 Replies
Highlighted
Honored Contributor.
Honored Contributor.

So you say that the cell is selected (what does this actually mean,  what happens in the "selected" Java cell)  , but the checkbox does not get selected. 

Is there an offset between where UFT "selects" the Java cell, and the checkbox itself?? Physical , visible offset...?

I am thinking of being a bit creative here and sending you off to some mouse operations but first you need to answer these techincal questions for your application.

 

0 Likes
Highlighted
Member.

Hi 

Thank you for the reply.   The problem  that I face , I am seeing the respective cell is higlighted and teh above code which I mentioned is running without throwing any error. But I am not seeing the tick mark in the check box which is in the cell. If I click manually any where in the cell,  I could see the tick mark

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

OK.

When you see this happening, (the cell selection) can you verify the MOUSE is actually there?

If yes, then you make a workaround using mouse actions...

Find your current mouse position:

Set cursor = DotNetFactory.CreateInstance( "System.Windows.Forms.Control""System.Windows.Forms" )
Set point = cursor.MousePosition
X_ccord = point.X.ToString()
Y_coord = point.Y.ToString()


Send you mouse to your desired location, with or without offsets in X or Y:

 Set dr = CreateObject("Mercury.DeviceReplay")

dr.MouseClick X_ccord+offset_X, Y_coord+offset_Y, 0

button-(0=left; 1=middle; 2=right)

Tell us what you find from this...

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.