The web driver is hanging when go to the site that have Basic Authentication

By design Issue #13876421

Details

Author
Truc N.
Created
Sep 21, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Can you please use the java code below to reproduce this issue:

public static void main(String[] args) {
    try {
        // set edge driver path
        System.setProperty("webdriver.edge.driver", "path\\MicrosoftWebDriver.exe");
        // create new EdgeDriver instance
        WebDriver webDriverEdge = new EdgeDriver();
        // go to site that have Basic authentication
        webDriverEdge.get("https://www.engprod-charter.net/");
        // selenium is hanging here
        // expected: the selenium run next step or throw an exception
        // TODO
    } catch (Exception e) {
        e.printStackTrace();
    }
    System.out.println("Done!");
}

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

    • Hi Nguyen,

      I am not aware of a way to do this using WebDriver.  It appears to still be an open issue in the W3C spec.  Given that, it appears Selenium is not supporting a new way to do this since the inline user auth has been deprecated.

      Open Issues:
      https://github.com/w3c/webdriver/issues/385
      https://www.w3.org/Bugs/Public/show_bug.cgi?id=28802
      https://github.com/mozilla/geckodriver/issues/519

      Not implemented:
      http://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/Alert.html#authenticateUsing-org.openqa.selenium.security.Credentials-

      Possible workarounds:

      • Setup remote access to have your Java code call the robotil commands to run when needed during the webDriver test execution.
        https://codoid.com/robotil/

      Wish I had a better answer,

      Steve

    • Hi Steven,

      Thanks for your info. But my problem is the system that hanging when go to the “https://www.engprod-charter.net/” site. I can NOT do anything.

      Please help to double check.
      Thanks.

    • I get the issue now.  I re-read your original Repro Steps and realize now that given there is no support for Basic Authentication, there should be some way for webDriver to continue.  I was wondering why there were two posts on this topic.  Makes sense now. :-)

      Let me investigate that.

    • Hi Steven,

      there should be some way for webDriver to continue.
      Do you have any info/workaround for this.

      I was wondering why there were two posts on this topic.
      Please help to remove the other topic.

    • Stev:: There should be some way for webDriver to continue.
      Nguyen:: Do you have any info/workaround for this.

      Stev:: I was wondering why there were two posts on this topic.
      Nguyen:: Please help to remove the other topic.

    • Hi Steven,

      Steven:: There should be some way for webDriver to continue.
      Nguyen:: Do you have any info/workaround for this.
      

      Can you please help me.
      Thanks.

    • Hi Truc,

      I do not know of a work around for this except using something like Appium or Sikulix which would have to be launched in from the webDriver test code, I.e. launch an external Windows automation tool to find the basic-auth dialog and click it.  I like Sikulix.  I have not tried Appium.

      As any FYI, the reason this functionality was removed was for security reasons.  I.e. make it more difficult to automate a brute force attack.

      Appreciate the submission and the questions,

      Steve

    • Thank you for your advice, Steve.

    • Anytime.  I also found an AutoHotKey script someone created to automate clicking accept for Excel files.  I think the script could be modified to look for the window for the basic auth pop-up, I.e. ahk_class

    • Microsoft Edge Team

      Changed Status to “By design”

    • I forgot to share the link to the script:

      https://github.com/TLMcode/AHKs/blob/master/AutoDownloadFirefoxPrompts.ahk

      This is not a Microsoft provided script.  Just a suggestion as a work around.

    • Yeah, thanks so much.

    You need to sign in to your Microsoft account to add a comment.

    Sign in