I have the following code that searches a table that can be indexed by pages. What I do not know what is the return value of myTable.Find.ByContent when the search string is not matched. Also what’s a slick way to do an index search in the pages till the string is found. I want to mimic what a user would do in index.
Thanks,
John
Dim MySearchString as StringMySearchString = "Start All over III"' Copy the table into a local variable to make it easier to work withDim myTable As HtmlTable = Pages.JointCommissionResources9.CphTracerPageRadMyOrgTracesTable' Locate the row we want using text content (Enter the String to search byDim row As HtmlTableRow = myTable.Find.ByContent(Of HtmlTableCell)(MySearchString).Parent(Of HtmlTableRow)()' Locate the delete icon (which is going to be just an anchor tag) located in the third column of the current row'Dim link As HtmlAnchor = row.Cells(5).Find.ByExpression(Of HtmlAnchor)("uniquename=UrgbtnEditResponse")'uniquename="UrgbtnNewResponse"Dim link As HtmlAnchor = row.Cells(5).Find.ByExpression(Of HtmlAnchor)("uniquename=UrgbtnNewResponse")'Dim link As HtmlAnchor = row.Cells(4).Find.ByExpression(Of HtmlAnchor)("value=Print/Preview")' Now that we've found it, click the delete iconlink.Click()HtmlTableCell Find By Search StringDim MySearchString As StringDim PageNumber As IntegerMySearchString = "this is a new tracer"Log.WriteLine("Value: " & MySearchString)Log.WriteLine("Pages: " & GetExtractedValue("x2StrongTag").ToString())' Copy the table into a local variable to make it easier to work withDim myTable As HtmlTable = Pages.JointCommissionResources9.CphTracerPageRadMyOrgTracesTableLog.WriteLine("Table when Nothing found: " & myTable.ToString)' Locate the row we want using text content (Enter the String to search by'Dim row As HtmlTableRow = myTable.Find.ByContent(Of HtmlTableCell)("Article B01").Parent(Of HtmlTableRow)()Dim row As HtmlTableRow = myTable.Find.ByContent(Of HtmlTableCell)(MySearchString).Parent(Of HtmlTableRow)()' Locate the delete icon (which is going to be just an anchor tag) located in the third column of the current row'Dim link As HtmlAnchor = row.Cells(5).Find.ByExpression(Of HtmlAnchor)("uniquename=UrgbtnEditResponse")'uniquename="UrgbtnNewResponse"Dim link As HtmlAnchor = row.Cells(5).Find.ByExpression(Of HtmlAnchor)("uniquename=UrgbtnNewResponse")'Dim link As HtmlAnchor = row.Cells(4).Find.ByExpression(Of HtmlAnchor)("value=Print/Preview")' Now that we've found it, click the delete iconlink.Click()