c# - Watin :select item from dropdown list, 它的值是从另一个下拉列表中填充的

标签 c# visual-studio-2008 nunit watin

我是 Watin 的新手,我正在使用 jave 和 iface 技术来自动化站点, 我正在尝试从下拉列表中进行选择,它的值是从另一个下拉列表中填充的,我正在使用最新的 WatiN 版本,并且正在 VS2008 中进行 C# 单元测试。我已经编码:

browser.SelectList(Find.ById("BillEnrollmentForm:selectedIndustry")).Option("Charity").Select();

 browser.SelectList(Find.ById("onlinePayment:panelTabSet1:0:quickPaymentTable:0:selectedBiller")).option("Resala").Select();

它执行了第一个并从下拉列表中选择,但是当执行到第二个时,耗时过多并显示此异常

"WatiN.Core.Exceptions.TimeoutException : Timeout while Internet Explorer busy"

最佳答案

尝试在命令之间添加这个

browser.WaitForComplete();

如果在初始化浏览器时增加 watin 超时没有帮助

Settings.WaitUntilExistsTimeOut = 240; //in seconds
Settings.WaitForCompleteTimeOut = 240; 

关于c# - Watin :select item from dropdown list, 它的值是从另一个下拉列表中填充的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13549198/

相关文章:

c# - 成员和方法之间的区别

visual-studio - 如何在VS2008中自动缩进代码?

c# - NUnit 相当于 JUnit 的规则

asp.net - 在 ASP.NET GridView 中显示选择性列

unit-testing - 测试未显示在测试资源管理器 (Nunit) 中

asp.net-web-api - Web API Nunit 测试不注入(inject)依赖项

c# - 为什么这段带有 PredicateBuilder 的代码不起作用?

c# - 使用 OxyPlot 从 PlotModel 渲染 png 图像

C# 如何以编程方式更改播放设备

c++ - C++ : Same code bevahes differently even on the same computer 上的 OpenGL VS2008