How to Automate Web Applications

Modified on Fri, 26 Apr 2024 at 12:45 PM

This article provides the steps to automate web applications.



Use case:  Amazing shopping journey: verifying the cart details


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


Leveraging algoQA, you can perform the following:

Prerequisites

  • Use algoScraper for Application Scraping
    • The algoScraper tool, available as a Chrome extension, serves the purpose of capturing all User Interface (UI) elements and X-paths present on a web page. To integrate this tool into your Chrome or Edge browser, Click here.
    • Scrape all the required UI elements and download the file in the CSV format. For more information on scraping UI elements and tool information, see algoScraper as an Extension Tool for Chrome or Edge Users.
    • The downloaded spreadsheet contains comprehensive details of UI elements details.
Tip: Ensure that all page names in the scraped file are same as the UI elements’ names.

 

  • Supported Framework for windows - Java selenium 
    • The framework requires Java and Maven as key components.
    • To install the latest versions of Java and Maven, refer to the JDK Installation guide.


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. Download the script to your local folder.  Navigate to the same folder.
    2. On the status bar, enter cmd to view the Command Prompt screen. 
    3. Run the following command to trigger the script.
      mvn test
    4.  You can view the respective report.

Related Articles


Displaying Timestamps for Generated Script Folders to Identify Concurrent Users' Actions. 






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