How to handle authentication popup with Selenium WebDriver using Java

前端 未结 7 1944
伪装坚强ぢ
伪装坚强ぢ 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:07

    Don't use firefox profile and try below code:

    driver.get("http://UserName:Password@Example.com");
    

    If you're implementing it in IE browser, there are certain things which you need to do.

    In case your authentication server requires username with domain like "domainuser" you need to add double slash / to the url:

    //localdomain\user:password@example.com
    

提交回复
热议问题