Automating M-Site Applications Using iOS Devices
Automate M-Site applications on iOS devices using algoQA with Safari Web Inspector and Python Appium.
Use Case: Amazon Shopping Journey — Verifying the Cart Details
In this use case, you are shopping for a new laptop on the Amazon M-Site, making selections based on specific requirements such as brand and filtering options, adding items to your cart, and proceeding to check out for a purchase.
Prerequisite
Using algoQA, you can scrape the UI elements manually by performing the following:
-
Enable Safari Web Inspector on iOS:
On your iOS device, go to "Settings" > "Safari" > "Advanced."
Toggle on the "Web Inspector" option.
-
Connect the iOS Device to Mac:
Connect your iOS device to your Mac using a USB cable.
-
Open Safari on your Mac.
-
Enable the Developer Menu:
Go to "Safari" > "Preferences" > "Advanced."
Enable the "Show Develop menu in menu bar" option.
-
Inspect Elements:
Open Safari on your iOS device and navigate to the mobile site you want to inspect.
-
Open Safari Developer Tools on Mac:
On your Mac, open Safari and go to the "Develop" menu.
Select your connected iOS device and choose the tab that corresponds to the open Safari window on your iOS device.
-
Toggle Element Selection:
In Safari on your Mac, click the "Elements" tab to open the Developer Tools.
Use the "Select Element" tool (arrow icon) to highlight and select the element on the mobile site.
-
Copy XPath:
Once the element is selected, right-click the highlighted code in the Developer Tools and choose "Copy" > "Copy XPath."
Ensure that all page names in the scraped file are the same as the UI elements' names.
Test Design the Application
Test Design is the process of creating an scenario of an application under test (AUT), which involves mimicking a UI model of an AUT using nodes, features, and UI elements.
Profiling involves:
- Create an Offline Model - To create an offline model, see Profiling article.
- Recording the scenarios using Offline Recorder_ -_The Record Scenario feature is used to record and save the workflow, scenario, or use case. The scenario will be saved in the same sequence in which it was recorded.
Note: Recording for the Record Scenario feature is done in an offline model. It doesn't interact with the live application.
Generate and Test Cases and Test Scripts
Test cases are generated in Gherkin language and are Behavior-Driven Development (BDD) compliant.
For more information, see Generate Test cases and Test Scripts.
Execute Scripts
Perform the following:
- Download the generated scripts.
- Executing Scripts on macOS
- Navigate to Test Scripts and download the script.
- Download the script to your local folder. Navigate to that folder, right-click, and select Services > New Terminal at Folder.

- Run the following command to trigger the script in the Terminal window.
behave
- In the folder structure, you can view the respective report as follows:
