We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The python first/always logic in the python client doesn't successfully handle the case where capability values are arrays
from selenium.webdriver.remote.webdriver import WebDriver from selenium.webdriver import FirefoxOptions alternative_1 = FirefoxOptions() alternative_1.set_capability("vendor:sameList", []) alternative_2 = FirefoxOptions() alternative_2.set_capability("vendor:sameList", []) WebDriver(options=[alternative_1, alternative_2])
Everything works as expected
/Users/bob/.pyenv/versions/selenium/bin/python /blah/blah/blah/selenium/try.py Traceback (most recent call last): File "/blah/blah/blah/selenium/try.py", line 8, in <module> WebDriver(options=[alternative_1, alternative_2]) File "/Users/bob/.pyenv/versions/selenium/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 224, in __init__ capabilities = create_matches(options) File "/Users/bob/.pyenv/versions/selenium/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 133, in create_matches samesies.update(opts[min_index].items() & opts[i + 1].items()) TypeError: unhashable type: 'list'
See above
OS: macOS Browser: Firefox Browser version: n/a Browser Driver version: n/a Language Bindings version: pre-beta4 Selenium Grid version (if applicable): n/a
The text was updated successfully, but these errors were encountered:
Looking at this it only seems to appear when the list is empty. I can recreate the issue when I do the following test
def test_can_set_multiple_options_with_different_arrays(): from selenium.webdriver.firefox.options import Options as FirefoxOptions expected = { "capabilities": { "alwaysMatch": { "browserName": "firefox", "pageLoadStrategy": "normal", "platform": "ANY", "version": "" }, "firstMatch": [ { "vendor:sameList": [] }, { "vendor:sameList": [] } ] } } alternative_1 = FirefoxOptions() alternative_1.set_capability("vendor:sameList", []) alternative_2 = FirefoxOptions() alternative_2.set_capability("vendor:sameList", []) result = webdriver.create_matches([alternative_1, alternative_2]) assert result == expected
However, a similar test that populates an array is passing as we can see in the test in https://github.com/SeleniumHQ/selenium/blob/trunk/py/test/unit/selenium/webdriver/remote/new_session_tests.py#L76-L100 so wonder if there is a bug in python here or at least my understanding of how the union code should work in the python standard library
Sorry, something went wrong.
2e53853
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
🐛 Bug Report
The python first/always logic in the python client doesn't successfully handle the case where capability values are arrays
To Reproduce
Expected behavior
Everything works as expected
Actual behavior
Test script or set of commands reproducing this issue
See above
Environment
OS: macOS
Browser: Firefox
Browser version: n/a
Browser Driver version: n/a
Language Bindings version: pre-beta4
Selenium Grid version (if applicable): n/a
The text was updated successfully, but these errors were encountered: