Forum Discussion

tsan123's avatar
tsan123
Occasional Contributor
8 years ago

Selecting a Cell from Grid view

Is their a best way to select checkbox of a sub cell from a group of Cells in a Grid View in test Complete.

 

Scenario is i have a Grid that has 20 cells and in each cell has a sub cell and then a content Text.

 

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    > Is their a best way to select checkbox of a sub cell [...]

    Assuming that you are testing a web application:

    The approach well may be as straightforward as it sounds - find required row/cell in the table (you may use http://support.smartbear.com/testcomplete/docs/app-testing/web/general/examples/parsing-html-tables.html as a sample) then, for the found cell, search for the child checkbox (for example: cell.FindChild("ObjectType", "Checkbox", 5)) and use .Click() to select it or clear selection.

     

  • shankar_r's avatar
    shankar_r
    Community Hero

    Can you post of snapshot of the Grid or its properties in Object browser, So that we will try to help you.

      • shankar_r's avatar
        shankar_r
        Community Hero

        Hi,

         

        Looks like it doesn't have any sub cell, 1st Column of your grid is the checkbox column.

         

        Try using tableObject.ClickCell(0,0) this will click the 1st row's checkbox