DEV Community

Cover image for Selenium Page Factory
Anne Quinkenstein
Anne Quinkenstein

Posted on

Selenium Page Factory

how it works

FindBys - AND Condition

Eg: @FindBys({@FindBy(id = "foo"), @FindBy(className = "bar")})

HTML source code of a WebElement:

In POM:

@FindBys({
@FindBy(id = "searchId_1"),
@FindBy(name = "search_field")
})

WebElementSearchButton;

In the above example, the WebElement ‘SearchButton’ is located only if it matches both the criteria whose id value is “searchId_1” and the name value is “search_field”. Please note that the first criteria belong to a parent tag

and the second criteria for a child tag.

FindAll - OR Condition

@CacheLookUp

if a Webelement is approched several time, you can store it in cache

extended

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay