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.
- 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. - Connect iOS Device to Mac:
Connect your iOS device to your Mac using a USB cable. - Open Safari on your Mac.
- Enable 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 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. - 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 Record Scenario feature
Record Scenario 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 Record Scenario 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:
- Navigate to the Test cases and click on generate scripts button besides to appropriate test case.
- Select the required files and click generate scripts.
- Scripts are generated successfully with the specified report.
- Execution of scripts on windows
- Navigate to Test Scripts and Download the script.
- Download the script to your local folder. Navigate to the same folder >right-click >Services >New Terminal at a 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:
- Navigate to Test Scripts and Download the script.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article