Forum Discussion
3 Replies
Sort By
- tonydugayContributorHere is some code that I use - you might find it useful - it finds the column index of a named column assuming the heading is in the top row - it will need some tweaking to do exactly what you want (I am using JScript and have defined some constants etc):
//looks in the top row for the heading provided and returns the column index (zero based)
function findColumnHeading(name, table) {
table.WaitProperty("Exists", true, MEDIUM_LENGTH_TIMEOUT);
table.WaitProperty("VisibleOnScreen", true, MEDIUM_LENGTH_TIMEOUT);
var numColumns = table.ColumnCount;
for (var i = 0; i < numColumns; i++) {
if (table.Cell(0, i).contentText == name) {
return i;
}
}
} - jorgesimoes1983Regular ContributorUse the Object Browser to inspect your page/application
- chrisbRegular ContributorAs Jorge suggested, use the object spy and examine all the properties of the table cells. Examine the table cell with object spy and use the search feature to look for 'RowIndex' and 'ColumnIndex'. I'm taking a guess as what type of app you are testing but you might find these properties.
Related Content
- 3 years agoChristineB
- 10 months agoLuukdb
- 2 years agoShahZaib
Recent Discussions
- 2 days agoMW_Didata