使用 file:/// 协议的 WatiN IE 浏览器和本地 javascript 文件

发布于 2024-08-17 04:34:54 字数 567 浏览 3 评论 0原文

我目前正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尐偏执 2024-08-24 04:34:54

我认为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文