You need to have Appium and XCode installed and configured to connect to an iOS device on your Mac as a prerequisite requirement along with some additional requirements if you are performing Tests on a real device. Automating a real iOS device is considerably more complicated, due to Apple's restrictions around running apps on real devices.
Please refer this article for more details - Configuring your Mac and iOS device for Hybrid Test Execution
Also, we need to do the following in Testsigma before we proceed:
- Create a Project, add an Application and an Application Version inside it.
- Create a Test Case and add a few Test Steps in it.
- Create a Test Suite and add the Test Case to it.
Creating a Project, Application and Application Version
If you are new to Testsigma and you are not yet familiar with Testsigma Project Hierarchy, check the Sample Project article to get familiar with the Project organization in Testsigma.
After that, please check the below articles for a detailed guide to creating Projects, Applications, and Versions.
Create a Test Case and add a few Test Steps in it
Please check the following articles for a detailed guide to creating Test Cases and Test Steps:
Create a Test Suite and add the Test Case to it
Please check this article for more details on creating a Test Suite - How to add/edit/delete Test Suite?
You can bypass the Test Suite creation requirement by using a Quick Run or Dry Run.
Please check this article for more details on Quick Run and Dry Run - Different Types of Execution Methods in Testsigma
Considering you already have a Test Suite containing iOS Application Test Case(s), the procedure for Executing a native iOS Application using Testsigma in a local environment are as follows:
1. Add the local test machine(Mac) as a System in Testsigma.
2. Set up the local Mac and iOS device for hybrid Execution.
3. Create Execution and add Execution Configuration.
4. And finally, start the Execution!
1. Add the local test machine as a System in Testsigma
We need to add the local machine to Testsigma's Systems list to be selected as the Test Machine while creating Execution.
Please check this article for creating a System: How to add/edit/delete System?
After adding the System to Testsigma, we can move onto setting the machine up for Hybrid Execution by installing Testsigma Agent and configuring it.
2. Set up the local machine for hybrid Execution
Once the local System is added to Testsigma, we need to perform some configurations on the Local machine where tests are to be run.
This is done so that the local machine can accept communication in the form of HTTP packets from Testsigma servers. This step is preconfigured in other Cloud Execution Models such as Testsigma Labs, Sauce Labs, and BrowserStack. If you prefer the easy method, you may use the cloud execution models in which you can select the execution environment from the list of available devices. Please check this article for more details - How to execute tests in Testsigma Labs, Sauce Labs or Browserstack?
Continuing with the Hybrid Execution setup, we need to first set up the Testsigma agent on the local Mac. Please check the following article for a detailed guide on setting up Testsigma Agent on local Mac for Hybrid Execution:
Assuming you already have the prerequisites such as Appium and XCode configured, we are ready to run tests once the Testsigma Agent is configured. Please follow the steps in the following article if you haven't configured Appium and XCode on your Mac - Configuring your Mac and iOS device for Hybrid Test Execution
Now we can create the Execution Configuration in which we will specify the necessary device details we set up till now.
3. Create Execution and add an Execution Configuration
We are almost there. The local machine is configured with Testsigma Agent and the machine is ready to accept communications from Testsigma servers to start the Execution.
Now we can start creating the Execution. Please check the following article for a detailed guide:
While creating the Execution Configuration for iOS, we need to tell some extra information in case of Hybrid Executions for Testsigma to connect to the local iOS device properly. The most important fields on the page are:
Machine: Select the local System we added in the previous Step. This is the Mac device which Testsigma directly communicates with and from there the communication data is passed to the Test iOS device connected to this Mac.
OS Version: Select the iOS version in the Test Device.
Appium URL: Enter the Appium URL you started the server with. If you used the default configuration, the URL would be:
Device Name: Enter the serial number of the iOS Device.
UDID: Enter the unique device identifier UDID code for your iOS device. Here's a guide to finding your UDID using Itunes App on your Mac - WhatsmyUDID
BundleID: Use this option if the App is already installed on the Test iOS device(Recommended).
- BundleID: BundleID is the unique identifier of an iOS App. Here's a guide to finding your App BundleID - Finding the App Bundle ID
App Path: Use this option if the App to be tested is located on the Mac and you don't want to install it on the test device.
- Use IPA: Specify the Path to the IPA file on the local Mac machine.
Once the Execution Configuration is created, we can finalize the Execution creation by clicking on Create button.
4. Start the Test Execution!!
Goto the Execution page if not already there and make sure the following conditions are met before starting the Execution:
- Make sure the Testsigma Agent that we started earlier is running by refreshing the Agent page. Also, check the Agent is running in a command prompt window titled 'Tomcat'
- Make sure the Appium Server is running
- Check the iOS device is connected. You can verify this by checking the iTunes App on your Mac.
Once all the above checks are done, you can start the Execution. Goto the Executions page and click on Run Now near the corresponding Execution name. That's all we need to do for performing a Hybrid Execution on a local Android Device.
The Tests will start running on the local machine in a few moments if everything is configured correctly.
Welcome to the era of #SmartTestAutomation!!