WebTest Fixtures, FitNesse, Selenium and Integrated Windows Authentication
As part of one of the latests coaching on implementing Scrum in a software development team, it was decided to implement ATDD and we decided to use FitNesse for preparing and writing of the tests and Selenium to execute them.
In order to link both Selenium and FitNesse, we use WebTests Fixtures (Thanks Gojko et al.)
The surprise that awaited us was a web application developed in. NET with Windows Integrated Authentication. Anyone who has been through this, would know that there is not much information online that would solve the problem. Except for a couple of modifications to the core of WebTest and a few isolated posts, we were unable to find a unified source to solve this problem.
From the beginning, we knew we didn’t want to modify the code of the testing tools we decided to use, to enable them to be updated as new versions come out without major problems, therefore, that solution was discarded.
After researching a while, we decided the best option was to have Selenium running an instance of Firefox onfigured enough to set Integrated Windows Authentication with no problems.
Context
FitNesse and Selenium are both installed and running as services on a windows server. FitNesse version is the one that comes with the download of WebTests Fixtures, while the version of Selenium is the latest, since that comes with WT supports up to Firefox 2, not 3.
Solution
In principle, we must create a new Firefox profile with a given configuration for user credentials under which the service is running Selenium are sent to the Web application in a transparent manner, without popups or alerts that prevent Selenium do its job. Then we configure selenium to lift the specific profile of Firefox, and not another.
Creating the Profile in Firefox
To create a new profile for firefox it’s important to be logged with the user under which the service is running Selenium. Once inside the system you must follow these steps (Note: This assumes Windows):
1. Run:
firefox.exe -ProfileManager
2. Click “Create Profile”
3. Naming Your profile. In our case we use “WebTest-FFPROFILE-IWA”
4. Select a folder. In our case we use “C:\webtest\WebTest-FFPROFILE-IWA”
5. Click “Finish”
6. Select “Do not ask at startup”
Configuring Profile in Firefox
1. Continuing from the previous step, select the newly created profile and click on “Start Firefox”
2. Go to “View-> Toolbars” and uncheck “Bookmarks”
3. Right click on the toolbar and select “Customize”
4. Select “Use Small Icons” and accept
5. Go to “Tools-> Options
6. In the tab “Main” setear “about: blank” homepage and off as “Show Downloads”
7. In the Tab “Perstañas” select new window to new pages and disable all alerts
8. In the Tab “Content” Disabling Pop-Ups
9. Tab In the “Privacy” all options off History
10. In the Tab “Security” Security Options unselect and “Settings …” disable alerts
11. In the Tab “Advanced” deactivate “automatic transfer” of the subtab “General” and turn off alerts and search engines the tab “Updates”
12. Go to “Tools-> Extensions” and install Firebug, and ScreenGrab Selenium IDE
13. In the address bar type “about: config”
14. Create logic input (boolean) “extensions.update.notifyUser” -> false
15. Create logic input (boolean) “extensions.newAddons” -> false
16. Modify the entry “network.automatic-ntlm-auth.trusted-uris” and enter the domain of the server where we want to test the Web application
17. Modify the entry “network.ntlm.send-lm-response” and give it a value of “true”
At this point we have properly configured Firefox profile.
Selenium configuration to take your Firefox profile created
Modify the batch file that runs Selenium (in the root of WebTest) and include the following parameter after the call to the JAR file: “-firefoxProfileTemplate C:\webtest\WebTest-FFPROFILE-IWA” (change C:\webtest\WebTest-FFPROFILE-IWA with the foldername into which you saved the newly created Firefox profile.
Done, your tests now should run under Windows Integrated Authentication.
I hope to serve you at some point if you run into this problem.

