这是正常现象,因为每次起应用的时候会先启动 WDA
给你推荐一篇精华帖:https://testerhome.com/topics/6962,
还有一篇http://www.7forz.com/2973/
我就是看这两篇搭起来的
我想请教一下,如何获得页面上任一元素的坐标?
命令行手动启动 WDA 也是出现打开 - 黑屏 - 闪退,请问这是正常的吗?
qzstechs-Mac-mini:WebDriverAgent huna$ xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/_appium-xcuitest-driver@2.5.3@appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=4b75ddb6048501ceb2ec507d0166826590f216c2 -configuration Debug
=== BUILD TARGET WebDriverAgentLib OF PROJECT WebDriverAgent WITH CONFIGURATION Debug ===
.....
2017-07-03 09:32:03.488960+0800 XCTRunner[238:8827] Running tests...
2017-07-03 09:32:05.416988+0800 XCTRunner[238:8827] Continuing to run tests in the background with task ID 1
Test Suite 'All tests' started at 2017-07-03 09:32:05.556
Test Suite 'WebDriverAgentRunner.xctest' started at 2017-07-03 09:32:05.557
Test Suite 'UITestingUITests' started at 2017-07-03 09:32:05.558
Test Case '-[UITestingUITests testRunner]' started.
t = 0.00s Start Test at 2017-07-03 09:32:05.561
t = 0.01s Set Up
2017-07-03 09:32:05.578168+0800 XCTRunner[238:8869] [User Defaults] Failed to write value for key AutomationDisableFauxCollectionCells in CFPrefsPlistSource<0x17010d5c0> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only
2017-07-03 09:32:05.580784+0800 XCTRunner[238:8827] Built at Jul 1 2017 10:22:07
2017-07-03 09:32:05.622466+0800 XCTRunner[238:8827] ServerURLHere->http://192.168.3.143:8100<-ServerURLHere
嗯嗯,谢谢提醒,下次一定注意
谢谢提醒,下次会注意的~如何确认 WDA 是否正常启动?我发现每次脚本跑起来 WDAinstall 后会打开然后出现黑屏接着就闪退了?
附上 desired_cap
def get_desired_capabilities():
desired_caps = {
'platformName': 'iOS',
'platformVersion': '10.3.1',
'deviceName': 'iphone 6',
'udid':'6e1ea64b3214d4627f619a2c5399cae214c80cb6',
'app': '/Users/huna/Desktop/iosautotest/version/QYMapAPP.app',
'automationName': 'XCUITest',
'bundleId':'com.xxxx.WebDriverAgentLib',
'newCommandTimeout':3600,
'noReset':True
}
return desired_caps
def get_uri():
return "http://127.0.0.1:4723/wd/hub"
在 stackoverflow 上看到可能是由于 xcode 版本(8.0)不对,升级了 xcode 版本(8.3),ok 了。