Getting Selenium to log in via .htaccess popup

I am using WebDriver (Selenium2) with Java on linux. I use WebDriver to automatically fill out a form and submit it. I ran into a problem with htaccess sites, i.e. I cannot access the htaccess site through WebDriver.

Can anyone help me in this regard?

Thanks in advance, Sunil

+3
source share
5 answers

From Selenium Frequently Asked Questions (which is currently out):

How to use Selenium to log in to sites that require basic HTTP authentication (where the browser makes a modal dialog with a request for credentials)?

URL-, RFC 1738:
open http://myusername:myuserpassword@myexample.com/blah/blah/blah

, Internet Explorer , Microsoft / URL- IE. , , KB. "iexplore.exe" DWORD 0 HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE.

, Selenium Remote Control, 0.9.2.

+11

WebDriver ( Selenium) Windows GUI, GUI HTTP. , , , Google , "Selenium AutoIt" ..

- AutoIt Sikuli - .

0

Selenium - FireFox , , , Selenium .

" " my.domain.com " " myuser "

- , , . ( ) network.http.phishy-userpass-length; 255

, .. Selenium 2

0

, .

public void login(String username, String password){
        WebDriver driver = getDriver();
        String URL = "http://" + username + ":" + password + "@" + "link";
        driver.get(URL);
        driver.manage().window().maximize();
    }
0

Source: https://habr.com/ru/post/1728897/


All Articles