In python, selenium, how do I set the error messages for a wait?
问题 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? 回答1: 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