Handle case where user overrides get_new_driver()

This commit is contained in:
Michael Mintz 2022-03-17 23:48:39 -04:00
parent b95faee01e
commit c1b6d5238f
1 changed files with 5 additions and 0 deletions

View File

@ -11418,6 +11418,11 @@ class BaseCase(unittest.TestCase):
self._default_driver = self.driver
if self._reuse_session:
sb_config.shared_driver = self.driver
if len(self._drivers_list) == 0:
# The user is overriding self.get_new_driver()
# (Otherwise this code shouldn't be reachable)
self._drivers_list.append(self.driver)
self._drivers_browser_map[self.driver] = self.browser
if self.browser in ["firefox", "ie", "safari", "opera"]:
# Only Chrome and Edge browsers have the mobile emulator.