| Dominic 2004-03-26, 11:50 pm |
| Hi everybody,
I'm new to NUnitASP. I am evaluating how NUnitASP
works for my application.
A page in my application contains a data grid. For
example,
<asp:datagrid id="dgBookList" Runat="server"
AutoGenerateColumns="False" Width="100%">
<asp:TemplateColumn HeaderText="Title">
<ItemTemplate>
<asp:LinkButton ID="lbTitle" Runat="server"
Text=.....[some code deleted here]/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="ID" HeaderText="Book
ID"></asp:BoundColumn>
</asp:datagrid>
In my unit test code, I successfully got the data grid
tester working in the page.
DataGridTester dgtBookList = new DataGridTester
("dgBookList", someContainerControl);
I checked the dgtBookList.TrimmedCells. Everything
looked correct.
Now, I'd like to emulate clicking the link button "lblTitle"
inside the first row of the data grid.
DataGridTester.Row row = new DataGridTester.Row(1,
dgtBookList);
LinkButtonTester lbtTitle= new LinkButtonTester
("lbTitle", row);
The debugger showed the resulting LinkButtonTester
lbtTitle.Text has an
exception "NUnit.Extensions.Asp.WebForm.ElementNotVisi
bleException".
Do you know the reason? How can I access the element
inside the row of a DataGridTester?
Thanks
Dom
|