问题描述
|
我正在尝试检测在watin测试期间是否遇到服务器错误。我以为下面的代码可以解决问题,但是在使用中,我在此行的测试执行过程中得到了一个NRE:(Text.Contains(\“ Server Error \”))。
有什么建议在这里做什么?尝试尝试捕获块似乎不是正确的选择。
谢谢。
public class WatinBrowser : IE
{
public WatinBrowser(string url,bool createInNewProcess) : base(url,createInNewProcess)
{
}
public override void WaitForComplete(int waitForCompleteTimeOut)
{
base.WaitForComplete(waitForCompleteTimeOut);
if (Text.Contains(\"Server Error\"))
{
throw new ServerErrorException(\"A server error occured: \" + Text);
}
}
}
public class ServerErrorException : Exception
{
public ServerErrorException(string message): base(message)
{
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)