Andrey Marchuk
Andrey Marchuk

Reputation: 13483

How to perform refresh and not forced refresh on Firefox

I have a website that requires NTLM authentication, so I have created a FireFox profile:

FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("network.http.phishy-userpass-length", 255);
profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", uri.Host);
profile.SetPreference("network.negotiate-auth.delegation-uris", uri.Host);
profile.SetPreference("network.negotiate-auth.trusted-uris", uri.Host);
driver = new FirefoxDriver(profile);

Then I navigate to page with GoToUrl method which goes fine, but when I call Refresh - authentication popup comes up. Googling around I found that it occurs if call "forced refresh", like "Ctrl + F5" and indeed it does, even when do it manually. So, the question is how to perform a plain refresh and not forced refresh?

Thanks in advance

Upvotes: 0

Views: 1215

Answers (2)

Ittiel
Ittiel

Reputation: 1224

YOu have refresh as part of the webdriver API:

driver.navigate().refresh();

Upvotes: 0

Falkenfighter
Falkenfighter

Reputation: 588

I don't have a way to test if this is going to "force" refresh, but you could try refreshing directly in JS. ((JavascriptExecutor)driver).executeScript("document.location.reload()");

Upvotes: 1

Related Questions