You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases #88
File "xxxxxxxxxxxx/venv/lib/python3.8/site-packages/behave_webdriver/conditions.py", line 48, in <module>
class element_is_selected(NegationMixin, EC.element_located_to_be_selected):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Reproducable by running package tests:
git/behave-webdriver$ python setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing behave_webdriver.egg-info/PKG-INFO
writing dependency_links to behave_webdriver.egg-info/dependency_links.txt
writing requirements to behave_webdriver.egg-info/requires.txt
writing top-level names to behave_webdriver.egg-info/top_level.txt
reading manifest file 'behave_webdriver.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'behave_webdriver.egg-info/SOURCES.txt'
running build_ext
behave_webdriver (unittest.loader._FailedTest) ... ERROR
======================================================================
ERROR: behave_webdriver (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: behave_webdriver
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/loader.py", line 470, in _find_test_path
package = self._get_module_from_name(name)
File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/haavardw/git/behave-webdriver/behave_webdriver/__init__.py", line 15, in <module>
from behave_webdriver.driver import (Chrome,
File "/home/haavardw/git/behave-webdriver/behave_webdriver/driver.py", line 18, in <module>
from behave_webdriver.conditions import (element_is_present,
File "/home/haavardw/git/behave-webdriver/behave_webdriver/conditions.py", line 48, in <module>
class element_is_selected(NegationMixin, EC.element_located_to_be_selected):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>
selenium 4.0.0 was released yesterday and has changed EC.element_located_to_be_selected (and all the other classes in the same file) from being classes to functions, breaking the behave-webdriver pattern of inheritance and mixins.
Whats the status on fixing this. Older versions of selenium seem to be incompatible with modern versions of URLLIB3 (urllib3 changed something to do with socket timeouts)
Hi @shayneoneill I don't think I have a great answer for this right now. I'm not currently actively developing this project. I may find some time to take a closer look, but I can't make any promises right now.
I would be willing to review and accept pull requests for a fix, however, if someone else wants to take a stab at it.
Activity
haavardw commentedon Oct 13, 2021
downgrading to
selenium == 3.141.0works around the issuekevin-pelago commentedon Oct 14, 2021
I'm also encountering this issue. downgrading selenium works for me too.
haavardw commentedon Oct 14, 2021
selenium 4.0.0 was released yesterday and has changed
EC.element_located_to_be_selected(and all the other classes in the same file) from being classes to functions, breaking the behave-webdriver pattern of inheritance and mixins.spyoungtech commentedon Dec 11, 2021
Thanks for tracking down the breaking change. I'll see if I can update the code to play nice in selenium 3.x and 4.x
For now, I've set
selenium < 4in the requirements (released oct 25 with v0.3.1).shayneoneill commentedon Oct 17, 2023
Whats the status on fixing this. Older versions of selenium seem to be incompatible with modern versions of URLLIB3 (urllib3 changed something to do with socket timeouts)
spyoungtech commentedon Oct 26, 2023
Hi @shayneoneill I don't think I have a great answer for this right now. I'm not currently actively developing this project. I may find some time to take a closer look, but I can't make any promises right now.
I would be willing to review and accept pull requests for a fix, however, if someone else wants to take a stab at it.