element_exceptions.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. class AutomationFrameworkException(Exception):
  2. """自动化框架基础异常"""
  3. pass
  4. class ElementNotFoundException(AutomationFrameworkException):
  5. """元素未找到异常"""
  6. def __init__(self, message="元素未找到"):
  7. super().__init__(message)
  8. class ElementNotInteractableException(AutomationFrameworkException):
  9. """元素不可交互异常"""
  10. def __init__(self, message="元素不可交互"):
  11. super().__init__(message)
  12. class ElementNotVisibleException(AutomationFrameworkException):
  13. """元素不可见异常"""
  14. def __init__(self, message="元素不可见"):
  15. super().__init__(message)
  16. class TimeoutException(AutomationFrameworkException):
  17. """超时异常"""
  18. def __init__(self, message="操作超时"):
  19. super().__init__(message)
  20. class ConfigurationException(AutomationFrameworkException):
  21. """配置异常"""
  22. def __init__(self, message="配置错误"):
  23. super().__init__(message)
  24. class DatabaseException(AutomationFrameworkException):
  25. """数据库异常"""
  26. def __init__(self, message="数据库操作错误"):
  27. super().__init__(message)
  28. class APIException(AutomationFrameworkException):
  29. """API异常"""
  30. def __init__(self, message="API调用错误"):
  31. super().__init__(message)
  32. class TestDataException(AutomationFrameworkException):
  33. """测试数据异常"""
  34. def __init__(self, message="测试数据错误"):
  35. super().__init__(message)
  36. class SecurityTestException(AutomationFrameworkException):
  37. """安全测试异常"""
  38. def __init__(self, message="安全测试错误"):
  39. super().__init__(message)
  40. class PerformanceTestException(AutomationFrameworkException):
  41. """性能测试异常"""
  42. def __init__(self, message="性能测试错误"):
  43. super().__init__(message)