How to automate tests for iOS Apps using local devices


You will need three things to get started:

  • A Testsigma account

    • If you are using testsigma cloud you sign up to new account with the link
    • If you re using testsigma community edition then from settings page you can sign up for Testsigma Lab
  • You must have an active Apple Developer Account (different from the Apple ID). You are an active team member in the Apple Developers Portal.
  • Testsigma Agent is set up

To enable developer options and get started in iOS, there are 3 additional steps you need to perform via the Apple Developer Portal.


A. Apple Developer Portal

  1. Create a Certificate Signing Request on Testsigma

Next you will need to create a Certificate Signing Request (CSR).

In order to sign the driver with your certificate, you need to create a Certificate Signing Request.

To create the CSR file, login to your Testsigma account. Navigate to:

Settings > iOS Settings > Enter a Profile name

Click on Download to download the Certificate Signing Request (CSR).

Download the Certificate Signing Request from Testsigma

Your CSR file will now be generated.

  1. Download Certificate on the Apple Developer Portal

In the Apple Developer Portal, click on Certificates, Identifiers & Profiles option.

Click Certificates+ to create a new Certificate.

download-certificate-on-apple-developer-portal

Choose iOS App Development and click Continue.

certificates-identifiers-profiles

Here, you need to upload the CSR file you downloaded (explained on Step 1) from your Testsigma account.

create a new certificate for ios app development

Once the upload is completed, click on Continue to download the certificate

create-new-certificate

Your certificate will now be downloaded.

download-certificate

Now you have to upload this certificate generated by Apple on Testsigma.

Click on Download.

Once this certificate file is downloaded from the Apple Developer Portal, head back to Testsigma iOS settings page, and click the “Upload” option next to the “Certificate” section and add it here.

  1. Create your Mobile Provisioning Profile

Here’s the last step. Upload the provisioning profile. This profile is used by Apple to list the eligible devices where the driver can be installed.

To do this, go to Profiles in your Apple Developer account.

You will find it here.

Create profile in Apple developer portal

Click on Profiles, click on the Profiles+ icon.

Choose iOS App Development and click on Continue.

register-new-provisioning-profile

Now you will need to choose the App ID and click Continue.

Select a Wildcard App ID. Click Continue. Now, select the certificate you created recently and click Continue.

Select your devices and click on Continue.

create-provisioning-profile

Give your profile a name and click “Generate”.

In the next page, download the provisioning file.

generate-provisioning-profile

Back in Testsigma, simply upload the provisioning file which you just downloaded.

Navigate to:

Settings > iOS Settings > Provisioning Profile

Once uploaded, you will find a list of all eligible devices you can use with Testsigma for your iOS test automation.

And you’re done!

Now you have everything setup you can record your iOS tests and run them on your iOS device(s).


B. On your Testsigma Account

  • Testsigma Agent : What is it?
  • How to prepare your iOS device to interact with the recorder
  • Creating and Recording an automated test

What is a Testsigma Agent?

A small utility program that avoids the hassle of multiple configuration and complex setups that you would otherwise need to execute tests on your private devices.

The Testsigma Agent connects the Testsigma server to your local machine. This allows for a highly collaborative environment where you have the Agent installed on your local machine allowing you to develop tests, run and share them on your device (Android or iOS) or its browsers.

There is absolutely no maintenance overhead as the Agent is up to date with all necessary drivers & tools you need to run your tests glitch-free.

INFO:

With one Agent, you can connect as many local machines as you want.

Also, you may set your Agent to private mode according to your preference in case you do not wish it to be seen among the list of active Agents on the team’s Testsigma account.

Why do you need to install the Agent?

install-testsigma-agent

Download & Install Testsigma Agent

Once you have created an account with Testsigma, you just need to follow a few simple steps to get set and go!

Follow this guide to know how you can install and set up the Testsigma Agent on your machine.

Once the connection between the Testsigma server and the Agent is established, and registered, navigate to the Agents tab on the left navigation pane. The Agent that you registered will be displayed with all the available browsers in that Agent machine.


Create a Project

You can start by creating a new mobile Project.

You may also create a new test case under an existing iiOS Project (readily available in your account).

To create a new project, click on the + icon on the left pane. Enter a name, click Next.

Choose if you’d like to add a single application or multiple ones and click Next.

Then, choose the application type as iOS Native App, enter the name of your application and press Next.


Create Test Case

Once you create a project you will be taken to a test case page. Click on +TestCase. In the new page, fill in a name and description for your test and press Next. You will now be taken to the test steps page where you can add all your steps(manually or automatically using the Testsigma Recorder).

If you chose an existing iOS application, from the Test Cases page, click Create to add a new Test Case. Give it a name and click Create. You will be taken to the Test Steps page where you can now add your automated test steps.

Here’s a summary of it:


Launch Test Recorder & Record Steps

Now that you have created your test and specified the application to use for testing, you are ready to start creating the steps that you want your test to execute.

Simply choose the Record option and then click on Start recording to immediately get started.

Once you click Record, choose the local device option.

Upload the application you’d like to check. Upload the .ipa file of your application.

The recorder will now launch and will see the same app open up on your connected iOS mobile too. The actions that you perform on the recorder will run on the mobile that you are connected to.

Based on these interactions, the test steps will be generated automatically.

If you haven’t installed the Agent, you can click on the link to download from the page and follow the instructions on Section 1.

launch-test-recorder-testsigma

Refer to this detailed guide to understand how you can use the Recorder to automate your app.


Creating Test Steps

Refer to this detailed tutorial to understand how you can use the Recorder to automate your app.

In order to create test steps all you need to do is interact with the application in the recorder that launches and each action that you perform will be recorded as a step in the test case.

launch-test-recorder-testsigma

All your actions like a click, entering some values on the app will be recorded and its corresponding steps will be automatically generated.

Once you have added the test steps that you want, click on the quit recorder icon. This saves all your steps. Your test is now ready!


Run Tests on Local Devices

Once you create the steps and quit the Recorder, click on Run. Choose Local Device.

Choose the app and click Run Now.

run-test-case-testsigma

run-status-queued


Next Steps

  • Practice in your account. If you don't have an account Try out!.
  • Try all options in Test Recorder. Try it out!
  • Create Test Plans and Schedules using local devices. Head over to this link!
  • Try out more advanced capabilities. Check out our detailed documentation.

Reach out to us through in app chat for a walkthrough or if you have any questions!

Join Testsigma’s Discord Server for support