In Firefox, you can use Firefox profile as given below and send username and password in URL
FirefoxProfile ffProfile = new FirefoxProfile();
ffProfile.setPreference("network.automatic-ntlm-auth.trusted-uris", "hostname");
WebDriver driver = new FirefoxDriver(ffProfile);
driver.get("http://username:password@hostname");
Hope that helps!