I read the documentation for ElementClickInterceptedException but I’m not sure what are its arguments. I saw the parameters but I’m not sure what they mean, here is the code:
class ElementClickInterceptedException(WebDriverException):
"""The Element Click command could not be completed because the element
receiving the events is obscuring the element that was requested to be
clicked."""
and this is the code for WebDriverException:
class WebDriverException(Exception):
"""Base webdriver exception."""
def __init__(
self, msg: Optional[str] = None, screen: Optional[str] = None, stacktrace:
Optional[Sequence[str]] = None
) -> None:
super().__init__()
self.msg = msg
self.screen = screen
self.stacktrace = stacktrace
def __str__(self) -> str:
exception_msg = f"Message: {self.msg}n"
if self.screen:
exception_msg += "Screenshot: available via screenn"
if self.stacktrace:
stacktrace = "n".join(self.stacktrace)
exception_msg += f"Stacktrace:n{stacktrace}"
return exception_msg
So what do msg
, screen
and stacktrace
mean?
They refer to the error message, the screenshot when the exception occurs (if any) and the stack trace when the exception occurs. Except for the last one which is more difficult to understand, the first two are easy to understand. The last one appears in the log and can quickly locate the occurrence. Wrong code location