Sunday, July 24, 2011

How to select a check box\click a link in a web table with text

This is one of the most common interview question.
The first column of a web table contains checkboxs, and in the second column have some text.
If any row in the second column contains a text say "uday", then the corresponding checkbox in the first column should be selected.
How can we do that?

It is pretty simple: :)
rowNo=B().P().WT().getrowwithcelltext("uday",2) 'Here "uday" is my search string and 2 the column number
set childObj=B().P().WT().ChileItem(rowNo,1,"webcheckbox")
childObj.set "ON"

No comments: