javamavenapplitools

com.applitools.eyes.ServerConnector.startSession(ServerConnector.java:166)


I am trying to test a simple code with Applitolls and I got the above mentioned error. I have added all the dependencies in POM file.

Error: java.lang.NoSuchMethodError: javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)V at org.glassfish.jersey.client.ClientRequest.accept(ClientRequest.java:311) at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:198) at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:36) at com.applitools.eyes.ServerConnector.startSession(ServerConnector.java:166) at com.applitools.eyes.EyesBase.startSession(EyesBase.java:1694) at com.applitools.eyes.EyesBase.ensureRunningSession(EyesBase.java:1437) at com.applitools.eyes.EyesBase.openBase(EyesBase.java:1405) at com.applitools.eyes.selenium.Eyes.open(Eyes.java:331) at com.applitools.eyes.selenium.Eyes.open(Eyes.java:279) at com.dell.cm.systemIntegrationTest.Test.beforeTest(TestVxBlock.java:100)

Code:

public class TestAppli 
{
     WebDriver driver;
     Eyes eyes = new Eyes();
@BeforeTest 
public void beforeTest()
{
     eyes.setApiKey(""APPLITOOLS_API_KEY"");
     System.setProperty("webdriver.chrome.driver",
     "C:\\CloudIQ\\Automation\\system-integration- 
     test\\tools\\selenium\\chromedriver.exe");
     driver = new ChromeDriver();
     driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
     eyes.open(driver, "Test","LoginPage", new RectangleSize(700, 500));
     driver.get("https://demo.applitools.com");
}
@Test
public void mainTest()
{
 eyes.checkWindow("Login window"); 
}

@AfterTest
public void afterTest()
{
 eyes.close();
 driver.close(); 
 }
}

Solution

  • I was able to resolve it:

    Eyes is using Jersey2.x by default. If you are using Jersey1.x, please do as follow:

    1. Exclude eyes-connectivity-java3-jersey2x from Eyes-selenium dependency
    2. Add dependency for eyes-connectivity-java3-jersey1x

    Note that the version number of eyes connectivity should be the same as Eyes-selenium.