Some web page requires authentication, they pop up a authentication window. During automation this pop up is a big problem, they can be avoided in firefox in just 3 steps.
Step 1: (Login to the site)
From Selenium or any automation script, call the site like http://username:password@site.com
eg., in selenium
selenium.open(“http://username:password@site.com");
Step 2: (Suppress the popup in firefox profile)
The above method will pop up an other ok button, to suppress that from firefox on your default profile open about:config and right click->New->Integer use the preferred name as network.http.phishy-userpass-lengthnew and value as 255.
Step 3: (Use the firefox profile in Selenium)
java -jar selenium-server.jar -interactive -firefoxProfileTemplate “%USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\k2h1lu68.default”
The file “k2h1lu68.default” could vary in your case.
Related posts:
