Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedCommandException in Firefox 67 at sendKeys() to BasicAuth Alert #7239

Closed
Testomat2018 opened this issue May 28, 2019 · 5 comments
Closed

Comments

@Testomat2018
Copy link

Testomat2018 commented May 28, 2019

馃悰 Bug Report

Since Firefox 67.0 i'm getting UnsupportedCommandException (org.openqa.selenium.UnsupportedCommandException: User prompt of type promptUserAndPass is not supported) while invoking sendKeys() at a basic authentication alert.

Stacktrace:
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: 'DDEA0489', ip: '10.177.176.17', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 67.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:buildID: 20190516215225, moz:geckodriverVersion: 0.24.0, moz:headless: false, moz:processID: 12208, moz:profile: C:\Users\jfrommel\AppData\L..., moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 6.1, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 67eb9e69-b2e9-4f31-b47f-b53c4a363a09
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteAlert.sendKeys(RemoteWebDriver.java:963)
at spielwiese.UseWebDriverDirectlyITCase10.main(UseWebDriverDirectlyITCase10.java:30)

To Reproduce

see: Test script

Expected behavior

i can enter username and password in alert, accept it and get the desired page loaded

Test script or set of commands reproducing this issue

System.setProperty("webdriver.gecko.driver", "/geckodriver-v0.24.0-win64.exe");

final FirefoxDriver ff = new FirefoxDriver();
ff.get("https://www.httpwatch.com/httpgallery/authentication/");

final WebElement displayImage = ff.findElement(By.id("displayImage"));
displayImage.click();

final WebDriverWait wait = new WebDriverWait(ff, 10);
final Alert alert = wait.until(ExpectedConditions.alertIsPresent());
alert.sendKeys("httpwatch" + Keys.TAB + "httpwatch");
alert.accept();

Environment

OS: Windows 7
Browser: Firefox
Browser version: 67.0
Browser Driver version: geckodriver-v0.24.0-win64.exe
Language Bindings version: Java 1.8.0_121
Selenium Grid version (if applicable): not used

@chexki
Copy link

chexki commented Jun 3, 2019

SImilar problem here..

@jimevans
Copy link
Member

jimevans commented Jun 3, 2019

Unfortunately, this is going to be a limitation of the driver. The sendKeys method for alerts is only supported for JavaScript's prompt() dialogs, not authentication dialogs. This is as defined by the W3C WebDriver Specification, and is unlikely to change unless and until a spec change is made to support it.

@elead1
Copy link

elead1 commented Jun 3, 2019

With this recent change (the problem only started once Firefox's release channel updated to version 67), what would be the appropriate/preferred method of navigating a basic authentication dialog?

@jimevans
Copy link
Member

jimevans commented Jun 3, 2019

@elead1 Funny you should ask, as I have a blog post series that is currently being published about this very topic. The short answer is to use a proxy to intercept the response from the server and supply the appropriate header.

@barancev
Copy link
Member

Please follow this issue: w3c/webdriver#385

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants