Skip to content
You're viewing the v2 docs. Looking for v1?Go to v1 docs
Docs
Testsigma
Popular questions
↑↓ to navigate↵ to selectesc to close
Book a demo

Create a Unified mobile test case

A Unified application holds one test case that runs on both Android and iOS, instead of 2 sets of test cases covering the same scenarios. You author the steps once, on either platform, and the platform-aware engine resolves the right locator for each device at execution time.

Before you start, you need a Unified project and application, the application file, and a device available as a Test Machine. Android takes an .apk or .aab; iOS takes an .ipa or .app. A local device also needs Testsigma Terminal installed.

  1. Go to Create Tests > Test Cases.

  2. Expand a folder in Test Case Explorer and click the + icon next to a subfolder.

  3. Confirm the folder and subfolder, enter a name, and click Create.

The first step is created for you as Launch App.

  1. Click Record on the Test Case Details page.
  2. In the Record test steps overlay, select a Test Lab and a Test Machine.
  3. Supply the application under App Source, either by pasting an external public link or by clicking Upload and browsing to the file.
  4. Click Record and wait for the application to load fully.
  5. Perform the actions you want as test steps. The recorder converts each interaction into a step.
  6. Click Stop, then Stop again in the Stop Recorder dialog.

An .ipa upload carries 2 options an .apk does not. Enable iOS Keychain Support clears Keychain data after each session, so credentials stored by a previous session cannot fail the next. Skip App Re-signing installs the build without re-signing it, for an app already signed under the Apple Developer Enterprise Program and for features that need the original signature, such as push notifications.

An element in a Unified application holds locator details for Android, iOS, or both, under one name. A step referencing that element uses the Android locator on Android and the iOS locator on iOS, so one element library serves both platforms.

The same 5 locator types apply, and you can choose a different one per platform on the same element:

  • Accessibility ID: the most reliable across platforms, since the value tends to stay the same on Android and iOS
  • ID: the second most reliable. Every element typically has a unique one
  • XPath: parses the source to locate the element by its path
  • Class Name: the value of the element’s Class Name attribute
  • Name: the value of the element’s Name attribute
  1. Go to Create Tests > Elements and click Create Element.

  2. Enter a Name and a Screen Name.

  3. Select the Android tab, choose an Element Type, and enter the locator in Enter Value.

  4. Select the iOS tab and do the same for iOS.

  5. Leave Auto heal element during execution selected to let Testsigma recover this element’s locator when it changes, or clear it to opt out.

  6. Click Create element.

To change one later, hover over it on the Elements page, click the ellipsis icon ⋮, select Edit, and update the Name, Screen Name, or either platform’s type and value. Click Update.

Recording captures one platform at a time, and needs the Testsigma Recorder extension installed. See Recorder extension.

  1. Go to Create Tests > Elements and click Record.

  2. In the Record Elements overlay, select the Test Machine for the platform you are recording, along with the Test Lab and Upload App Source.

  3. Click Record and wait for the app to load fully.

  4. Click the element you want to capture.

  5. Confirm the Name, Screen Name, Element Type, and Value in the Create Element panel.

  6. Click Create. The element saves to the elements list and appears in the Create Element panel.

  7. Repeat steps 4 to 6 for every element you want from this application, then click Stop Recording. You are returned to the Elements page with everything you captured.

To add the second platform’s locator to an element you already captured, open it on the Elements page, click Edit, select the tab for the platform you have not captured, click Record, and capture it there. That adds to the existing element rather than creating a duplicate.

Run the same test case on an Android device and on an iOS device from the Ad-Hoc Run panel.

Locators recorded on one platform will not always match the other. Where they do not, auto-healing corrects them at run time rather than failing the step.

Take a login test case authored in a Unified project by recording on an iOS device:

Launch App
Tap on Log In
Tap on Email Address or Username
Enter brandon@bryant.com in the Email Address or Username field
Enter the password in the Password field
Tap on Forgot Password
Enter brandon@bryant.com in the Email Address or Username field
Tap on Reset Password

It runs on iOS with the recorded locators. On Android, those locators do not match the UI. With auto-healing enabled, Testsigma detects each failed locator during execution and replaces it with a new XPath, using the element context from both platforms, so the test lab finds the element and the step continues.

A summary banner at the end of the run reports how many steps were healed, and the run completes as Passed.

To see what changed, open the step in the run result. Autoheal Details shows the updated locator and Affected Test cases shows what else uses it, and you can mark whether the result was helpful. See Elements for auto-healing.

Can I test both Android and iOS with a single test case?

Section titled “Can I test both Android and iOS with a single test case?”

Yes. Create a Unified application and author one test case. Testsigma runs it on both platforms.

Which execution engine does Unified Mobile use?

Section titled “Which execution engine does Unified Mobile use?”

The Modern engine only. It is not available on Classic.

Do I record the test case twice, once per platform?

Section titled “Do I record the test case twice, once per platform?”

No. Record on one platform, and the same test case runs on both. Elements are the exception: recording an element captures one platform’s locator, and you add the second platform’s locator to the same element afterwards.

How does Testsigma handle elements that differ between Android and iOS?

Section titled “How does Testsigma handle elements that differ between Android and iOS?”

Each element stores a separate Android and iOS locator, and Testsigma uses the one matching the device under test. Where a locator differs at run time, auto-healing corrects it.

What happens to a step that only applies to one platform?

Section titled “What happens to a step that only applies to one platform?”

It is skipped on the other platform, and the run reports the reason.

Can I convert an existing Android or iOS application to Unified?

Section titled “Can I convert an existing Android or iOS application to Unified?”

No. The application type and engine are set when you create the application and cannot be changed. Create a new Unified application instead.

Was this page helpful?