You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Table implementation is very slow (it takes about 30s in Firefox for this table https://en.wikipedia.org/wiki/List_of_highest_mountains), as such, I wanted to cache the output of getRowsAsString() as we often do multiple checks on the same data (we can be sure that no other operation will happen on the table to change it, and, if needs be, we can easily clear the cache).
My page object looks like:
@FindBy(css = "table") // luckily there's only oneprivateTablelistTable;
privateList<List<String>> rows; // rows cachepublicStringgetRankByName(Stringname) {
returngetRowByName(name).get(0);
}
publicStringgetHeightInFeetByName(Stringname) {
returngetRowByName(name).get(3);
}
privateList<String> getRowByName(Stringname) {
returngetRowStream()
.filter(row -> row.get(1).contains(name)) // find by name
.findFirst() // find the first one if it exists
.get(); // get the row, will throw exception if not found
}
privateStream<List<String>> getRowStream() {
if (null == rows) {
rows = listTable.getRowsAsString();
}
returnrows.stream()
.filter(row -> row.size() > 2); // make sure we have columns
}
However I get the following stack trace with the latest master of htmlelements.
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class
at ru.yandex.qatools.htmlelements.utils.HtmlElementUtils.getGenericParameterClass(HtmlElementUtils.java:95) ~[classes/:?]
at ru.yandex.qatools.htmlelements.utils.HtmlElementUtils.isTypifiedElementList(HtmlElementUtils.java:81) ~[classes/:?]
at ru.yandex.qatools.htmlelements.loader.decorator.HtmlElementDecorator.decorate(HtmlElementDecorator.java:62) ~[classes/:?]
at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:113) ~[selenium-support-2.48.2.jar:?]
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105) ~[selenium-support-2.48.2.jar:?]
at ru.yandex.qatools.htmlelements.loader.HtmlElementLoader.populatePageObject(HtmlElementLoader.java:251) ~[classes/:?]
at ru.yandex.qatools.htmlelements.loader.HtmlElementLoader.populatePageObject(HtmlElementLoader.java:241) ~[classes/:?]
Is there something that could be done to allow this? e.g. an @Ignore annotation, or only parsing paramaritised lists of WebElements?
The text was updated successfully, but these errors were encountered:
The Table implementation is very slow (it takes about 30s in Firefox for this table https://en.wikipedia.org/wiki/List_of_highest_mountains), as such, I wanted to cache the output of
getRowsAsString()
as we often do multiple checks on the same data (we can be sure that no other operation will happen on the table to change it, and, if needs be, we can easily clear the cache).My page object looks like:
However I get the following stack trace with the latest master of htmlelements.
Is there something that could be done to allow this? e.g. an
@Ignore
annotation, or only parsing paramaritised lists of WebElements?The text was updated successfully, but these errors were encountered: