我不知道你偶然发现的具体问题是什么,但我已经准备好利用我们的例子,你已引用的页面一个简单的测试:
RadGrid grid = Find.ById(“RadGrid1”); GridDataItem firstRow = grid.MasteTable.DataItems [0]; GridDataCell firstRowThirdCell = firstRow.DataCells [2];
//断言初始值 Assert.IsTrue(firstRowThirdCell.CellText == “柴”,的String.Format( “断言失败,预期值{0},实际{1}”, “柴”,firstRowThirdCell.CellText )); HtmlAnchor firstRowEditButton = firstRow.Find.ById(“〜AutoGeneratedEditButton”);
//将项目置于编辑模式 firstRowEditButton.Click(); Wait.For(myItem => myItem.Edited,firstRow,5000); HtmlInputText productNameTbx = Find.ById(“〜ctl05_ctl09”); productNameTbx.Value =“foo”;
//更新项目 GridEditForm editForm = Find.ById(“〜ctl05_ctl00”); editForm.Update(); Wait.For(myItem =>!myItem.Edited,firstRow,5000);
//验证格被更新 Assert.IsTrue(firstRowThirdCell.CellText == “foo” 的,的String.Format( “断言失败,预期值{0},实际{1}”, “foo” 的,firstRowThirdCell。 CELLTEXT));
您可以使用它作为参考,并对其进行修改以满足您的网页/测试的要求。如果出现任何其他问题或困难,请不要犹豫,让我们知道他们。