Dockerfile for running Python Selenium in headless Chrome (Python 2.7 / 3.6 / 3.7 / 3.8 / Alpine based Python / Chromedriver / Selenium / Xvfb included in different versions)
Selenium 4.3.0
* Deprecated find_element_by_* and find_elements_by_* are now removed (#10712)
* (...)
This update made test_script.py always fail:
root@d224c891145c:/usr/workspace# python test_script.py
test_case_1 (__main__.TestTemplate)
Find and click top-left logo button ... ERROR
test_case_2 (__main__.TestTemplate)
Find and click top-right Start your project button ... ERROR
======================================================================
ERROR: test_case_1 (__main__.TestTemplate)
Find and click top-left logo button
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/workspace/test_script.py", line 31, in test_case_1
el = self.driver.find_element_by_class_name('header__logo')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_class_name'
======================================================================
ERROR: test_case_2 (__main__.TestTemplate)
Find and click top-right Start your project button
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/workspace/test_script.py", line 40, in test_case_2
el = self.driver.find_element_by_class_name("header__cta")
AttributeError: 'WebDriver' object has no attribute 'find_element_by_class_name'
----------------------------------------------------------------------
Ran 2 tests in 2.878s
FAILED (errors=2)
Selenium changelog:
This update made
test_script.py
always fail: