How to handle authentication popup with Selenium WebDriver using Java

前端 未结 7 1798
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 05:36

I\'m trying to handle authentication popup using the code below:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(\"network.http.phishy-u         


        
7条回答
  •  情深已故
    2020-11-22 06:08

    This should work for Firefox by using AutoAuth plugin:

    FirefoxProfile firefoxProfile = new ProfilesIni().getProfile("default");
    File ffPluginAutoAuth = new File("D:\\autoauth-2.1-fx+fn.xpi");
    firefoxProfile.addExtension(ffPluginAutoAuth);
    driver = new FirefoxDriver(firefoxProfile);
    

提交回复
热议问题