Splinter 0.18.0: `AttributeError: module 'splinter.driver.webdriver.firefox' has no attribute 'WebDriverElement'`
See original GitHub issueProblem
============================================================================================ 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:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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!
pip install https://github.com/pytest-dev/pytest-splinter/archive/master.tar.gz
works