点击也不会与appium测试工作在流逝,但不执行任何操作 [英] Click is not working with appium test is passing but no action is performed
问题描述
我要点击注销按钮。我曾尝试下面的东西来进行点击操作。
使用轻触
WebElement注销= driver.findElementByName(退出);
TouchAction行为=新TouchAction(驱动器);
act.tap(注销,1,1);
简单点击
WebElement注销= driver.findElementByName(退出);
logOut.click();
preSS
TouchAction行为=新TouchAction(驱动器);
行为。preSS(注销).perform()
有关preSS其捐赠
在处理命令时,未知的服务器端错误。
也试过
MobileElement注销=(MobileElement)driver.findElementByName(退出);
logout.tap(1,10);
其中给出相同的,未知的服务器端错误
让我知道如果我做错了任何地方。
先谢谢了。
下面是服务器日志
>信息:[调试] [引导] [调试]查找注销使用名称与关联标识符:多:假的
>信息:[调试] [引导] [调试]使用:UiSelector [DESCRIPTION =注销,INSTANCE = 0]
>信息:[调试] [引导] [调试]返回结果:{身份:0,价值:{元素:2}}
>信息:[调试]响应成功客户端:{身份:0,价值:{元素:2}的sessionId:ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc}
>信息:LT; - POST / WD /集线器/会话/ ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc /元件200 44.615毫秒 - 87 {身份:0,价值:{元素:2} 的sessionId:ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc}
>信息: - > POST / WD /集线器/会话/ ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc /触摸/执行{\"actions\":[{\"action\":\"$p$pss\",\"options\":{\"element\":\"2\"}},{\"action\":\"wait\",\"options\":{\"ms\":250}},{\"action\":\"release\",\"options\":{}}]}
>信息:[调试]推命令appium工作队列:元素:的getLocation,{elementId:2}]
>信息:[调试]推命令appium工作队列:元素:的getSize,{elementId:2}]
>信息:[调试] [引导] [调试]得到客户数据:{CMD:行动,行动:元素:的getLocation,PARAMS:{elementId:2}}
>信息:[调试] [引导] [调试]知道类型的动作命令
>信息:[调试] [引导] [调试]得到命令操作:的getLocation
>信息:[调试] [引导] [调试]返回结果:{身份:0,价值:{X: - 256,Y:932}}
>信息:[调试] [引导] [调试]得到客户数据:{CMD:行动,行动:元素:的getSize,PARAMS:{elementId:2}}
>信息:[调试] [引导] [调试]知道类型的动作命令
>信息:[调试] [引导] [调试]得到命令操作:的getSize
>信息:[调试] [引导] [调试]返回结果:{身份:0,价值:{宽:240,身高:81}}
>信息:[调试]推命令appium工作队列:元素:的getLocation,{elementId:2}]
>信息:[调试] [引导] [调试]得到客户数据:{CMD:行动,行动:元素:的getLocation,PARAMS:{elementId:2}}
>信息:[调试] [引导] [调试]知道类型的动作命令
>信息:[调试] [引导] [调试]得到命令操作:的getLocation
>信息:[调试] [引导] [调试]返回结果:{身份:0,价值:{X: - 256,Y:932}}
>信息:[调试]推命令appium工作队列:元素:的getSize,{elementId:2}]
>信息:[调试] [引导] [调试]得到客户数据:{CMD:行动,行动:元素:的getSize,PARAMS:{elementId:2}}
>信息:[调试] [引导] [调试]知道类型的动作命令
>信息:[调试] [引导] [调试]得到命令操作:的getSize
>信息:[调试] [引导] [调试]返回结果:{身份:0,价值:{宽:240,身高:81}}
>信息:[调试]推命令appium工作队列:元素:达阵,{elementId:2,X: - 136,Y:972.5}]
>信息:[调试] [引导] [调试]得到客户数据:{CMD:行动,行动:元素:达阵,PARAMS:{elementId:2,X :-136,Y:972.5}}
>信息:[调试] [引导] [调试]知道类型的动作命令
>信息:[调试] [引导] [调试]得到命令操作:达阵
>信息:[调试] [引导] [调试]执行TouchDown的使用元素?真正的X:-136,Y:972
>信息:[调试] [引导] [调试]返回结果:{身份:13,值:无法执行触摸事件}
>信息:[调试]响应客户端的错误:{身份:13,价值:{消息:在处理命令时,未知的服务器端错误。,origValue:无法执行触摸事件},的sessionId:ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc}
>信息:LT; - POST / WD /集线器/会话/ ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc /触摸/ 500执行MS 211.167 - 198
>信息:[调试]在60秒没有接到新的命令,关闭...
>信息:关闭appium会议
>信息:[调试] pressing HOME按钮
>信息:[调试]执行CMD:C:\\用户\\裂变\\应用程序数据\\本地\\ Android的\\ Android的SDK \\平台工具\\ adb.exe -s f547bbb6壳输入的KeyEvent 3
>信息:[调试]停止捕获logcat中
>信息:[调试] logcat的终止,code空,信号SIGTERM
>信息:[调试] [引导] [调试]得到客户数据:{CMD:关机}
>信息:[调试] [引导] [调试] GOT型号关机命令
>信息:[调试] [引导] [调试]返回结果:{身份:0,值:OK,关停}
>信息:[调试] [引导] [调试]关闭客户端连接
>信息:[调试]发送shutdown命令,等待UiAutomator停止...
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:numtests = 1
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:流=。
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:ID = UiAutomatorTestRunner
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:测试= testRunServer
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:类= io.appium.android.bootstrap.Bootstrap
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:电流= 1
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_ code:0
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:流=
>信息:[调试] [UIAUTOMATOR STDOUT]为WatcherResultPrinter =测试结果。
>信息:[调试] [UIAUTOMATOR STDOUT]时间:82.744
>信息:[调试] [UIAUTOMATOR STDOUT] OK(1试验)
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_ code:-1
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT:shortMsg = java.lang.SecurityException异常
>信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT:longMsg =拒绝权限:getIntentSender()由PID = 21860,UID = 2000,(需要UID = 1000)是不允许发送的包的android
如果您的单击事件不会再工作可能是你的开发人员必须使用了一些API例如 patlab 而不是单击事件..
您应该咨询您的开发者,他/她是否使用API像patlab与否
如果这样的话让开发者的事件名称,你可以触发使用jQuery
I want to click on logout button. I have tried following things to perform a click action
Using Tap
WebElement logOut = driver.findElementByName("Log out");
TouchAction act = new TouchAction(driver);
act.tap(logOut, 1, 1);
Simple click
WebElement logOut = driver.findElementByName("Log out");
logOut.click();
Press
TouchAction act = new TouchAction(driver);
act.press(logOut).perform()
;
For Press its giving
An unknown server-side error occurred while processing the command.
Also tried
MobileElement logout = (MobileElement) driver.findElementByName("Log out");
logout.tap(1, 10);
Which gives same unknown server-side error
Let me know if I am doing wrong anywhere.
Thanks in advance.
Here is server log
> info: [debug] [BOOTSTRAP] [debug] Finding Log out using NAME with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[DESCRIPTION=Log out, INSTANCE=0]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"ELEMENT":"2"}}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"2"},"sessionId":"ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc"}
> info: <-- POST /wd/hub/session/ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc/element 200 44.615 ms - 87 {"status":0,"value":{"ELEMENT":"2"},"sessionId":"ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc"}
> info: --> POST /wd/hub/session/ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc/touch/perform {"actions":[{"action":"press","options":{"element":"2"}},{"action":"wait","options":{"ms":250}},{"action":"release","options":{}}]}
> info: [debug] Pushing command to appium work queue: ["element:getLocation",{"elementId":"2"}]
> info: [debug] Pushing command to appium work queue: ["element:getSize",{"elementId":"2"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getLocation","params":{"elementId":"2"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getLocation
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"x":-256,"y":932}}
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getSize","params":{"elementId":"2"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getSize
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"width":240,"height":81}}
> info: [debug] Pushing command to appium work queue: ["element:getLocation",{"elementId":"2"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getLocation","params":{"elementId":"2"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getLocation
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"x":-256,"y":932}}
> info: [debug] Pushing command to appium work queue: ["element:getSize",{"elementId":"2"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getSize","params":{"elementId":"2"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getSize
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"width":240,"height":81}}
> info: [debug] Pushing command to appium work queue: ["element:touchDown",{"elementId":"2","x":-136,"y":972.5}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:touchDown","params":{"elementId":"2","x":-136,"y":972.5}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: touchDown
> info: [debug] [BOOTSTRAP] [debug] Performing TouchDown using element? true x: -136, y: 972
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":13,"value":"Failed to execute touch event"}
> info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Failed to execute touch event"},"sessionId":"ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc"}
> info: <-- POST /wd/hub/session/ad4afb54-6f6d-4a39-bb60-49e4cbbcc4bc/touch/perform 500 211.167 ms - 198
> info: [debug] Didn't get a new command in 60 secs, shutting down...
> info: Shutting down appium session
> info: [debug] Pressing the HOME button
> info: [debug] executing cmd: C:\Users\fission\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s f547bbb6 shell "input keyevent 3"
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 82.744
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.SecurityException
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: longMsg=Permission Denial: getIntentSender() from pid=21860, uid=2000, (need uid=1000) is not allowed to send as package android
If your click event is not working then probably your developer must have used some api like patlab instead of click event..
You should consult your developer whether he/she have used api like patlab or not
if so then ask your developer for the event name and you can trigger using jquery
这篇关于点击也不会与appium测试工作在流逝,但不执行任何操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!