Skip to content

Keyword Expect Element doesn't expect locator as a Element #482

Description

@daniel-gibot

Description :
Reading the documentation of the keyword, "Expect Element" waits a locator.

Verifies that the element with the given locator has the desired state (visible, not visible, enabled, disabled.)

But in the code :

def expect_element(self, locator: str, state: Literal["visible", "not visible", "enabled...

But it's replacing "Element should be *" and these keywords were expecting "locator" and not "locator:str".
It's blocking the usage of an element in "Get Weblements" that is very useful.

When used, we get this error :

ValueError: Element locator with prefix '<appium.webdriver.webelement.webelement (session' is not supported

Proposed solutions
Allow the possibility of giving a locator as an element and not only as a string.

Example use case

${elements}=  Get Webelements  //myelements
FOR  ${element}  IN  @{elements}
    # This is working
    Element Should Be Visible  ${element}
    # This is not working and was very useful
    Expect Element  ${element}  state=visible  
END

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions