Automating M-Site Applications using iOS devices

Modified on Thu, 25 Jan 2024 at 08:32 PM

This article provides the steps to automate  M-Site Applications 


Use case:  Amazing shopping journey: verifying the cart details

In this use case, you are shopping for a new laptop on an amazon m-site, making selections based on specific requirements, such as brand, filtering options, adding items to their cart, and proceeding to check out for a purchase.


Prerequisite

Leveraging algoQA, you can perform the following to scrape the UI elements manually.

  1. Using Safari Developer Tools: Enable Safari Web Inspector on iOS:
    On your iOS device, go to "Settings" > "Safari" > "Advanced."
    Toggle on the "Web Inspector" option.

  2. Connect iOS Device to Mac:
    Connect your iOS device to your Mac using a USB cable.
  3. Open Safari on your Mac.

  4. Enable Developer Menu:
    Go to "Safari" > "Preferences" > "Advanced."
    Enable the "Show Develop menu in menu bar" option.

  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 on 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 on the highlighted code in the Developer Tools and choose "Copy" > "Copy XPath."

Tip: Ensure that all page names in the scraped file are same as the UI elements’ names.


Profile the application

Profiling is the process of creating an offline model 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 FollowMe feature

    Follow Me feature is used to record and save the workflow or scenario or use case. Scenario will be saved in the same sequence it has been recorded.


Note: Recording for the FollowMe feature is done in an offline model. It doesn’t interact with the live application.


For more information, see Follow Me section in the Profiling article. 


  • Generating Test Cases
    Test cases are generated in Gherkin language and are Behavior-driven development (BDD) compliant.

                For more information, see Generate Test cases section in the Profiling article.


Generate and Execute Scripts
Perform the following:

  1. Navigate to the appropriate folder in the Script Generation screen. 
  2. Select the required files under Test Cases folder and click Analyze button. 


  3. In the pop-up window, click Proceed to highlight the Generate Script button.
  4. Click Generate Script.
  5. Scripts are generated successfully with the specified report.  
  6. Execution of scripts on windows
    1. Navigate to the appropriate script generated folder in the project explorer pane and select More Menu > Download to My Computer.

    2. Download the script to your local folder.  Navigate to the same folder >right-click >Services >New Terminal at a Folder.
    3. Run the following command to trigger the script in the Terminal window.
      behave


    4.  In the folder structure, you can view the respective report as follows: 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article