Firefox plugin: Test Automation Password Manager

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:)

2 thoughts on “Firefox plugin: Test Automation Password Manager

  1. There is a one more simple and quickest way, If it helps then great!

    If you are running selenium server from cmd then
    1. Start cmd with admin rights (run as administrator) so server is also started with admin rights,
    2. Now run application, It may ask for username and password again but don’t worry – just fill username and password or click cancel (in case of site running on localhost), and it will work like. (now it works as if it is passing username and password to browser or application)
    Also if don’t want to fill authentication details manually everytime then in your script include this code:
    System.setProperty(“http.proxyHost”, “proxyHost”);
    System.setProperty(“http.proxyPort”, “proxyPort”);
    System.setProperty(“http.proxyUser”, “proxyUser”);
    System.setProperty(“http.proxyPassword”, “proxyPassword”);
    System.setProperty(“http.nonProxyHosts”, “proxyExceptions”);

    Hope this quickest way saves time!
    I just had a intuition and it worked like charm:-)

  2. Hi,

    Is there a common solution for autoauth for all watir webdriver supported browser drivers?

    Thanks
    Santosh

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>