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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init() got an unexpected keyword 'desired_capabilites' #176

Open
viktor2097 opened this issue Aug 29, 2023 · 1 comment
Open

init() got an unexpected keyword 'desired_capabilites' #176

viktor2097 opened this issue Aug 29, 2023 · 1 comment

Comments

@viktor2097
Copy link

def __init__(
    self,
    browser="firefox",
    wait_time=2,
    command_executor=DEFAULT_URL,
    **kwargs
):
    browser_name = browser.upper()
    # Handle case where user specifies IE with a space in it
    if browser_name == "INTERNET EXPLORER":
        browser_name = "INTERNETEXPLORER"

    # If no desired capabilities specified, add default ones
    caps = getattr(DesiredCapabilities, browser_name, {})
    if kwargs.get('desired_capabilities'):
        # Combine user's desired capabilities with default
        caps.update(kwargs['desired_capabilities'])

    kwargs['desired_capabilities'] = caps

E TypeError: init() got an unexpected keyword argument 'desired_capabilities'

Fresh installations break due to changes in Selenium 4.10+, since there is no dependency range for selenium, it will install the latest version.

Setting selenium==4.9.1 in requirements.txt works for now

@oaken-source
Copy link

There is an upgrade guide from the selenium devs here:
https://www.selenium.dev/documentation/webdriver/troubleshooting/upgrade_to_selenium_4/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants