Skip to content

WebDriver.__init__() got an unexpected keyword argument 'executable_path' #184

@agatheblues

Description

@agatheblues

Hello,

I am trying to run an e2e test with splinter and a custom chromedriver executable path via the cli argument --splinter-webdriver-executable /path/to/chromedriver.

kwargs = {'executable_path': '/path/to/chromedriver'}

    def _setup_chrome(driver_class, config=None, options=None, service=None, **kwargs):
        """
        Returns: selenium.webdriver.Chrome || selenium.webdriver.Remote
        """
        if config.user_agent is not None:
            options.add_argument(f"--user-agent={config.user_agent}")

        if config.incognito:
            options.add_argument("--incognito")

        if config.fullscreen:
            options.add_argument("--kiosk")

        if config.headless:
            options.add_argument("--headless")
            options.add_argument("--disable-gpu")

        if config.extensions:
            for extension in config.extensions:
                options.add_extension(extension)

        if driver_class == Remote:
            rv = driver_class(options=options, **kwargs)
        else:
>           rv = driver_class(options=options, service=service, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'

[...]

DeprecationWarning: Webdriver's executable_path argument has been deprecated.Please pass in a selenium Service object instead.
    return driver(config=config, *args, **kwargs)

It seems that this option does not work anymore and that executable_path argument has been deprecated. Anything you can do?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions