๐ŸŒWeb Automation

Introduction

This guide provides a step-by-step process to set up and run a Maven project with Scriptless Automation for web testing. It includes adding dependencies, configuring plugins, and setting up the necessary configurations for web automation.

Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Java Development Kit (JDK)

  • Apache Maven

  • IntelliJ IDEA (or any preferred IDE)

Project Setup

1. Create a Maven Project

Create a new Maven project in your IDE or via the command line.

2. Add Dependencies

Add the Scriptless Automation dependency to your pom.xml file:

<dependencies>
  <dependency>
    <groupId>in.precisiontestautomation.scriptlessautomation</groupId>
    <artifactId>scriptlessautomation-web</artifactId>
    <version>LATEST</version>
  </dependency>
</dependencies>

3. Add Plugins

Add the following plugins to your pom.xml file to configure the execution of the main class and testing framework:

Configuration

4. Add Scriptless Configuration

To execute Scriptless Automation, add the following configuration files in your project:

4.1 browserConfiguration/chrome.properties

This file contains the configuration settings for the Chrome browser.

4.2 reportConfiguration/extentReportConfiguration.properties

This file contains the configuration settings for the Extent Reports.

4.3 testNgConfiguration.properties

This file contains the TestNG configuration settings.

5. Add Test Data

Add the necessary test data to your project. This involves creating a directory structure to store test data files and ensuring they are accessible to your test scripts. Use the following directory structure:

5.1 test_data/web/page_object_locators/locators.properties

This file contains all the locators used in your web pages. Learn more here

5.2 test_data/web/test_case_flows/TestDirectory/TestID_GroupName.csv

This file contains test case flows and steps for each test. Each directory under test_case_flows represents a feature.

5.3 test_data/web/dynamic_strings

This file contains environment-specific dynamic strings

5.4 test_data/web/page_screenshot

This directory stores different page screenshots to do UI testing.

IntelliJ IDEA Setup

6. Add IntelliJ Run Configuration

Create a run configuration in IntelliJ IDEA to run your Maven project. Follow these steps:

  1. Go to Run > Edit Configurations.

  2. Click on the + icon and select Application.

  3. Set the name for your configuration (e.g., runner).

  4. Click on Apply

7. Run CLI Command

To execute the project, use the following CLI command:

This command will run the main class defined in the exec-maven-plugin configuration.

Conclusion

By following this guide, you have set up a Maven project with Scriptless Automation for web testing. You configured the necessary dependencies, plugins, and run configurations to execute your web automation tests.

Next Steps

  • Customize your test scripts according to your web application requirements.

  • Explore more features of Scriptless Automation to enhance your test coverage.

  • Integrate additional tools and frameworks as needed for comprehensive test automation.

Video Tutorial

Last updated