我正在尝试使用 Quamotion 的 xcuitrunner 在 Windows PC 上启动 Xcode UI 测试(在本例中为 Facebook/Appium WebDriverAgent)。
我使用的是 0.114.18 版本,它是从http://docs.quamotion.mobi/quamotion4appium/xcuitrunner/。
但是,当我在命令行上启动 xcuitrunner 时,我得到以下输出:
Quamotion Xcode UI Test Runner version 0.114.18+34d082af40
Machine ID: XXXXXXXX
Specify --help for a list of available options and commands.
这是预期的结果吗?下一步是什么?我想连接到 WebDriverAgent 并获取设备上应用程序的 UI 控件的属性?
答案1
您可以使用以下语法启动 xcuitrunner:
xcuitrunner.exe run -d [path to your developer profile] -p [password for your developer profile] -k [path to the directory containing the developer disk images]
您需要将方括号之间的值替换为您电脑的实际值。
当 xcuitrunner 启动时,您应该会看到如下输出:
Quamotion Xcode UI Test Runner version 0.114.18+34d082af40
Machine ID: XXXXXXXX
Using a license for which expires on 1/1/2020 1:00:00 AM
The Xcode UI Test will be resigned:
- Developer Certificate: [Your Certificate]
- Provisioning Profile: [Your Provisioning Profile]
Starting the Xcode UI Test
2019-05-07 11:42:51.046729+0200 WebDriverAgentRunner-Runner[513:143347] Running tests...
objc[513]: Class GCDAsyncSocketPreBuffer is implemented in both /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x10559c578) and /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x105509358). One of the two will be used. Which one is undefined.
objc[513]: Class GCDAsyncReadPacket is implemented in both /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x10559c5c8) and /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1055093a8). One of the two will be used. Which one is undefined.
objc[513]: Class GCDAsyncWritePacket is implemented in both /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x10559c618) and /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1055093f8). One of the two will be used. Which one is undefined.
objc[513]: Class GCDAsyncSpecialPacket is implemented in both /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x10559c668) and /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x105509448). One of the two will be used. Which one is undefined.
objc[513]: Class GCDAsyncSocket is implemented in both /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x10559c6b8) and /private/var/containers/Bundle/Application/FD8EAB15-BD59-40FE-941C-756506186612/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x105509498). One of the two will be used. Which one is undefined.
Test Suite 'All tests' started at 2019-05-07 11:42:53.213
XCTestOutputBarrier
Test Suite 'WebDriverAgentRunner.xctest' started at 2019-05-07 11:42:53.233
XCTestOutputBarrier
Test Suite 'UITestingUITests' started at 2019-05-07 11:42:53.249
XCTestOutputBarrier
Test Case '-[UITestingUITests testRunner]' started.
XCTestOutputBarrier
t = 0.01s Start Test at 2019-05-07 11:42:53.275
t = 0.04s Set Up
2019-05-07 11:42:53.368596+0200 WebDriverAgentRunner-Runner[513:143347] Built at Mar 8 2019 13:46:49
2019-05-07 11:42:53.578806+0200 WebDriverAgentRunner-Runner[513:143347] ServerURLHere->http://10.9.8.50:8100<-ServerURLHere
2019-05-07 11:42:53.585966+0200 WebDriverAgentRunner-Runner[513:143397] Using singleton test manager
- done. Took 17s
The WebDriverAgent session is ready at http://localhost:50140/session/A5EF3EEC-3B2F-4959-82B1-390077C1356C
Hit CRTL-C to stop the Xcode UI Test
输出中的 URL 是服务器运行的端点。每次启动 xcuitrunner 时,此 URL 都会不同。
此服务器是 Selenium/WebDriver/Appium 服务器。您可以通过 HTTP 直接连接到此服务器。例如,您可以访问http://本地主机:50140/session/A5EF3EEC-3B2F-4959-82B1-390077C1356C/source(确保用您这边的实际值替换第一部分)以获取当前在设备上显示的屏幕的 DOM。
还有一些关于如何从命令行与该服务器交互的示例:https://github.com/facebook/WebDriverAgent/wiki/Queries
您还可以使用您选择的编程语言中的 Appium 或 WebDriver 客户端库,并请求它通过此 URL 连接到 Appium 服务器。具体操作取决于您使用的编程语言。