Тестирование гибридного приложения. Как получит значение цвета в Selenium?

Всем привет! Я тестирую гибридное приложение. Использую WebDriver+java+Appium
Надо протестировать цвет элемента, но мне выдается ошибка.
@Test public void Q1() { OpenMainMenu(); driver.scrollTo("Products").click(); driver.findElement(By.xpath(".//*[@text='Video']")).click(); String Color = driver.findElement(By.xpath("//android.widget.ImageView[@index='1']")).getCssValue("color"); System.out.println(Color); String hex = String.format("#%02x%02x%02x", 102,102,102); System.out.println(hex); }
И вот ошибка:
org.openqa.selenium.WebDriverException: Not yet implemented.(WARNING: The server did not provide any stacktrace information) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:43) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327) at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:37) at io.appium.java_client.MobileElement.execute(MobileElement.java:1) at io.appium.java_client.android.AndroidElement.execute(AndroidElement.java:1) at org.openqa.selenium.remote.RemoteWebElement.getCssValue(RemoteWebElement.java:184) at io.appium.java_client.DefaultGenericMobileElement.getCssValue(DefaultGenericMobileElement.java:149) at io.appium.java_client.MobileElement.getCssValue(MobileElement.java:1) at io.appium.java_client.android.AndroidElement.getCssValue(AndroidElement.java:1) at com.test.SwipeElement.Q1(SwipeElement.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:774) at org.testng.TestRunner.run(TestRunner.java:624) at org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at org.testng.SuiteRunner.run(SuiteRunner.java:261) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215) at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) at org.testng.TestNG.run(TestNG.java:1048) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:74) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:121) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Уверены что у элемента на странице есть этот аттрибут?.. и что вообще элемент был найден правильно, а не указывает на некоторый абстрактный нул? (Джавы не знаю)

Эксепшен гласит, что не реализован еще этот метод.

1 лайк

Вообще-то вроде как с 2009 имплементирован согласно апи документации. Не думаю что используется более старый… хоть где-нибудь ещё в мире.
Так что возможно родительский элемент не найден… или найден неправильно.

Да, атрибуты не найдены, так что я никак не протестирую в аппиуме(