Authentication 如何在selenium中绕过身份验证

Authentication 如何在selenium中绕过身份验证,authentication,selenium,webdriver,Authentication,Selenium,Webdriver,我正在尝试自动化一个安全的应用程序(使用useragent-iphone),它在我打开站点时要求进行身份验证。我试图在URL本身中提供凭据以绕过身份验证,但它会弹出一个对话框进行确认,我无法通过代码处理该对话框 FirefoxProfile profile=新的FirefoxProfile(); profile.setPreference(“general.useragent.override”, “Mozilla/5.0(iPhone;U;类似于Mac OS X的CPU)AppleWebKit

我正在尝试自动化一个安全的应用程序(使用useragent-iphone),它在我打开站点时要求进行身份验证。我试图在URL本身中提供凭据以绕过身份验证,但它会弹出一个对话框进行确认,我无法通过代码处理该对话框

FirefoxProfile profile=新的FirefoxProfile();
profile.setPreference(“general.useragent.override”,
“Mozilla/5.0(iPhone;U;类似于Mac OS X的CPU)AppleWebKit/420.1”
+“(KHTML,如Gecko)版本/3.0 Mobile/3B48b Safari/419.3)”;
WebDriver=新的FirefoxDriver(配置文件);
字符串站点=”http://akamai:ecnt0k3n@ecn13 secure store.nike.com“;
驱动程序。获取(站点);
非常感谢您在这方面的任何帮助

谢谢,
Bhavana

您可以使用Selenium的新WebDriver在该类型的对话框中输入信息。但是我还没有做到。Mozilla阻止了钓鱼尝试。你查过了吗

顺便说一句,根据他的说法,这应该是可行的:

FirefoxProfile profile=新的FirefoxProfile();
setPreference(“network.http.phishy userpass length”,255);
驱动程序=新的Firefox驱动程序(配置文件);
驱动程序。获取(“http://username:password@www.basicauthprotected.com/”;

注意:这个问题几乎与。

通过身份验证,您是说“代理身份验证”