首页 文章

“按钮点击”在Appium Android测试中给出“处理命令时出现未知的服务器端错误 . ”

提问于
浏览
0

我第一次使用 appium 为Android应用程序运行SELENIUM JAVA测试 . (WIndows 8.1)我从Appium检查员那里复制了按钮的id . 我想点击按钮 .

isDisplayed 返回true或者 gettext() 很好但是按钮上的 loginBtn.tap(1, 1); 会出现以下错误

On eclipse console

org.openqa.selenium.WebDriverException:处理命令时发生未知的服务器端错误 .

on Appium console

info:[debug]将命令推送到appium工作队列:[“element:getSize”,{“elementId”:“2”}] info:[debug] [BOOTSTRAP] [debug]从客户端获取数据:{“cmd” :“action”,“action”:“element:getSize”,“params”:{“elementId”:“2”}} info:[debug] [BOOTSTRAP] [debug]得到类型ACTION信息的命令:[debug] [BOOTSTRAP] [debug]得到命令动作:getSize信息:[debug] [BOOTSTRAP] [debug]返回结果:{“status”:0,“value”:{“width”:540,“height”:168}} info:[debug]将命令推送到appium工作队列:[“element:touchDown”,{“elementId”:“2”,“x”:270,“y”:1836}] info:[debug] [BOOTSTRAP] [调试]从客户端获取数据:{“cmd”:“action”,“action”:“element:touchDown”,“params”:{“elementId”:“2”,“x”:270,“y”:1836 } [info] [BOOTSTRAP] [debug]获得类型ACTION信息的命令:[debug] [BOOTSTRAP] [debug]得到命令动作:touchDown信息:[debug] [BOOTSTRAP] [debug]使用元素执行TouchDown? true x:270,y:1836 info:[debug] [BOOTSTRAP] [错误]在对象com.android.uiautomator.core上调用方法private boolean com.android.uiautomator.core.InteractionController.touchDown(int,int)时出错.InteractionController @ 4c33b with parameters [270,1836] null info:[debug] [BOOTSTRAP] [debug]调用touchDown的问题:java.lang.RuntimeException:调用方法时出错private boolean com.android.uiautomator.core.InteractionController.touchDown对象com.android.uiautomator.core.InteractionController@4c33b上的(int,int)参数[270,1836] info:[debug]响应客户端错误:{“status”:13,“value”:{“message “:”处理命令时发生未知的服务器端错误 . “,”origValue“:”无法执行触摸事件“},”sessionId“:”797740b8-3fb1-45ae-b31e-1db9aa3e4513“}信息:< - - POST / wd / hub / session / 797740b8-3fb1-45ae-b31e-1db9aa3e4513 / touch / perform 500 256.730 ms - 198 info:[debug] [BOOTSTRAP] [debug]返回结果:{“status”:13,“value “:“失败执行触摸事件“}信息: - > DELETE / wd / hub / session / 797740b8-3fb1-45ae-b31e-1db9aa3e4513 {} info:关闭appium会话

1 回答

  • 0

    我解决了:

    MobileElement loginBtn=androidDriver.findElementById("com.spotyo.music:id/button_login");
    if (loginBtn.isDisplayed()){
        androidDriver.tap(1, loginBtn, 1);      
    }
    

相关问题