| || |
I am trying to verify that a row that contains a certain value in one of the cells does NOT exist. So I'm using the GetRowWithCellText method. Even though the row doesn't exist, QTP is not returning a -1. It returns a value of 19. Now in the 19th row, there is a cell with a value that is almost what I was looking for but not exactly. For example:
I'm searching for "Davis Middle School" which doesn't exist in the table.
On Row 19, there is a "Davis Middle School1"
I've tried to specify the column number but didn't help.
Anyone have any ideas?
<font class="small">Code:</font><hr /><pre>
Row = .WebTable("html id:=schoolList").GetRowWithCellText("Davis Middle School",2) 'Returns 19
Row2 = .WebTable("html id:=schoolList").GetRowWithCellText("Davis Middle School1",2) 'Also returns 19
It's just doing a containing string search, so it does exist.
You'd have to follow up and read the contents of the cell in the row it identifies as containing and do an exact string comparison.
The GetRowWithCellText method doesn't look for exact match but for partial match.
You have to loop through the Cells using GetCellData.
I see. Thanks for all your help. Would be nice if the QTP help would've said that.