Friday, April 13, 2012

Integrated Auth with Selenium

In order to run Selenium with integrated auth you can create a Firefox profile in code and set your server as an NTLM auth trusted URI.

// Setup Firefox profile to support integrated auth
var profile = new FirefoxProfile();
profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", "localhost");
profile.SetPreference("network.ntlm.send-lm-response", true);
this.Driver = new FirefoxDriver(profile);

// Set global wait timeout to 10 seconds
this.Driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 10));
this.BaseUrl = new Uri("http://localhost/");
this.VerificationErrors = new StringBuilder();

No comments:

Post a Comment

TaskForce!

Coming soon, a new kind of todo app. A gamified task manager. Get rewarded for completing tasks with gold. Use your bank to upgrade your shi...