python+appium
try:
if FindMethod == 'byid':
DriverIndex.find_element_by_id(Value)
elif FindMethod == 'byxpath':
DriverIndex.find_element_by_xpath(Value)
except NoSuchElementException as x:
总是报错,说NoSuchElementException 没有定义
NameError: global name 'NoSuchElementException' is not defined
但我find_element_by_id如果找不到的话,异常名明明是NoSuchElementException