vaadin / testbench

Vaadin TestBench is a tool for automated user interface testing of Vaadin applications.
https://vaadin.com/testbench
Other
20 stars 22 forks source link

NoSuchMethodError testing Notification (WebDriverWait.until()) on TestBench 5.1.0.beta1 #947

Open KatriHaapalinna opened 6 years ago

KatriHaapalinna commented 6 years ago

Calling close() on NotificationElement results in NoSuchMethodError for org.openqa.selenium.support.ui.WebDriverWait.until(...

testError(NotificationIT)  Time elapsed: 11.739 sec  <<< ERROR!
java.lang.NoSuchMethodError:org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;
    at com.vaadin.testbench.elements.NotificationElement.close(NotificationElement.java:41)
    at NotificationIT.testError(NotificationIT.java:33)

testNotification(NotificationIT)  Time elapsed: 4.681 sec  <<< ERROR!
java.lang.NoSuchMethodError:
org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;
    at com.vaadin.testbench.elements.NotificationElement.close(NotificationElement.java:41)
    at NotificationIT.testNotification(NotificationIT.java:46)

Setup: OS: Win 10 TestBench: 5.1.0,alpha1 or higher Browser: Chrome 61.x Driver: ChromeDriver 2.33.x Java: jdk 1.8

Reproducible by minimal example attached. testbench_error_example.zip

Artur- commented 6 years ago

Sounds like multiple Selenium versions on the classpath

Petikoch commented 6 years ago

I can confirm this issue, also for the recently released final TestBench 5.1.0 Version (we try to use it together with Vaadin 8.1.6)

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;

    at com.vaadin.testbench.elements.NotificationElement.close(NotificationElement.java:41)
    at ch.concordia.fachtest.cockpit.webapp.guitests.pageobjects.RootPageObject.lambda$closeAllNotifications$1(RootPageObject.java:62)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
        ...

I don't have multiple selenium versions in my classpath. I cleaned up my gradle dependencies to have only selenium 3.4.0 in my classpath.

Looking at the code I see NotificationElement is from vaadin-testbench-api-8.1.6.jar. And as far as I know, Vaadin 8.1.6 is "compiled against" TestBench 5.0.0 which uses Selenium 2.53.1. And looking at the code of selenium-support 2.53.1 and 3.4.0, I see the breaking change in the signature of WebDriverWait#until.

So this makes some kind of sense for me... But how to resolve this? Do we need a new Vaadin 8.1.x version using TestBench 5.1.0 @Artur- ? Or do we need to wait for / and upgrade to Vaadin 8.2.0 in order to be able to use Vaadin TestBench 5.1.0? What is/should be the compatibility of Vaadin TestBench 5.1.0?

alvarezguille commented 6 years ago

Hi @Petikoch,

You're completely right about vaadin-testbench-api for 8.1 or lower being is "compiled against" TestBench 5.0.0 which uses older Selenium (3.0.1).

We have fixed this in 8.2 which is now in beta, you can test now with vaadin-testbench-api 8.2.0.beta1 in vaadin-prereleases, but because it's a breaking change in API I don't think we can release vaadin-testbench-api 8.1.x compatible with vaadin-testbench 5.1.0.

Also, I'd need to check before confirming, but it's most probably safe to use vaadin-testbench-api 8.2 with framework 8.1