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

Can not set ElementsCollection field to SelenideAppiumCollection #2670

Closed
rosolko opened this issue Mar 4, 2024 · 1 comment · Fixed by #2677
Closed

Can not set ElementsCollection field to SelenideAppiumCollection #2670

rosolko opened this issue Mar 4, 2024 · 1 comment · Fixed by #2677

Comments

@rosolko
Copy link
Collaborator

rosolko commented Mar 4, 2024

The problem

Using of ElementsCollection instead of SelenideAppiumCollection inside appium page object class throw and IllegalArgumentException exception.

Tell us about your environment

  • Selenide-Appium Version: 7.2.0

Code To Reproduce Issue [ Good To Have ]

Page:

class PageWithCollection {
  @AndroidFindBy(xpath = "//android.widget.EditText")
  ElementsCollection editTexts;
}

Using:

public class Test {
  @Test
  public void collectionTest() {
    PageWithCollection pageWithCollection = page();
    pageWithCollection.editTexts.shouldHave(sizeGreaterThan(0));
  }
}

Throw:

Test > collectionTest() FAILED
    java.lang.IllegalArgumentException: Can not set com.codeborne.selenide.ElementsCollection field it.mobile.android.LoginPageWithCollections.editTexts to com.codeborne.selenide.appium.SelenideAppiumCollection
        at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
        at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
        at java.base/jdk.internal.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
        at java.base/java.lang.reflect.Field.set(Field.java:799)
        at com.codeborne.selenide.impl.SelenidePageFactory.setFieldValue(SelenidePageFactory.java:133)
        at com.codeborne.selenide.impl.SelenidePageFactory.initField(SelenidePageFactory.java:93)
        at com.codeborne.selenide.impl.SelenidePageFactory.initFields(SelenidePageFactory.java:86)
        at com.codeborne.selenide.impl.SelenidePageFactory.initElements(SelenidePageFactory.java:77)
        at com.codeborne.selenide.impl.SelenidePageFactory.page(SelenidePageFactory.java:64)
        at com.codeborne.selenide.impl.SelenidePageFactory.page(SelenidePageFactory.java:52)
        at com.codeborne.selenide.SelenideDriver.page(SelenideDriver.java:159)
        at com.codeborne.selenide.Selenide.page(Selenide.java:758)
@asolntsev
Copy link
Member

will be fixed by #2677

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

Successfully merging a pull request may close this issue.

2 participants