gatapia
gatapia

Reputation: 3664

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

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

Upvotes: 0

Views: 849

Answers (1)

Yoenhofen
Yoenhofen

Reputation: 397

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.

Upvotes: 2

Related Questions