2

The test is running on a windows network that requires proxy (squid) authentication to access external websites, say www.google.com for sake of example.

Some background things to note

  • These sites cannot be added to the proxy white list.

  • Same WatiN test passes in IE

  • I have tried tweaking about:config ntlm settings to allow automatic passing of saved credentials

  • www.google.com has been added to Local Intranet sites

  • WatiN cannot use LogonDialogHandler to deal with this, like IE can

The title of the dialog is Authentication Required and reads The proxy myproxy:8080 is requesting a user name and password. The site says "", with a text field for User Name: and Password:

Has anyone got any ideas of how to get around this?

I'm hoping there is something FireFox specific that will allow me to automatically pass through the credentials. An idea I might try is starting the browser with network credentials.

dove
  • 20,469
  • 14
  • 82
  • 108

2 Answers2

2

Maybe one of the settings here will help:

https://developer.mozilla.org/En/Integrated_Authentication

EDIT:

This will be fixed in Firefox 4:

https://bugzilla.mozilla.org/show_bug.cgi?id=521467

Neil
  • 54,642
  • 8
  • 60
  • 72
  • that is an interesting reference and could work for someone who logs with network credentials but I don't. My PC is on the network but I don't log into the network (for good reasons) and so credentials cannot be passed through. I was hoping to pass through saved credentials (moz-proxy). – dove Jan 25 '11 at 11:41
  • You'll need to set the `signon.autologin.proxy` preference to `true` in `about:config` (if it isn't set to true already). – Neil Jan 25 '11 at 19:28
  • very interesting update. Just verified the auto proxy with FireFox 4 and it works a dream. However, there is no stable jssh plugin for FF4 yet so would not be able to run WatiN tests against it yet. That said, I think you've answered this question and I'll raise a separate one for jssh. Thanks, that was a great find. – dove Jan 26 '11 at 10:17
2

Here are some references that might offer other solutions to get around the logon dialog.

In this post they solved it using WindowsAutomation:

WatiN LogonDialogHandlers not working correctly in Windows 7

This solution passes the credentials in the url:

how to impersonate a windows domain user for automated web testing?

And this solution uses impersonation:

Watin Windows Authentication

You could also use FiddlerCore to manipulate the response to the server:

How to simulate http request using WatiN with specific HTTP referrer and query string?

HTH, Jeroen

Community
  • 1
  • 1
Jeroen van Menen
  • 2,418
  • 1
  • 15
  • 11