【发布时间】:2010-07-08 13:08:20
【问题描述】:
我有一个 index.html 文件,其中包含 scripts.js
在scripts.js中:
函数添加(arg1, arg2)
{
if(typeof(arg1) == 'string') arg1 = parseInt(arg1);
if(typeof(arg2) == 'string') arg2 = parseInt(arg2);
return arg1 + arg2;
}
在我的 C# 代码中:
[测试]
公共无效 Tescik()
{
Assert.AreEqual(sel.GetEval(@"this.browserbot.getUserWindow().Add(2,3);"), 5, "Adding...");
}
在 NUnit 中运行时失败:
错误:抛出异常:this.browserbot.getUserWindow().Add 不是函数
有什么建议吗?我有 sel.start() 和 stop()
【问题讨论】:
标签: c# javascript unit-testing nunit selenium-rc