Prepare iOS test automation

To perform iOS test automation with the Mobile Engine 3.0, you have to first prepare the device or simulator, the Mac, and the mobile application.

Follow the instructions in this chapter to:

To ensure that the server doesn't time out during iOS test automation, increase the server response time-out. To do so, follow the steps below:

  1. Navigate to Project->Settings->TBox->Engines->Remote server response timeout.

  2. Increase the Value from the default 120000 to recommended 1200000 by adding an additional 0.

Prepare iOS devices or simulators for test automation

Follow the instructions below to:

The specific location of settings and options may vary depending on your device.

Prepare iOS devices for test automation

To prepare an iOS device for test automation, follow these steps:

  1. Connect an iOS device to your PC via USB.

  2. Accept the connection on your mobile device and on your PC.

  3. On the iOS device, go to Settings and perform these steps:

    • Navigate to Developer Settings and enable the Enable UI Automation option.

    • Navigate to Safari >Advanced and enable the Web Inspector option.

  1. Open Tosca Commander and prepare your TestCases:

  2. Run your TestCases.

Prepare iOS simulators for test automation

To prepare an iOS simulator for test automation, follow these steps:

  1. Install and set up a valid iOS simulator on the computer where you have Tricentis Mobile Agent installed.

  1. Open Tosca Commander and prepare your TestCases:

  2. Run your TestCases.

Prepare iOS hybrid applications for test automation

To prepare an iOS hybrid application for test automation, you have to:

Configure WebView

To ensure that all clicks within the WebView work correctly, your WebView needs to be in full screen mode.

If you use iOS version 11.0 or later to build your application, you have to define the correct target and architecture.

To do so, follow the steps below:

  1. Open Xcode and click on your project.

  2. Click on the target that you want to modify.

  3. Select your iOS version from the Deployment Target drop-down menu.

Define Deployment Target

  1. Switch to the Build Settings tab.

  2. Select arm64 from the Valid Architectures drop-down menu.

Select architecture

Set the Accessibility properties in Xcode

To improve the performance of your iOS test automation, set their Accessibility properties in Xcode. For detailed information, see the official Apple Developer documentation.

To set the Accessibility properties in Xcode, follow the steps below:

  1. Open Xcode.

  2. Set the Accessibility property of the parent container to Disabled.

  3. Set the Accessibility properties of the controls to Enabled.

Accessibility set to Enabled

Set the accessibilityLabel for ButtonSelector and ListView

To steer the ButtonSelector and ListView controls as xOS Modules, you have to modify their accessibilityLabel property:

  • For ButtonSelector, change the accessibilityLabel under the UISegmentedControl in the code of the iOS application. The value of this property has to match this control's ID in an Android application.

  • For ListView, change the accessibilityLabel under the UITableView in the code of the iOS application. The value of this property has to match this control's ID in an Android application.

Prepare iOS native applications for test automation

To scan and steer native iOS controls, you have to modify the Accessibility properties of the controls. For detailed information, see the following chapters:

Prepare iOS mobile web applications for test automation

To scan and steer HTML controls in mobile web applications on iOS 12, the app developer must fill in the <title> tag of the mobile web page.

Recommendations for Xamarin applications

With the Mobile Engine 3.0, you can steer applications created with the Xamarin framework. You can use all standard mobile web controls and native controls. This chapter provides information on optimizing Xamarin applications for testing with the Mobile Engine 3.0.

ID Handling of controls

To improve the preciseness of testing, consider the following:

  • On Xamarin Forms: ensure to fill the optional AutomationId parameter. Mobile Engine 3.0 recognizes this parameter as Content Description during scanning, and can use it as the unique ID required for steering the control.

  • On Xamarin Android: ensure to set the ContentDescription parameter. Mobile Engine 3.0 recognizes this parameter as Content Description during scanning, and can use it as the unique ID for steering the control.