I’ve recently come across a problem when doing UI testing with Firefox on a Mac against a web app that uses NTLM authentication. Every time I navigated to the web app I was presented with a dialog box asking me for my username and password.

I did some reading and came across Alister Scott’s Automatic Firefox authentication when using Selenium-WebDriver with AutoAuth post. In it he explains a way to get around the problem:
- Create a Firefox profile using the profile manager
- Add the required credentials to the profile
- Use the above Firefox profile when running tests
- Add the AutoAuth plugin to the profile at test execution time
The above would get around my problem, but it would lead to having to maintain a firefox profile which isn’t nice. So, I decided to attempt writing a firefox plugin that would allow me to add credentials to firefox’s password manager at runtime using Javascript. After all, according to the documentation it looked possible…
After a bit of hacking, the result is my first Firefox plugin: the Test Automation Password Manager plugin. It’s quite simple to use; you can find instructions here:
https://github.com/natritmeyer/test_automation_firefox_password_manager
…and the plugin page here:
https://addons.mozilla.org/en-US/firefox/addon/test-automation-password-ma/
I’ve not tested it extensively – “It Works On My Machine”