question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Splinter 0.18.0: `AttributeError: module 'splinter.driver.webdriver.firefox' has no attribute 'WebDriverElement'`

See original GitHub issue

Problem

============================================================================================ ERRORS =============================================================================================
_____________________________________________________________________________ ERROR at setup of test_file ______________________________________________________________________________

    @pytest.fixture(scope="session")
    def browser_patches():
        """Browser monkey patches."""
        patch_webdriver()
>       patch_webdriverelement()

.direnv/python-3.9.12/lib/python3.9/site-packages/pytest_splinter/plugin.py:278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def patch_webdriverelement():  # pragma: no cover
        """Patch the WebDriverElement to allow firefox to use mouse_over."""

        def mouse_over(self):
            """Perform a mouse over the element which works."""
            (
                ActionChains(self.parent.driver)
                .move_to_element_with_offset(self._element, 2, 2)
                .perform()
            )

        # Apply the monkey patch for Firefox WebDriverElement
>       firefox.WebDriverElement.mouse_over = mouse_over
E       AttributeError: module 'splinter.driver.webdriver.firefox' has no attribute 'WebDriverElement'

.direnv/python-3.9.12/lib/python3.9/site-packages/pytest_splinter/splinter_patches.py:21: AttributeError
==================================================================================== short test summary info ====================================================================================
ERROR test_file.py::test_file - AttributeError: module 'splinter.driver.webdriver.firefox' has no attribute 'WebDriverElement'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================================= 1 error in 0.63s ========================================================================================

Temporary workaround

patch_webdriverelement can be disabled by overriding fixture

from pytest_splinter.webdriver_patches import patch_webdriver

@pytest.fixture(scope="session")
def browser_patches():
    patch_webdriver()

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mpasternakcommented, Aug 8, 2022

@kalekseev thank you for both the problem report and the initial patch idea, as it saved my life. Looks like it is no longer relevant - closing it. Thanks!

1reaction
kalekseevcommented, Aug 8, 2022

pip install https://github.com/pytest-dev/pytest-splinter/archive/master.tar.gz works

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'selenium.webdriver.firefox' has no ...
This error message... AttributeError: module 'selenium.webdriver.firefox' has no attribute 'find_element_by_name'.
Read more >
Firefox WebDriver — Splinter 0.18.1 documentation
Starting with Firefox 55, Firefox can run in a headless mode. To use headless mode, pass the headless argument when creating a new...
Read more >
[selenium-users] How to fix AttributeError: 'module' object has ...
I want to start hub and node. But I get this,. Traceback (most recent call last): File "example.py", line 22, in < ...
Read more >
Unable to lanuch the Firefox browser on an Android device via ...
Firefox ("C:\\Users\\mhmdyunus\\Downloads\\Drivers\\geckodriver.exe", ... AttributeError: type object 'Options' has no attribute ...
Read more >
Python - Need Help Again | Sololearn: Learn to code for FREE!
Firefox () AttributeError: module 'selenium' has no attribute 'webdriver' ... Wrong again... import selenium from selenium import webdriver driver ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found