我通过TestNG运行TestNG Selenium Suite并使用Applitools Eyes视觉比较工具。我遇到了
当我的代码遇到眼睛时出现java.lang.ClassCastException:java.lang.Double无法强制转换为java.lang.Long
错误.checkWindow();
眼睛版本3.2
代码:
public class HelloWorld2 {
WebDriver driver;
Eyes eyes;
String testName;
@Test
public void VLPRun() throws MalformedURLException, InterruptedException {
// AppliTools Setup ---------------------------------------------
eyes = new Eyes();
eyes.setApiKey("###########################");
eyes.setForceFullPageScreenshot(false);
eyes.setMatchLevel(MatchLevel.LAYOUT);
// Launch Driver Eyes Instance ---------------------------------------------
driver = eyes.open(driver, "VLPs", "2017-mazda3-sedan", new RectangleSize(1000, 580));
// Perform Tests ---------------------------------------------
driver.get("https://www.google.com");
Thread.sleep(2000);
eyes.checkWindow();
// End the test.
eyes.close();
}
@AfterClass
public void tearDown() {
driver.quit();
eyes.abortIfNotClosed();
}
}
有什么想法吗?
堆栈跟踪:
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Long
at com.applitools.eyes.selenium.EyesSeleniumUtils.getCurrentScrollPosition(EyesSeleniumUtils.java:221)
at com.applitools.eyes.selenium.ScrollPositionProvider.getCurrentPosition(ScrollPositionProvider.java:29)
at com.applitools.eyes.selenium.FullPageCaptureAlgorithm.getStitchedRegion(FullPageCaptureAlgorithm.java:192)
at com.applitools.eyes.selenium.Eyes.getScreenshot(Eyes.java:1900)
at com.applitools.eyes.EyesBase.getAppOutputWithScreenshot(EyesBase.java:1397)
at com.applitools.eyes.EyesBase.access$000(EyesBase.java:16)
at com.applitools.eyes.EyesBase$1.getAppOutput(EyesBase.java:960)
at com.applitools.eyes.MatchWindowTask.matchWindow(MatchWindowTask.java:117)
at com.applitools.eyes.EyesBase.checkWindowBase(EyesBase.java:968)
at com.applitools.eyes.selenium.Eyes.checkWindow(Eyes.java:360)
at com.applitools.eyes.selenium.Eyes.checkWindow(Eyes.java:336)
at mazdaVLPImport.VLPTest.start(VLPTest.java:83)
at mazdaVLPImport.Experiment.Mazda_Window_600_400(Experiment.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)