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

List<ButtonElement> results in ClassCastException #1

Open
kameamea opened this issue Nov 19, 2015 · 1 comment
Open

List<ButtonElement> results in ClassCastException #1

kameamea opened this issue Nov 19, 2015 · 1 comment

Comments

@kameamea
Copy link

When I'm using this nice addon for lists of elements I'm restricted to WebElements/TestBenchElements: With any other element like ButtonElement, for example in this code:

@FindByVaadin()
private List<ButtonElement> buttons;

ButtonElement b = buttons.get(0);

results in

java.lang.ClassCastException: com.vaadin.testbench.TestBenchElement_$$_jvst7f2_1 cannot be cast to com.vaadin.testbench.elements.ButtonElement

If I replace ButtonElement in the above code with TestBenchElement everywhere there is no exception thrown. But I don't have access to the specialized types then as well.

@mouellet
Copy link
Owner

Since I've never came across the need for this feature while working with the PageObject pattern, I haven't implemented any specialized element list locator. That's why the Selenium default is applied and it only works with WebElements/TestBenchElements.

I think this could be done by replacing the LocatingElementListHandler of the TestBenchElementDecorator.proxyForListLocator method by one that would create the specialized TestBenchElement...

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

No branches or pull requests

2 participants