使用 file:/// 协议的 WatiN IE 浏览器和本地 javascript 文件
我目前正在使用 WatiN 运行一些 javascript 单元测试,但是如果我像这样初始化 WatiN IE 浏览器,一切都会正常工作:
Browser browser = new IE("http://localhost/Project/tests.hyml");
但是,一旦我尝试使用文件 uri 初始化浏览器,即:
Browser browser = new IE("c:\\\\Projects\\Project\\tests.html");
或
Browser browser = new IE("file:///C:/Projects/Project/tests.hml");
javascript 似乎失败加载。我手动测试了这些文件名,测试工作正常(设置 Internet 选项 -> 高级 -> 安全 -> 允许活动内容...后)。
也许 WaitN 忽略了允许活动内容设置?有人遇到过这种情况吗?有什么想法吗?
感谢您的帮助
吉多
I'm currently using WatiN to run some javascript unit tests however everything works fine if I initialise the WatiN IE browser like this:
Browser browser = new IE("http://localhost/Project/tests.hyml");
However, as soon as I try to initialise the browser with a file uri, i.e.:
Browser browser = new IE("c:\\\\Projects\\Project\\tests.html");
or
Browser browser = new IE("file:///C:/Projects/Project/tests.hml");
The javascript appears to fail to load. I manually tested those file names and the tests work fine (after setting the Internet Options -> Advanced -> Security -> Allow Active Content...).
Is perhaps WaitN ignoring that Allow Active Content Setting? Has anyone encountered this? Any ideas?
Thanks for your help
Guido
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 URL 应该是 file://C:\Projects\Project\tests.html
file: 后面有两个斜杠,然后是反斜杠。此外,您还输入了文件扩展名。
I think the URL should be file://C:\Projects\Project\tests.html
Two slashes after the file:, and backslashes from there on. Also, you typo-ed the file extension.