Forum Discussion
gk1970
15 years agoOccasional Contributor
That's done Jared .Thanks But if I want to click the pagination links,that's also working,but once I reference the table object to try & get the rows and cells ,VBScript error 'Unspecified Error' comes up.I checked exists property,returns true ,but rows.length is throwing the 'Unspecified error exception'.Please review the function below for your review.I use this function to loop thro,after getting page and table.First page is ok,if data is not there,it clicks the Next pagination link,from there the above error related to tableobj appears
Function LoopCells(tableobj,matchtext)
if tableobj.exists Then
Log.Message("tableobj exists ")
Log.Message(tableobj.rows.length) ' This gives error
end if
For i = 1 To tableobj.RowCount-1
'Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table("SearchHdr").Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(0).Table(2).rows.item(i).cells.length
Set row=tableobj.rows.item(i)
'MsgBox(tableobj.rows.item(i).cells.length)
For j = 0 To Row.cells.length - 1
' get the cell
Set cell = row.cells.item(j)
Log.Message "Cell " + ": " + Cell.innerText
if (Cell.innerText=matchtext) Then
Result = CBool(1 + 1 = 2)
LoopCells=Result
exit function
else
Result = CBool(1 + 1 = 5)
LoopCells=Result
end if
Next
Next
End Function
Function LoopCells(tableobj,matchtext)
if tableobj.exists Then
Log.Message("tableobj exists ")
Log.Message(tableobj.rows.length) ' This gives error
end if
For i = 1 To tableobj.RowCount-1
'Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table("SearchHdr").Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(0).Table(2).rows.item(i).cells.length
Set row=tableobj.rows.item(i)
'MsgBox(tableobj.rows.item(i).cells.length)
For j = 0 To Row.cells.length - 1
' get the cell
Set cell = row.cells.item(j)
Log.Message "Cell " + ": " + Cell.innerText
if (Cell.innerText=matchtext) Then
Result = CBool(1 + 1 = 2)
LoopCells=Result
exit function
else
Result = CBool(1 + 1 = 5)
LoopCells=Result
end if
Next
Next
End Function
Related Content
- 5 months ago
- 2 years ago
- 11 months ago
Recent Discussions
- 10 hours ago
- 11 hours ago