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
Selenide support for PageObjects without @FindBy annotations #443
Conversation
@SergeyPirogov Next time please add tests too! |
@asolntsev I had tests included in pull requests |
@SergeyPirogov Thank you! We recently released Selenide 4.2.1 that contains this improvement. |
Selenide 4.7.1. For example I have the following code:
And after calling page(AdminHomePage.class) I receive following error
|
@CaBocuk It works in selenide tests https://github.com/codeborne/selenide/blob/fa4caf8dbe527533ab69e222022e0a5128311de6/src/test/java/integration/PageObjectTest.java If you ran into issue create reproducible example and report it https://github.com/codeborne/selenide/issues/new Do not write comments to closed PR's. |
This PR fixes problem with initialization PageObjects that have SelenideElements declared as Class fields. See example below:
class StartPage{
private SelenideElement startPage = $("#start-page");
}
Before fix, if we use Selenide methods open("url",Class) or page(class) Selenide ignored field initialization and tried to find element by ID or Name of class field.