代码优化

This commit is contained in:
caiweichao 2024-02-07 09:00:01 +08:00
parent 5d8d6ab210
commit a3e9d59474
1 changed files with 7 additions and 2 deletions

View File

@ -91,8 +91,13 @@ class BasicPage:
:rollback: 是否将元素回滚
:return: None
"""
self.driver.execute_script("arguments[0].setAttribute('style', 'background: yellow; border: 2px solid red;');",
element)
try:
self.driver.execute_script(
"arguments[0].setAttribute('style', 'background: yellow; border: 2px solid red;');",
element)
except Exception as e:
Log.info(f"无法染色染色失效:{e}")
pass
def __wait_element_visible(self, model: str, locator: tuple) -> None:
"""