This question is locked. New answers and comments are not allowed.
Here is my Table on the webpage
I want to make a click in edit button
When I do the Quick Execute, It Passed and I can see the Corresponding Page
If I run From TestList
I'm getting this error
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[SWR123_Edit_DR_Program_CodedStep2] : @"Click 'Edit DR Program ''.
InnerException:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
<table border="0" cellpadding="1"> <tr bgcolor="#aaddff"> <th>Utility </th> <th>Program Name </th> <th>Description </th> <th>Valid From </th> <th>Valid To </th> <th>Actions </th> </tr> <tr bgcolor="#ebfae8"> <td><strong>Test_Utility </strong></td> <td><strong>CBP_With_Bidding </strong></td> <td>CBP_DR </td> <td>8/14/2012 </td> <td>8/21/2012 </td> <td align="center"> <div class="actionButton"> <a href="/OpenADR/EditDRProgram/2">Edit</a><a href="/OpenADR/DisplayDRProgram/2">Details</a><a href="/OpenADR/DeleteDRProgram/2">Delete</a></div> </td> </tr> <tr> <td colspan="5"></td> <td align="center"> <div class="actionButton"> <a href="/OpenADR/CreateDRProgram">Add New DR Program</a></div> </td> </tr></table>I want to make a click in edit button
[CodedStep(@"Click 'EditLink'")]public void CodedStep1(){ HtmlTable table = Find.ByExpression<HtmlTable>("TagIndex = table:0", "TagName=table"); HtmlTableRow row = table.Find.ByExpression<HtmlTableRow>("innertext=~Test_utility", "tagname=tr"); HtmlTableCell cell = row.Cells[5]; HtmlAnchor a = cell.Find.ByExpression<HtmlAnchor>("innertext=~Edit", "tagname=a"); a.Click(); // Click 'EditLink' // Pages.HttpLocalhost8080OpenADR5.EditLink.Click(false);}When I do the Quick Execute, It Passed and I can see the Corresponding Page
If I run From TestList
I'm getting this error
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[SWR123_Edit_DR_Program_CodedStep2] : @"Click 'Edit DR Program ''.
InnerException:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)