Automating Test Cases Using iOS DevicesAutomating M-Site Applications using iOS devices

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:

  1. Enable Safari Web Inspector on iOS: On your iOS device, go to Settings > Safari > Advanced and toggle on Web Inspector.
  2. Connect the iOS Device to Mac: Connect your iOS device to your Mac using a USB cable.
  3. Open Safari on your Mac.
  4. Enable the Developer Menu: Go to Safari > Preferences > Advanced and enable Show Develop menu in menu bar.
  5. Inspect Elements: Open Safari on your iOS device and navigate to the mobile site you want to inspect.
  6. 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.
  7. 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.
  8. 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:

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.