Skip to content

[🚀 Feature]: Allow specifying a callable for the message argument in WebDriverWait.until / until_not. #14552

@moeyashi

Description

@moeyashi

Feature and motivation

I would like to construct an error message using the driver in the message argument of WebDriverWait.until / until_not when an error occurs.

Currently, it is necessary to use a try-catch structure, but if the message argument could accept a function, I believe it would allow for more readable code.

Usage example

WebDriverWait(driver, 10).until(lambda x: x.find_element(By.ID, "someId"), lambda x: f'Message: {x.current_url}')

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-supportIssue or PR related to support classesC-pyPython BindingsE-easyAn easy issue to implement or PR to reviewI-enhancementSomething could be betterR-help wantedIssues looking for contributions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions