tags:

views:

133

answers:

0

When I try to loop through the items in a ListBox, I get an Access Is Denied error. If I set the value 1 at a time, I don't have the problem.

Here is my Test:

var list = browser.SelectList(Find.ById("elementid")).Options;

foreach (Option o in list)
{
    browser.GoTo("http://localhost/search.aspx");
    browser.SelectList(Find.ById("elementid")).Select(o.Text);
    browser.Button(Find.ById("btnSearch")).Click();
    Assert.That("Search Results", Is.EqualTo(browser.Title));
}