修复eles的bug

This commit is contained in:
g1879 2020-08-10 10:55:24 +08:00
parent 4c24a57537
commit c962e21163
4 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@ from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from .common import DrissionElement, get_loc_from_str, translate_loc_to_xpath, get_available_file_name
from .common import DrissionElement, get_loc_from_str, get_available_file_name
class DriverElement(DrissionElement):
@ -196,7 +196,7 @@ class DriverElement(DrissionElement):
:param show_errmsg: 出现异常时是否打印信息
:return: DriverElement对象组成的列表
"""
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
raise TypeError('Type of loc_or_str can only be tuple or str.')
return self.ele(loc_or_str, mode='all', show_errmsg=show_errmsg, timeout=timeout)

View File

@ -14,7 +14,7 @@ from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.remote.webelement import WebElement
from .common import get_loc_from_str, get_available_file_name, translate_loc_to_xpath
from .common import get_loc_from_str, get_available_file_name
from .driver_element import DriverElement, execute_driver_find
@ -147,7 +147,7 @@ class DriverPage(object):
:param show_errmsg: 出现异常时是否打印信息
:return: DriverElement对象组成的列表
"""
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
raise TypeError('Type of loc_or_str can only be tuple or str.')
return self.ele(loc_or_str, mode='all', timeout=timeout, show_errmsg=show_errmsg)

View File

@ -167,7 +167,7 @@ class SessionElement(DrissionElement):
:param show_errmsg: 出现异常时是否打印信息
:return: SessionElement对象组成的列表
"""
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
raise TypeError('Type of loc_or_str can only be tuple or str.')
return self.ele(loc_or_str, mode='all', show_errmsg=show_errmsg)

View File

@ -133,7 +133,7 @@ class SessionPage(object):
:param show_errmsg: 出现异常时是否打印信息
:return: SessionElement对象组成的列表
"""
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
raise TypeError('Type of loc_or_str can only be tuple or str.')
return self.ele(loc_or_str, mode='all', show_errmsg=True)