I am having a complex python-selenium test suite to test a non-public webpage. In that setup I need to get the webdriver like follows:
self.driver = webdriv
This happened to me in my Django app. The problem went away when I set DEBUG = False in my settings.py file.
DEBUG = False
settings.py