Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
3 years ago

Dragging of Jtable cell data on to other object

Hi,

 

I am struggling a lot to use the coordinates with Drag method. The desktop application does not support copy/paste action on the object and we have to drag the data on it.

I have attached an image. So, we have two objects in image, On top right, the object 1 jtable has few rows and we need to drag data from row 1...5 and col 1. (mean all cells in the first col). The height of each cell is 20 i.e each jtable cell is 20 + 20 + 20 and so on.

Now the problem is I am unable to quite understand the parameters in the drag method. Four parameters are required, the first two seems to be working, but last two creating problems in combination with the first two parameters.

 

I'm looking for a solution based on some equation using ScreenLeft and ScreenTop of both objects.

Can anyone help by suggesting an equation by looking at the attached image please. This is something I need to proceed with my next scenarios.

I'm using scripts and BDD scenarios.

 

Thanks in advance. 

  • Client X and Client Y are the position where your original value is. It clicks there, then drags the object to the new position toX and toY.

     

     

  • If you use Object Spy on the top right box, can you see the text that you need in one of the fields?

    • TestQA1's avatar
      TestQA1
      Frequent Contributor

      No I don't see the text. Unfortunately the table cells are not editable and neither we can paste data in them. So the AWTComponentAccessibleName is empty.

       

      But, for some other objects (where we want to drag something), the AWTComponentAccessibleName stores its title/label.

       

       

      • Marsha_R's avatar
        Marsha_R
        Moderator

        It doesn't have to be editable. Just looking for any object property that has the text you want. Post a screenshot of the Extended object spy please and let's take a look.