diff --git a/src/webdrivers/firefox.py b/src/webdrivers/firefox.py index 09feefb3f..6e3cb60e7 100644 --- a/src/webdrivers/firefox.py +++ b/src/webdrivers/firefox.py @@ -36,8 +36,7 @@ def create_options(self) -> webdriver.FirefoxOptions: options.set_preference(key, value) if self.profile.profile_path: - profile = webdriver.FirefoxProfile(self.profile.profile_path) - options.profile = profile + options.set_preference("profile", self.profile.profile_path) logger.debug(f"Using Firefox profile directory: {self.profile.profile_path}") else: options.set_preference("browser.privatebrowsing.autostart", True) diff --git a/tests/test_utils.py b/tests/test_utils.py index f02af1374..1cb09e6c6 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -75,7 +75,7 @@ def test_scroll_slow_element_not_scrollable(mocker): # Test chrome_browser_options function def test_chrome_browser_options(mocker): - mocker.patch("os.path.dirname", return_value="/mocked/path") + mocker.patch("os.path.dirname", return_value="mocked/path") mocker.patch("os.path.basename", return_value="profile_directory") mock_options = mocker.Mock()