Skip to content

'WebDriver' object has no attribute 'is_connected' error for successful test #3748

Answered by mdmintz
merrillh asked this question in Q&A
Discussion options

You must be logged in to vote

Good catch. For now, override the is_connected() method as a workaround:

def is_connected(self, *args, **kwargs):
        return True

Full example:

from selenium import webdriver
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)

class BaseTestCase(BaseCase):
    def get_new_driver(self, *args, **kwargs):
        """This method overrides get_new_driver() from BaseCase."""
        options = webdriver.ChromeOptions()
        options.add_argument("--disable-notifications")
        if self.headless:
            options.add_argument("--headless=new")
            options.add_argument("--disable-gpu")
        options.add_experimental_option(
            "excludeSwitches", ["en…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants