Closed Bug 1556026 Opened 6 years ago Closed 6 years ago

User prompt of type promptUserAndPass is not supported when entering text in an alert()

Categories

(Testing :: geckodriver, defect)

67 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1556307

People

(Reporter: elinnore, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

I am using python selenium to go through an authentication process.
The code is opening a page that displays an alert.
I am passing some text to the alert and I obtain the error mentioned in the next section.
This issue occurred after Firefox was updated to 67.0.
Code works fine using any version < 67.0 (55.0+).
OS: MacOS 10.14.5
Issue is present in on multiple OS and was reported already to Selenium:
https://github.com/SeleniumHQ/selenium/issues/7239

This might not be an issue related to Firefox as everything works fine in GUI. However, what has been changed in Firefox 67.0 with respect to alerts?

python 3.7.0
selenium 3.141.0
geckodriver: v0.24.0 (https://github.com/mozilla/geckodriver/releases)

Code:

import os
import sys
import pdb
from selenium.webdriver import Firefox

file_path = os.path.realpath(__file__)
head, tail = (os.path.split(file_path))
sys.path.append(head)
os.environ['PATH'] += os.pathsep + head

base_url = 'https://www.httpwatch.com/httpgallery/authentication/'
browser = Firefox()
browser.get(base_url)
browser.find_element_by_id('displayImage').click()
dialog = browser.switch_to.alert
dialog.send_keys('myuser' + u'\ue004' + 'mypass')

Actual results:

Error

Traceback (most recent call last):
File "reproduce_issue.py", line 15, in <module>
dialog.send_keys('myuser' + u'\ue004' + 'mypass')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/alert.py", line 103, in send_keys
'text': keysToSend})
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: User prompt of type promptUserAndPass is not supported

geckodriver logs does not show anything unusual:
1559319483021 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-foreground" "-no-remote" "-profile" "/var/folders/g1/smt5x4015m99pgvtvgd8v4s00000gn/T/rust_mozprofile.6PWiPBAVL7BC"
1559319483439 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1559319483439 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1559319483439 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
1559319484797 Marionette INFO Listening on port 60108
1559319484880 Marionette WARN TLS certificate errors will be ignored for this session

Expected results:

'myuser' TAB 'mypass' are entered

Product: Firefox → WebExtensions
Component: Untriaged → geckodriver
Product: WebExtensions → Testing

Please see the developer changes for Marionette (Webdriver) in Firefox 67:

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/67#WebDriver_conformance_(Marionette)

Generally, using HTTPAuth dialogs isn't supported yet by any driver. As such there is a need for a new API end-point which will be defined/setup via https://github.com/w3c/webdriver/issues/385. Sadly we cannot add this before the spec has been written.

So that behavior is expected for the moment, and you will have to wait for bug 1556307 being fixed.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.