Forum Discussion

mczerwin's avatar
mczerwin
New Contributor
11 years ago

Getting the cell data from a table

I have the following GUI object structure name mapped

Device

   Process

      window0

          tableview

             tableviewcell

                  scrollview

                       lable

I would like to write a function to get the cell data from the table for the cell position that is passed in. The particular cell text is contained in "lable" in the ObjectText. Any help would be greatly appreciated. Thanks.

3 Replies

  • Hi Mark,

     


    Are you testing the iOS app? TestComplete officially supports the UITableView control. Please refer to the "iOS TableView Support" article to make sure that this table is used in your app. You can try using the wItem property to get the value of the specified cell. Here is an example from the "wItem Property (iOS TableView Controls)" article:


     


    //JScript


    function Test()


    {


      // Select the mobile device


      Mobile.SetCurrent("iPhone");


      // Obtain the TableView object 


      var p = Mobile.Device.Process("SampleApp");


      var tableview = p.Window().TableView();


      


      for (var i = 0; i<tableview.wSectionCount; i++)


      {


        Log.Message(tableview.wSection(i));


        for (var n = 0; n<tableview.wItemCount(i); n++)


        {


          Log.Message(tableview.wItem(i, n));


          Log.Message(tableview.wItemDetail(i, n));


          Log.Message(tableview.wItemSelected(i, n));


        }


      } 


    }




     

  • mczerwin's avatar
    mczerwin
    New Contributor
    Thanks for the info. I'm getting nothing returned using wItem. I think its because theres a scrollview there before you get to the actual value in the cell