ipatests: Fix UI_driver method after Selenium upgrade

`WebDriver.switch_to_active_element()` was deprecated in favour of
`driver.switch_to.active_element`.

Method was deprecated a long time ago, however deprecation message and
proxy method were removed recently and are not present in latest
version.

https://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webdriver.WebDriver.switch_to_active_element
https://www.selenium.dev/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html#selenium.webdriver.remote.webdriver.WebDriver.switch_to

Issue: https://pagure.io/freeipa/issue/9029

Signed-off-by: Armando Neto <abiagion@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Armando Neto 2021-11-17 17:29:45 -03:00
parent f224f6ade7
commit 15da3a8ea5
No known key found for this signature in database
GPG Key ID: ABAA4551C5F0D555

View File

@ -1056,7 +1056,7 @@ class UI_driver:
# Chrome does not close search area on click
if list_cnt.is_displayed():
self.driver.switch_to_active_element().send_keys(Keys.RETURN)
self.driver.switch_to.active_element.send_keys(Keys.RETURN)
self.wait()