图像识别
html 名字唯一,不用加时间戳,不管你跑多少次都会覆盖原来的报告,不就是最新的了么
我居然看完了,天知道这种不分段落,一大片一大片的,年纪大了,容易老眼昏花,还不得不用鼠标标记着来看
@lcw 大神,我按照你的方式,目前遇到一个问题,从被测应用里面跳转到了 appstore 或者其他应用,它就直接失败了,没有切换回来,这是什么原因??
拉起代码如下:
func actInForeground(_ action: @escaping ActionClosure) -> ActionClosure {
return {
guard #available(iOS 9.0, *) else {
action()
return
}
let closure: ActionClosure = {
// 判断是否在前台,不在前台则拉起
if self.currentApp.state != .runningForeground {
self.currentApp.activate()
}
报错信息如下:
t = 46.13s Snapshot accessibility hierarchy for app with pid 3592
t = 46.67s Wait for com.123.mobilepamo to idle
2020-04-02 15:12:55.414837+0800 PAMonkeyUITests-Runner[3894:644425] ************************ 长按 *******************************
2020-04-02 15:12:55.414920+0800 PAMonkeyUITests-Runner[3894:644425] ************************ 处理action *******************************
t = 47.00s Tap Application 'com.123.mobilepamo'[0.00, 0.00] -> (107.7, 46.9)
t = 47.01s Wait for com.123.mobilepamo to idle
t = 47.04s Find the Application 'com.123.mobilepamo'
t = 47.04s Snapshot accessibility hierarchy for app with pid 3592
t = 48.05s Find the Application 'com.123.mobilepamo' (retry 1)
t = 48.05s Snapshot accessibility hierarchy for app with pid 3592
t = 49.06s Find the Application 'com.123.mobilepamo' (retry 2)
t = 49.06s Snapshot accessibility hierarchy for app with pid 3592
t = 49.21s Assertion Failure: MonkeyXCTest.swift:73: Error getting main window kAXErrorServerNotFound
t = 49.23s Tear Down
2020-04-02 15:12:57.643319+0800 PAMonkeyUITests-Runner[3894:644425] ************************ tearDown *******************************
还有一种报错,也拉不起来
Assertion Failure: MonkeyXCTest.swift:166: Failed: Application for Application 'com.123.mobilepamo' is not foreground and does not allow background
你这表示运行成功了呀,没看出有什么问题呀
没用的,如果是代理断开,重启 iproxy 可以,但如果不是代理断开,而是 wda 断开,即使重试,仍然连不上的,只能重新将 wda build 到手机上。
这个 WDA 断开的问题,有谁遇到么,貌似是 result 文件太大导致"Failed to spawn process for sample: 34 - Result too large"
21:10:05.243 WebDriverAgentRunner-Runner[3765:110238] <XCTWaiter: 0x281f15590, state: XCTWaiterStateSucceeded> cleaning up `Loading Accessibility`
21:10:05.246 WebDriverAgentRunner-Runner[3765:110238] Error from daemon in loading AX: Not authorized for performing UI testing actions.
21:10:05.246 WebDriverAgentRunner-Runner[3765:110238] Error capturing sample for process backboardd:
Error Domain=XCTDaemonErrorDomain Code=20 "Failed to spawn process for sample: 34 - Result too large" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 34 - Result too large}
21:10:05.247 WebDriverAgentRunner-Runner[3765:110238] Error capturing sample for process SpringBoard:
Error Domain=XCTDaemonErrorDomain Code=20 "Failed to spawn process for sample: 34 - Result too large" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 34 - Result too large}
21:10:05.250 WebDriverAgentRunner-Runner[3765:110238] Failed to load accessibility.
21:10:05.250 WebDriverAgentRunner-Runner[3765:110238] Failed to initialize for UI testing: Error Domain=XCTDaemonErrorDomain Code=41 "Not authorized for performing UI testing actions." UserInfo={samples={
SpringBoard = "Error Domain=XCTDaemonErrorDomain Code=20 \"Failed to spawn process for sample: 34 - Result too large\" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 34 - Result too large}";
backboardd = "Error Domain=XCTDaemonErrorDomain Code=20 \"Failed to spawn process for sample: 34 - Result too large\" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 34 - Result too large}";
}, NSLocalizedDescription=Not authorized for performing UI testing actions.}
21:10:05.280 xcodebuild[85261:710619] Initialization failure for UI testing: Not authorized for performing UI testing actions.
谢谢,如果是第二种,appium 他们应该会做内存释放吧,而且我有时候会看到这样的日志"xcodebuild iscarding message, buffer is full",感觉是你说的这种 ;对于 3,我做用例前置添加 killall iproxy && iproxy 8100 8100 ,每次用例开始都断掉重连,但是实际情况是用例都直接因为断开而失败了,这个地方该如何处理,搞好几天了,头都大了
非常感谢答复,我试了重试,但是因为是 xcodebuild 运行的 WDA 断开,重新运行 xcodebuild 启动 wda 服务后,就算服务起来了,用例也已经全部失败了,内存使用率这块不知道怎么控制,没有死循环,请问 wda 有提供清理内存的接口么?
找到原因了 resourceId 这个地方要用 resource-id,但是发现了一个新问题,输入框输入不全就执行了下一个步骤了。比如账号,我想输入 13188880000,但是实际执行时,只输入了 13,就不输入了,不知道这是什么原因
日志
[Maxim] // Special Event:
[Maxim] // Event1:
[Maxim] // Prob: 1.0
[Maxim] // Actvity: com.pingan.anydoor.rymlogin.ui.login.LoginActivity
[Maxim] // Step0:
[Maxim] // XPath: //*[@resource-id='com.pingan.anne.rym:id/comm_input_txt']
[Maxim] // XPathExpression: org.apache.xpath.jaxp.XPathExpressionImpl@dec9966
[Maxim] // Action: INPUTTEXT
[Maxim] // Text: 13188880000
[Maxim] // Throttle: 2000
[Maxim] // Step1:
[Maxim] // XPath: //*[@resource-id='com.pingan.anne.rym:id/comm_input_txt']
[Maxim] // XPathExpression: org.apache.xpath.jaxp.XPathExpressionImpl@f5e94a7
[Maxim] // Action: INPUTTEXT
[Maxim] // Text: qweqwe123
[Maxim] // Throttle: 1000
[Maxim] // Step2:
[Maxim] // XPath: //*[@resource-id='com.pingan.anne.rym:id/yzt_sdk_login_login_btn']
[Maxim] // XPathExpression: org.apache.xpath.jaxp.XPathExpressionImpl@cba5d54
[Maxim] // Action: CLICK
[Maxim] // Text:
[Maxim] // Throttle: 1000
------- 下面接一段-----
[Maxim] // Activity : com.pingan.anydoor.rymlogin.ui.login.LoginActivity in Intent
[Maxim] // Allowing start of Intent { cmp=com.pingan.anne.rym/com.pingan.anydoor.rymlogin.ui.login.LoginActivity } in package com.pingan.anne.rym
[Maxim] // Activity : com.pingan.anydoor.rymlogin.ui.login.LoginActivity in Intent
[Maxim] // Allowing start of Intent { cmp=com.pingan.anne.rym/com.pingan.anydoor.rymlogin.ui.login.LoginActivity } in package com.pingan.anne.rym
[Maxim] // : debug, currentActivity is com.pingan.anydoor.rymlogin.ui.login.LoginActivity
[Maxim] // Special Event : XPath = //*[@resource-id='com.pingan.anne.rym:id/comm_input_txt'], Index = 0, Action = INPUTTEXT, Text = 13188880000
[Maxim] // Find it : 1|1|4|0|1, android.widget.EditText, null, 13188880000, null, true, Rect(174, 554 - 914, 678)
[Maxim] // Special Event : XPath = //*[@resource-id='com.pingan.anne.rym:id/comm_input_txt'], Index = 1, Action = INPUTTEXT, Text = qweqwe123
[Maxim] // Find it : 3|1|4|0|1, android.widget.EditText, null, 登录密码, null, true, Rect(174, 716 - 997, 840)
[Maxim] // Special Event : XPath = //*[@resource-id='com.pingan.anne.rym:id/yzt_sdk_login_login_btn'], Index = 0, Action = CLICK, Text =
[Maxim] // Find it : 4|1|4|0|1, android.widget.TextView, null, 登录, null, true, Rect(83, 946 - 997, 1056)
[Maxim] // Click: com.pingan.anne.rym:id/rym_login_sdk_back_img, android.widget.ImageView, Rect(0, 110 - 110, 239), 8fc0405b6d8b908be727aa0e73466490
[Maxim] // event3, 2019-04-15 15:07:35.892
[Maxim] :Sending Touch (ACTION_DOWN): 0:(544.0,616.0)
[Maxim] // event4, 2019-04-15 15:07:35.894
[Maxim] :Sending Touch (ACTION_UP): 0:(544.0,616.0)
[Maxim] // event5, 2019-04-15 15:07:35.895
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event5, 2019-04-15 15:07:36.698
[Maxim] // debug, send text =13188880000
[Maxim] // event6, 2019-04-15 15:07:37.028
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event6, 2019-04-15 15:07:37.832
[Maxim] // Sleeping for 2000 milliseconds
[Maxim] // event6, 2019-04-15 15:07:39.836
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event6, 2019-04-15 15:07:40.640
[Maxim] :Sending Touch (ACTION_DOWN): 0:(585.5,778.0)
[Maxim] // event7, 2019-04-15 15:07:40.652
[Maxim] :Sending Touch (ACTION_UP): 0:(585.5,778.0)
[Maxim] // event8, 2019-04-15 15:07:40.656
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event8, 2019-04-15 15:07:41.459
[Maxim] // debug, send text =qweqwe123
[Maxim] // event9, 2019-04-15 15:07:41.791
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event9, 2019-04-15 15:07:42.594
[Maxim] // Sleeping for 1000 milliseconds
[Maxim] // event9, 2019-04-15 15:07:43.601
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event9, 2019-04-15 15:07:44.404
[Maxim] :Sending Touch (ACTION_DOWN): 0:(540.0,1001.0)
[Maxim] // event10, 2019-04-15 15:07:44.410
[Maxim] :Sending Touch (ACTION_UP): 0:(540.0,1001.0)
[Maxim] // event11, 2019-04-15 15:07:44.413
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event11, 2019-04-15 15:07:45.216
[Maxim] // Sleeping for 1000 milliseconds
[Maxim] // event11, 2019-04-15 15:07:46.222
[Maxim] // Sleeping for 800 milliseconds
[Maxim] // event11, 2019-04-15 15:07:47.025
[Maxim] :Sending Touch (ACTION_DOWN): 0:(55.0,174.5)
[Maxim] // event12, 2019-04-15 15:07:47.031
[Maxim] :Sending Touch (ACTION_UP): 0:(55.0,174.5)
[Maxim] // event13, 2019-04-15 15:07:47.036
[Maxim] // Sleeping for 800 milliseconds