@@ -44,6 +44,7 @@ def test_anything(self):
44
44
from selenium.common.exceptions import (
45
45
ElementClickInterceptedException as ECI_Exception,
46
46
ElementNotInteractableException as ENI_Exception,
47
+ InvalidArgumentException,
47
48
MoveTargetOutOfBoundsException,
48
49
NoSuchElementException,
49
50
NoSuchWindowException,
@@ -1968,11 +1969,11 @@ def hover_on_element(self, selector, by="css selector"):
1968
1969
install_sb = (
1969
1970
"seleniumbase install chromedriver %s" % major_chrome_version
1970
1971
)
1971
- if major_chromedriver_version < major_chrome_version:
1972
+ if int( major_chromedriver_version) < int( major_chrome_version) :
1972
1973
# Upgrading the driver is required for performing hover actions
1973
1974
message = (
1974
- "\n"
1975
- "You need a newer chromedriver to perform hover actions!\n"
1975
+ "You need a newer version of \n"
1976
+ "chromedriver to perform hover actions!\n"
1976
1977
"Your version of chromedriver is: %s\n"
1977
1978
"And your version of Chrome is: %s\n"
1978
1979
"You can fix this issue by running:\n>>> %s\n"
@@ -11371,6 +11372,41 @@ def __click_with_offset(
11371
11372
"The offset must stay inside the target element!"
11372
11373
)
11373
11374
raise Exception(message)
11375
+ except InvalidArgumentException as e:
11376
+ if not self.browser == "chrome":
11377
+ raise Exception(e)
11378
+ driver_capabilities = self.driver.capabilities
11379
+ if "version" in driver_capabilities:
11380
+ chrome_version = driver_capabilities["version"]
11381
+ else:
11382
+ chrome_version = driver_capabilities["browserVersion"]
11383
+ major_chrome_version = chrome_version.split(".")[0]
11384
+ chrome_dict = self.driver.capabilities["chrome"]
11385
+ chromedriver_version = chrome_dict["chromedriverVersion"]
11386
+ chromedriver_version = chromedriver_version.split(" ")[0]
11387
+ major_chromedriver_version = chromedriver_version.split(".")[0]
11388
+ if (
11389
+ int(major_chromedriver_version) >= 76
11390
+ and int(major_chrome_version) >= 76
11391
+ ):
11392
+ raise Exception(e)
11393
+ install_sb = (
11394
+ "seleniumbase install chromedriver %s" % major_chrome_version
11395
+ )
11396
+ if int(major_chromedriver_version) < int(major_chrome_version):
11397
+ # Upgrading the driver is needed for performing canvas actions
11398
+ message = (
11399
+ "You need to upgrade to a newer\n"
11400
+ "version of chromedriver to perform canvas actions!\n"
11401
+ "Reason: github.com/SeleniumHQ/selenium/issues/7000"
11402
+ "\nYour version of chromedriver is: %s\n"
11403
+ "And your version of Chrome is: %s\n"
11404
+ "You can fix this issue by running:\n>>> %s\n"
11405
+ % (chromedriver_version, chrome_version, install_sb)
11406
+ )
11407
+ raise Exception(message)
11408
+ else:
11409
+ raise Exception(e)
11374
11410
if self.demo_mode:
11375
11411
self.__demo_mode_pause_if_active()
11376
11412
elif self.slow_mode:
0 commit comments