Appium Appium 1.4.16.1 和 java-client 4.0.0,使用过程中 swipe 报错

William · 2016年11月11日 · 最后由 William 回复于 2016年11月16日 · 1289 次阅读

Swipe 报错:org.openqa.selenium.WebDriverException: Not yet implemented.

java 代码如下:

        driver.findElement(By.className("head")).click();
//        int x = driver.manage().window().getSize().width;
//        int y = driver.manage().window().getSize().height;
        //滑动4/5
        driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
//        driver.swipe(x/2,y,x/2,y/5,3000);
        Set<String> context = driver.getContextHandles();
        for(String str : context){
            System.out.println(str);
            if (context.contains("WEBVIEW_1")){
                driver.context("WEBVIEW_1");
                System.out.println("切换到webview模式");
            }
        }
        driver.swipe(360,1000,360,200,1000);

        driver.findElement(By.id("logout")).click();

报错如下:

> info: [debug] Responding to client that a method is not implemented
> info: <-- POST /wd/hub/session/99806bc8b7ee363a93d75bf4ee7e8f7e/touch/perform 501 2.864 ms - 154 
> info: --> DELETE /wd/hub/session/99806bc8b7ee363a93d75bf4ee7e8f7e {}
> info: Shutting down appium session
> info: Chromedriver: Changed state to 'stopping'
> info: JSONWP Proxy: Proxying [DELETE /] to [DELETE http://127.0.0.1:9515/wd/hub/session/99806bc8b7ee363a93d75bf4ee7e8f7e] with no body
> info: JSONWP Proxy: Got response with status 200: "{\"sessionId\":\"99806bc8b7ee363a93d75bf4ee7e8f7e\",\"status\":0,\"value\":null}"
> info: Chromedriver: Changed state to 'stopped'
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}

有出现这个问题的伙伴吗?

共收到 6 条回复 时间 点赞

升级下呗. 上面说是没实现. 是不是太老了

#1 楼 @seveniruby 1.4.16.1 不是很老吧

#2 楼 @leizi0715 现在都是 1.6.0 了. 1.4.16 的时候, swipe 是可以的. 你可以看看是不是你的 java-client 版本的问题. 看看 appium 的 log 是什么

#3 楼 @seveniruby 我之前用这个版本的时候没事,换了个电脑就挂了,appium 的 log 也是 not implemented,java-client 中有 swipe。我升级一下试试

#4 楼 @leizi0715 不一定是 swipe 吧. 你看看他提示的未应用的到底是哪个 api 吧

#5 楼 @seveniruby 获取宽度和高度那个不注释掉的话,还会提示不支持,这个 appium 是我从社区百度云下的。

William 关闭了讨论 11月16日 13:27
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册