错误方法未实现

时间:2017-07-05 14:58:07

标签: java selenium selenium-webdriver selenium-chromedriver

我试图使用uiautomator和selenium获取Android应用中元素的起始坐标和大小。我被困在这一点上。代码说WebElement是一个接口。所以我甚至尝试对它进行类型转换,但它说这是冗余类型转换,因为返回类型是RemoteWebElement,它也有一个实现。这是我的代码,发生以下错误。有人可以帮帮我吗?

130    WebElement webElement = LIST_ELEMENTS_XPATH.findElement(this.elementOperator.getDriver());
131            Rectangle rectangle = webElement.getRect();
132            int listX = rectangle.getX();
133            int listY = rectangle.getY();
134            int listHeight = rectangle.getHeight();
135            int listWidth = rectangle.getWidth();

这就是错误

org.openqa.selenium.WebDriverException: Method has not yet been implemented (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 18 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: '38c9860577c9', ip: '10.55.22.63', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_131'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.amazon.dee.app, deviceScreenSize=1080x1920, networkConnectionEnabled=true, recreateChromeDriverSessions=true, noReset=true, warnings={}, databaseEnabled=false, deviceName=WUJ01NML4S, platform=LINUX, deviceUDID=WUJ01NML4S, appActivity=.Launcher, desired={appActivity=.Launcher, appPackage=com.amazon.dee.app, recreateChromeDriverSessions=true, noReset=true, newCommandTimeout=300, platformName=Android, udid=WUJ01NML4S, deviceName=Android Device}, newCommandTimeout=300, platformVersion=6.0, webStorageEnabled=false, locationContextEnabled=false, takesScreenshot=true, javascriptEnabled=true, deviceModel=F3216, platformName=Android, udid=WUJ01NML4S, deviceManufacturer=Sony}]
Session ID: 4c06d952-bc1b-4afd-9a0c-eb47098dbb4e

    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:40)
    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:33)
    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.getRect(RemoteWebElement.java:400)
    at com.amazon.alexa.comms.testsdk.mobile.alexaapp.pages.comms.conversationthread.ConversationThreadPageAndroid.scrollUp(ConversationThreadPageAndroid.java:131)

0 个答案:

没有答案