I am attempting to start a Facebook/Appium WebDriverAgent Xcode UI Test using Quamotion’s xcuitrunner on a computer running Windows. I have downloaded version 0.114.18 of xcuitrunner from http://docs.quamotion.mobi/quamotion4appium/xcuitrunner/. Nonetheless, upon executing the xcuitrunner command, the following information is displayed:
Quamotion Xcode UI Test Runner version 0.114.18+34d082af40
Machine ID: XXXXXXXX
Specify --help for a list of available options and commands.
Is everything going according to plan? What is the next step?
I am interested in establishing a connection with the WebDriverAgent and retrieving information about the user interface
2 Answers
Introduction
In the world of software development, testing is a crucial aspect of the development process. It ensures that the software is functioning correctly and meets the requirements of the clients. Xcode UI testing is one of the most common ways to test iOS applications. However, Xcode UI testing is only available on macOS, which can be a problem for those who prefer to use Windows PCs. In this blog post, we will discuss how to launch an Xcode UI test on a Windows PC using Quamotion’s xcuitrunner.
What is Quamotion’s xcuitrunner?
Quamotion’s xcuitrunner is a software tool that allows you to run Xcode UI tests on iOS devices using a Windows PC. It is designed to work seamlessly with Appium and provides a straightforward way to run Xcode UI tests on iOS devices. The xcuitrunner tool connects to the WebDriverAgent running on the iOS device and allows you to interact with the UI controls on the app.
Getting Started with Quamotion’s xcuitrunner
To get started with Quamotion’s xcuitrunner, you need to download the latest version from the Quamotion website. Once you have downloaded the xcuitrunner, you can install it on your Windows PC. After installation, you can launch the xcuitrunner on the command line by running the following command:
xcuitrunner
If the xcuitrunner is installed correctly, you should see the following output on the command line:
Quamotion Xcode UI Test Runner version 0.114.18+34d082af40
Machine ID: XXXXXXXX
Specify --help for a list of available options and commands.
Connecting to the WebDriverAgent
To connect to the WebDriverAgent on the iOS device, you need to specify the device ID and the IP address of the iOS device. You can find the device ID by running the following command:
xcuitrunner devices
This command will list all the iOS devices connected to your Windows PC. Once you have identified the device ID, you can connect to the WebDriverAgent on the device by running the following command:
xcuitrunner connect <device ID> --ip <iOS device IP address>
If the connection is successful, you should see the following output on the command line:
Connected to device <device ID> at <iOS device IP address>
Getting Properties of UI Controls
Once you have connected to the WebDriverAgent, you can get the properties of the UI controls on the app. To do this, you need to specify the bundle ID of the app and the type of UI control you want to inspect. You can get the bundle ID of the app by running the following command:
xcuitrunner apps
This command will list all the apps installed on the iOS device. Once you have identified the bundle ID of the app, you can get the properties of a UI control by running the following command:
xcuitrunner get <bundle ID> <UI control type>
This command will return the properties of the UI control in JSON format. You can use this information to verify that the UI control is functioning correctly and meets the requirements of the client.
Conclusion
In conclusion, Quamotion’s xcuitrunner is a powerful tool that allows you to run Xcode UI tests on iOS devices using a Windows PC. It provides a straightforward way to connect to the WebDriverAgent on the iOS device and get the properties of the UI controls on the app. With xcuitrunner, developers can easily test their iOS applications on Windows PCs and ensure that their software is functioning correctly.
To initiate xcuitrunner, use the subsequent syntax:
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]
You have to substitute the values in the square brackets with the specific values for your computer. Once the xcuitrunner begins, you should observe results similar to the following:
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
The URL listed in the results is the location at which the server is currently operating. This URL will change every time you start the xcuitrunner. The server functions as a Selenium/WebDriver/Appium server, and you may establish a direct HTTP connection with it. For instance, you could visit http://localhost:50140/session/A5EF3EEC-3B2F-4959-82B1-390077C1356C/source (ensuring you substitute the first part with the actual values on your device) to obtain the Document Object Model (DOM) of the currently visible screen on the device.
There are also illustrations of how you can communicate with this server through the command line available at https://github.com/facebook/WebDriverAgent/wiki/Queries. Furthermore, you may use an Appium or WebDriver client library in the programming language of your choice to request a connection to the Appium server at this URL. The process of achieving this is dependent on the programming language you are employing.