joyzoursky / docker-python-chromedriver

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)
https://hub.docker.com/r/joyzoursky/python-chromedriver/
MIT License
636 stars 196 forks source link

Adjusted testscript code for latest Selenium version #32

Closed alexanderroidl closed 1 year ago

alexanderroidl commented 2 years ago

Selenium changelog:

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)
alexanderroidl commented 1 year ago

@joyzoursky ?