splinter
splinter copied to clipboard
Exception when using the latest Selenium
Hi, for my tests I always use the last Selenium docker image:
version: '3.7'
services:
django:
build:
context: .
depends_on:
- selenium
selenium:
image: selenium/standalone-chrome:latest
shm_size: '4G'
With the last Selenium I get the following exception:
Traceback (most recent call last):
File "/source/lib/unittest.py", line 49, in setUpClass
cls.browser = Browser(
^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/splinter/browser.py", line 125, in Browser
return get_driver(driver, retry_count=retry_count, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/splinter/browser.py", line 93, in get_driver
return driver(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/splinter/driver/webdriver/remote.py", line 44, in __init__
driver = Remote(command_executor, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: WebDriver.__init__() got an unexpected keyword argument 'desired_capabilities'
Digest: sha256:da6d0894a465c938a8134f44c1bfcc4e0adaca45296dc65d3fed87e1b6b8ee2fwas fineDigest: sha256:9fd0fe4f8a39f65aeecbdb38fc35eda6e505f217d9c0f0d3420b17cd187e9216fails
The problem seems to be the latest selenium PyPi package (4.10). When downgrading to 4.9.1 all is fine.
I found this post which seems to explain pretty well what needs to change to work with selenium 4.10: https://stackoverflow.com/questions/76430192/getting-typeerror-webdriver-init-got-an-unexpected-keyword-argument-desi
Fixed by #1202