简体   繁体   English

在Telerik Testing Framework中使用自定义编辑弹出表单

[英]Working with custom edit popup forms in Telerik Testing Framework

( also posted on Telerik forums ) 也发布在Telerik论坛上

Hi all, 大家好,

We are trying to use the automation testing framework in code to enter data into a custom edit popup form (like in this demo: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/popupeditform/defaultcs.aspx ) to modify a row of data. 我们正在尝试在代码中使用自动化测试框架,以将数据输入到自定义编辑弹出窗口表单中(例如在此演示中: http : //demos.telerik.com/aspnet-ajax/grid/examples/dataediting/popupeditform/defaultcs。 aspx )修改一行数据。 The problem we are having is that if we simply look for the Update button on the edit form and send it the Click() event then the form simply closes and does not actually trigger the RadGrid_UpdateCommand event handler. 我们遇到的问题是,如果我们只是在编辑表单上查找“更新”按钮并向其发送Click()事件,则该表单只是关闭而实际上并未触发RadGrid_UpdateCommand事件处理程序。 This means the data never gets updated. 这意味着数据永远不会更新。

We have looked in the samples provided with the Testing Framework and there is an example with a in-place edit form, but none with a popup edit form. 我们查看了测试框架随附的示例,其中有一个示例具有就地编辑表单,而没有一个具有弹出编辑表单。 Is there something special that we need to do with a custom edit popup form to get the row to update when we are done with the form? 我们需要使用自定义编辑弹出式表单来做一些特殊的事情,以便在完成表单后更新行吗?

Any help appreciated, 任何帮助表示赞赏,

Thanks 谢谢

I am not sure what the particular problem you have stumbled upon may be, however I have prepared a simple test using the page from our examples which you have referenced: 我不确定您遇到的特定问题是什么,但是我使用您引用的示例中的页面准备了一个简单的测试:

RadGrid grid = Find.ById("RadGrid1"); RadGrid网格= Find.ById(“ RadGrid1”); GridDataItem firstRow = grid.MasteTable.DataItems[0]; GridDataItem firstRow = grid.MasteTable.DataItems [0]; GridDataCell firstRowThirdCell = firstRow.DataCells[2]; GridDataCell firstRowThirdCell = firstRow.DataCells [2];

// assert initial value Assert.IsTrue(firstRowThirdCell.CellText == "Chai", String.Format("Assert failed, expected value {0}, actual {1}", "Chai", firstRowThirdCell.CellText)); // //声明初始值Assert.IsTrue(firstRowThirdCell.CellText ==“ Chai”,String.Format(“声明失败,期望值{0},实际值为{1}”,“ Chai”,firstRowThirdCell.CellText)); HtmlAnchor firstRowEditButton = firstRow.Find.ById("~AutoGeneratedEditButton"); HtmlAnchor firstRowEditButton = firstRow.Find.ById(“〜AutoGeneratedEditButton”);

// put the item in edit mode firstRowEditButton.Click(); //将项目置于编辑模式下firstRowEditButton.Click(); Wait.For(myItem => myItem.Edited, firstRow, 5000); Wait.For(myItem => myItem.Edited,firstRow,5000); HtmlInputText productNameTbx = Find.ById("~ctl05_ctl09"); HtmlInputText productNameTbx = Find.ById(“〜ctl05_ctl09”); productNameTbx.Value = "foo"; productNameTbx.Value =“ foo”;

// update the item GridEditForm editForm = Find.ById("~ctl05_ctl00"); //更新项目GridEditForm editForm = Find.ById(“〜ctl05_ctl00”); editForm.Update(); editForm.Update(); Wait.For(myItem => !myItem.Edited, firstRow, 5000); Wait.For(myItem =>!myItem.Edited,firstRow,5000);

// verify grid is updated Assert.IsTrue(firstRowThirdCell.CellText == "foo", String.Format("Assert failed, expected value {0}, actual {1}", "foo", firstRowThirdCell.CellText)); // //验证网格是否已更新Assert.IsTrue(firstRowThirdCell.CellText ==“ foo”,String.Format(“ Assert failed,期望值{0},实际{1}”,“ foo”,firstRowThirdCell.CellText));

You can use it as a reference and modify it to meet the requirements of your web page/test. 您可以将其用作参考并对其进行修改以满足您的网页/测试的要求。 Should any additional questions or difficulties arise, do not hesitate to let us know about them. 如有其他问题或困难,请随时告知我们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Telerik的WebAii框架测试分页 - Testing paging with Telerik's WebAii framework Telerik MVC网格自定义命令弹出窗口 - Telerik mvc grid custom command popup window 无法从Web应用程序使用Telerik测试框架 - Can't use Telerik Testing Framework from web application 使用c#(telerik)在wpf中自定义设置弹出窗口 - Custom design of a popup in wpf using c# (telerik ) Telerik RadGrid自定义分页筛选器和排序不起作用 - Telerik RadGrid Custom Paging Filter and Sorting Not Working Telerik RadGrid doubleclick编辑事件在服务器上不起作用,但在本地 - Telerik RadGrid doubleclick edit event not working on server but is on local 使用弹出网格模式使用telerik网格在编辑/添加操作中执行自定义 - Perform customization in edit/add operation using telerik grid using the popup gridmode Kendo UI Grid中的``添加和编辑''弹出窗口的不同标题和更新按钮名称(Telerik 2018) - Different title and update button name for Add and Edit popup in Kendo UI Grid (Telerik 2018) Telerik模态弹出窗口大小 - Telerik Modal Popup Size Windows Compact Framework自定义弹出通知 - Windows Compact Framework custom popup notification
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM