Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added fix for Page Should Contain Element not accepting lists #1867

9 changes: 9 additions & 0 deletions atest/acceptance/locators/locator_parsing.robot
Expand Up @@ -47,6 +47,15 @@ Multiple Locators with double arrows as separator should work
Multiple Locators strategy should be case-insensitive
Page Should Contain Element cSs=div#div_id >> XpaTh=a[6] >> iD=image1_id

Multiple Locators as a List should work
${element} = Get WebElement id:foo:bar
${locator_list} = Create List id:div_id ${element} id:bar=foo
Page Should Contain Element ${locator_list}

WebElement as locator should work
${element} = Get WebElement id:foo:bar
Page Should Contain Element ${element}

When One Of Locator From Multiple Locators Is Not Found Keyword Fails
Run Keyword And Expect Error
... Element with locator 'id:not_here' not found.
Expand Down
2 changes: 1 addition & 1 deletion src/SeleniumLibrary/keywords/element.py
Expand Up @@ -143,7 +143,7 @@ def page_should_contain(self, text: str, loglevel: str = "TRACE"):
@keyword
def page_should_contain_element(
self,
locator: Union[WebElement, str],
locator: Union[WebElement, str, List[Union[WebElement,str]]],
message: Optional[str] = None,
loglevel: str = "TRACE",
limit: Optional[int] = None,
Expand Down