Forum Discussion

agoyal's avatar
agoyal
New Contributor
11 years ago

Can't get the cell value of JAVA Swing object Table.

Hi,



I am working on a windows application having, biut on JAVA swing objects, it has a Table I can get the object of table also using functions like


getColumnCount(), getRowCount(), I can get teh no of columns and rows in table, but not getting how to read through the values of tables. table has embedded, edit field, JCTable, Checkbox and Drop downs in it.

 


  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Anuj,


     


    You should be able to use some native properties or methods to get the target data. Try exploring TestComplete's Object Browser to find the needed one. To make sure that you see all properties/methods of the object, switch to the Advanced View mode and make TestComplete show hidden properties (Tools | Options | Engines | General | Display members | Show hidden members). Also, I suggest that you read the "Addressing Objects in Java Applications" article.

  • agoyal's avatar
    agoyal
    New Contributor
    Thanks Tanya,



    I did try things, some of things started working after object mapping. Still working on it. will let you know if got any furthur issues in it.



    Thanks
  • Hello Tanya,



    The same issue has been observed with SwingObject("Table") in my case. After analyzing several methods, there is no method present to fetch cell value directly. Also when tried referring http://support.smartbear.com/viewarticle/55906/ , the sample example on the PC uses wValue property. However in my case, wValue property is not present. I am using TC9.3 version.



    Can you please help me to resolve the issue?



    Thanks,

    Swapnil

    • ajitkumar163's avatar
      ajitkumar163
      Occasional Contributor

      Hi,

       

      you can use "CellItemTxt=TableObj.getValueAt(i, j).toString.OleValue " to get the cell value from java table

       

      CellItemTxt will store the retrieved value

      i and j are the row and column

       

       

      Thanks,

      Ajit