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

ElementsCollection annotated with @FindBy is not initialized #186

Closed
rishaselfing opened this Issue Jun 23, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@rishaselfing

rishaselfing commented Jun 23, 2015

When using Page Object pattern PageFactory does not decorate ElementsCollection fields, so I'm getting NullPointerException. You can reproduce it on your own Google classic page object example.

@rishaselfing rishaselfing changed the title from ElementsCollection annotated with @FindBy is not initialised to ElementsCollection annotated with @FindBy is not initialized Jun 23, 2015

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Jun 23, 2015

Member

Thank you for reporting, I will investigate it asap.

Member

asolntsev commented Jun 23, 2015

Thank you for reporting, I will investigate it asap.

@asolntsev asolntsev closed this in 92394db Jun 23, 2015

@asolntsev asolntsev added this to the 2.20 milestone Jun 23, 2015

@asolntsev asolntsev added the ready label Jun 23, 2015

@asolntsev asolntsev self-assigned this Jun 23, 2015

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Jun 23, 2015

Member

Hi @rishaselfing !
In the "classic_page_object" folder, there is a test using pure Selenium code. I mean, class org.selenide.examples.google.classic_page_object.GoogleTest does not use Selenide. It uses selenium built-in factory org.openqa.selenium.support.PageFactory. It's not supposed to support Selenide classes.

Thought, you are right, Selenide page factory actually cannot inject ElementsCollection fields.
I have fixed it in Selenide 2.20 (it's not released yet). I have also added such an example to Google example:
https://github.com/selenide-examples/google/tree/master/test/org/selenide/examples/google/selenide_page_object_with_fields

Member

asolntsev commented Jun 23, 2015

Hi @rishaselfing !
In the "classic_page_object" folder, there is a test using pure Selenium code. I mean, class org.selenide.examples.google.classic_page_object.GoogleTest does not use Selenide. It uses selenium built-in factory org.openqa.selenium.support.PageFactory. It's not supposed to support Selenide classes.

Thought, you are right, Selenide page factory actually cannot inject ElementsCollection fields.
I have fixed it in Selenide 2.20 (it's not released yet). I have also added such an example to Google example:
https://github.com/selenide-examples/google/tree/master/test/org/selenide/examples/google/selenide_page_object_with_fields

@rishaselfing

This comment has been minimized.

Show comment
Hide comment
@rishaselfing

rishaselfing commented Jun 24, 2015

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment