public Element tableCell ( int rowNum , int colNum ) { Element row = tableRow ( rowNum ) ; if ( row == null || numOfTableColumns ( ) < colNum ) { return null ; } Element thCells = row . findChild ( app . newElement ( Locator . TAGNAME , "th" ) ) ; Element tdCells = row . findChild ( app . newElement ( Locator . TAGNAME , "td" ) ) ; if ( thCells . get ( ) . matchCount ( ) > colNum ) { return thCells . get ( colNum ) ; } else { return tdCells . get ( colNum - thCells . get ( ) . matchCount ( ) ) ; } }
Retrieves a specific cell from the element . If the element isn t present or a table or the row and cell combination doesn t exist a null value will be returned .