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

 

  • 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.

     

  • 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

  • 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...