开发者

WatiN IE browser and local javascript files using file:/// protocol

开发者 https://www.devze.com 2022-12-15 20:28 出处:网络
I\'m currently using WatiN to run some javascript unit tests however everything works fine if I initialise the WatiN IE browser like this:

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:\\\\Proj开发者_高级运维ects\\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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消