fix: 'Action' as regular Exception

This commit is contained in:
2026-05-08 11:41:12 +08:00
parent 6829750f01
commit 21982afd64
3 changed files with 10 additions and 11 deletions

View File

@@ -10,8 +10,7 @@ from selenium.webdriver.support.wait import WebDriverWait
from selenium.common.exceptions import StaleElementReferenceException, TimeoutException
driver: WebDriver|None = None
attempts, timeout, interval = int(), float(), float()
identity = ''.join(random.choices(string.ascii_uppercase + string.digits, k=8))
attempts, timeout, interval, identity = int(), float(), float(), None
def until(condition: typing.Callable[[WebDriver], bool], watch=True):
try:
@@ -70,7 +69,8 @@ def click(selector: str|WebElement, wait=True, condition=False):
except: break
def setup(a: WebDriver, b: int, c: float, d: float):
global driver, attempts, timeout, interval
global identity, driver, attempts, timeout, interval
identity = ''.join(random.choices(string.ascii_uppercase + string.digits, k=8))
driver = a
attempts = b
timeout = c