title: Firefox auth pop-up getting error: User prompt of type promptUserAndPass is not supported
body: <p>My Auth functionality is working great in chrome but as Firefox handle it differently I am not able to login the auth by anyway.</p>
  
  <p>My Firefox version : 72.02</p>
  
  <p>I have found that it is known bug but they are 1 year old post, if anyone has solution kindly share</p>
  
  <p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1556026" rel="nofollow noreferrer">https://bugzilla.mozilla.org/show_bug.cgi?id=1556026</a></p>
  
  <p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1556307" rel="nofollow noreferrer">https://bugzilla.mozilla.org/show_bug.cgi?id=1556307</a></p>
  
  <p>Normal code will not work as below as I need to add token to url runtime as similar shown in chrome but not in Firefox</p>
  
  <pre><code>driver.get("https://your-username:your-password@example.com");
  </code></pre>
  
  <p>So I need to do some sendKeys in this case which is failing for me</p>
  
  <p>I am getting error as :</p>
  
  <blockquote>
    <p>Exception in thread "main"
    org.openqa.selenium.UnsupportedCommandException: User prompt of type
    promptUserAndPass is not supported Build info: version: '3.141.59',
    revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host:
    '', ip: '', os.name: 'Windows 10', os.arch:
    'amd64', os.version: '10.0', java.version: '1.8.0_66' Driver info:
    org.openqa.selenium.firefox.FirefoxDriver</p>
  </blockquote>
  
  <p>Code I am trying:</p>
  
  <pre><code>public static void main(String[] args) throws InterruptedException, AWTException {
  
         /* BrowserMobProxy proxy = new BrowserMobProxyServer();
          proxy.start(0);
          Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);*/
  
          // put our custom header to each request
  /*       proxy.addRequestFilter((request, contents, messageInfo)-&gt;{
              request.headers().add("my-test-header", "my-test-value");
              System.out.println(request.headers().entries().toString());
              return null;
          });*/
  
          // Setting up Proxy for chrome
        //  ChromeOptions opts = new ChromeOptions();
  
  
  
  
          WebDriver driver = null;
          String url = "https://qa.xyz-domain/new-request/";
          String UserName = "xyzuser";
          String Password = "xyz@202";
  
          System.setProperty("webdriver.gecko.driver",
                  "D:\\Demoproject\\src\\main\\resources\\drivers\\geckodriver.exe");
          FirefoxOptions options = new FirefoxOptions();
           options.setCapability("network.http.phishy-userpass-length", 255);
           options.setCapability("network.automatic-ntlm-auth.trusted-uris","testcloud");
          // options.setp
      //   options.setCapability(CapabilityType.);
  
  
           String val=UserName+":"+Password;
  
           String encodedCreadentials = "Basic " + (Base64.getEncoder().encodeToString(val.getBytes()));
  
           options.setCapability("Authorization",encodedCreadentials);
  
          // String proxyOption = "--proxy-server=" + seleniumProxy.getHttpProxy();
         //  options.addArguments(proxyOption);
          // options.addArguments(arguments)
          driver = new FirefoxDriver(options);
  
          driver.get(url);
          Thread.sleep(5000);
          driver.findElement(By.name("loginfmt")).sendKeys("user.name@xyz.com");
          driver.findElement(By.name("loginfmt")).sendKeys(Keys.ENTER);
          Thread.sleep(15000);
          driver.switchTo().alert().sendKeys(UserName);
          /*BrowserMobProxy browserMobProxy = new BrowserMobProxyServer();
  
  
          browserMobProxy.addHeader("Authorization", encodedCreadentials);
          browserMobProxy.start();*/
  
  
          //ProxyServer bmp = new ProxyServer(4444);
      /*  Robot robot = new Robot();
          robot.keyPress(KeyEvent.VK_ENTER);
          driver.switchTo().alert().sendKeys(UserName);*/
  
  
  /*      Alert alert = driver.switchTo().alert();
  
          System.out.println(alert.getText());
  
          if (alert.getText().contains("jjjj")) {*/
      //      alert.sendKeys("UserName");
              //driver.switchTo().alert().dismiss();;
              //driver.switchTo().alert().sendKeys(UserName + Keys.TAB + Password);
              //alert.sendKeys(UserName + Keys.TAB + Password);
  
              /*String url2 = driver.getCurrentUrl().replaceAll("https://", "");
              System.out.println("url2 = " + url2);
  
              String url3 = "https://" + UserName + ":" + Password + "@" + url2 + "/";
              System.out.println("url3 = " + url3);
              driver.get(url3);
  
              //driver.switchTo().alert().sendKeys(UserName + Keys.TAB + Password);
              //driver.switchTo().alert().accept();
  
              String url2 = driver.getCurrentUrl().replaceAll("https://", "");
              System.out.println("url2 = " + url2);
  
              String url3 = "https://" + UserName + ":" + Password + "@" + url2 + "/";
              System.out.println("url3 = " + url3);
              driver.get(url3);*/
  
          /*} else {
              System.out.println("not appearing");
          }*/
  
  
  
      }
  
  }
  </code></pre>
  
  <p><strong>I tried to use BrowserMobProxy but I believe it works with http request only I guess and for https har required, let me know if there is issue with my understanding. or we can use it anyway for https</strong></p>
  
  <p>refer:</p>
  
  <p><a href="https://i.stack.imgur.com/x78zI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x78zI.jpg" alt="enter image description here"></a></p>