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 and toggle on Web Inspector.
- 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 and enable Show Develop menu in menu bar.
- 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 a scenario of an application under test (AUT), which involves mimicking a UI model of an AUT using nodes, features, and UI elements.
Test Designing involves:
- Create an Offline Model — To create an offline model, see the Create an Offline Model article.
- Record a Scenario 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.
Recording for the Record Scenario feature is done in an offline model. It doesn't interact with the live application.
Generate 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
To execute scripts, refer to the Executing Mobile Automation Scripts in macOS article.