I have the following code:
WebDriverWait(self.driver, 20).until(expected_conditions.element_to_be_clickable(click))
Now this sometimes fails and I know why it fails. But the error gives me
TimeoutException: Message:
Which is useless. Can I possibly set this message?
You don't have to try/except or wrap anything; message
is just an argument of the until()
method.
WebDriverWait(self.driver, 20).until(expected_conditions.element_to_be_clickable(click),message='My custom message.',
)
This produces:
selenium.common.exceptions.TimeoutException: Message: My custom message.