def main():
simulator = startApplication("Contacts~iphone")
waitForApplicationLaunch()
o = waitForObject({"type": "UITableView", "visible": 1})
c = get_uitableview_cell(o, 0, 0)
test.log("cell.accessibilityLabel: %s" % c.accessibilityLabel)
def get_uitableview_cell(uitableview_obj, section_index, row_index, verbose=True):
if verbose:
test.log("get_uitableview_cell(): Number of sections in UITableView: %s" % uitableview_obj.numberOfSections())
for section_index in range(uitableview_obj.numberOfSections()):
section_rows = uitableview_obj.numberOfRowsInSection_(section_index)
test.log("get_uitableview_cell(): Rows in section #%s: %s" % (section_index, section_rows))
index_path = NSIndexPath.indexPathForRow_inSection_(row_index, section_index)
data_source = uitableview_obj.dataSource
cell = data_source.tableView_cellForRowAtIndexPath_(uitableview_obj, index_path)
return cell