Forum Discussion

DenisMedvedev's avatar
DenisMedvedev
Contributor
9 years ago
Solved

How to get Jtable element?

 

I Have a Jtable and bellow code doesn’t work. What I’m doing wrong?

JTable = Aliases.Application.bla-bla-bla.CustomerSection.CustomerGITable

I also tried JTable = CustomerGITabl.PanelViewport, CustomerGITabl.PanelViewport.CustomertableRows and I weren’t able to get cell element

 

  var  i
  i = JTable.FindRow("Phone", '');
  if (i!=-1)
  {
    JTable.wValue(i, "Phone") = "1234567800";
    JTable.wValue(i, "Fax") = "885614";
    PostRow(JTable, i); 
  } 

 

I have "Unable to find the object FindRow("Phone", ""). See Additional Information for details." error  

 

  • joseph_michaud's avatar
    joseph_michaud
    9 years ago

    Right.  JTable is not a JTable.  It's a JScrollPane.

  • baxatob's avatar
    baxatob
    9 years ago

    Check the childs of JScrollPane. JTable can be among them.

10 Replies

  • Using the same approach I got element in testcomplete example (“C:\Users\Public\Documents\TestComplete 11 Samples\Desktop\Working With Grids\JTable”)

     

    But in tested app I’m not able to repeat it. Any Ideas?

    Will be glad to have any help.

    Thanks in advance, Denis

    • baxatob's avatar
      baxatob
      Community Hero

      Looks like you have received the error, because the specified value was not found and FindRow returned -1.

      Can you obtain the value of the particular empty cell by using JTable.wValue(row, col)?

      • DenisMedvedev's avatar
        DenisMedvedev
        Contributor

         

        var JTable;
        JTable = NameMapping.Sys.Application..CustomerGlSection.CustomerTable
        
        var phone = JTable.wValue(0,0)

        No, I have waiting for wValue(0,0) pop-up and then “Unable to find the object wValue(0, 0). See Additional Information for details.”