ScriptlessAutomation
  • 👋Welcome to Scriptless Automation
  • Discover More About Automation
    • ⚙️Automation platform intro
    • 💡Advantages of Scriptless Automation
    • 🚀Release Notes
      • 📖Open Code
      • 📕License Code
  • Product tools
    • 📪Pre-request Tools
    • 🔧Project Dependencies
  • Automation Architecture
    • 🎨Flow diagram
  • Get Started
    • 🛠️Start with Automation
    • 📖Open Code Automation
      • 🌏Web Automation
      • ↔️API Automation
    • 🏢Maven Configuration
    • 🗜️Setting Up Maven Project in IntelliJ IDEA
    • 🎛️Scriptless Config
      • 🕸️BrowserConfiguration
        • chrome.properties
      • 👥CommunicationConfiguration
        • SlackConfiguration.properties
      • 📧MailConfiguration
        • gmailCredentials.properties
      • 🛂ReportConfiguration
        • extentReportConfiguration.properties
      • 🕵️TestManagementConfiguration
        • testRail.properties
        • zephyrscale.properties
        • testiny.properties
      • ⚙️testNgConfiguration.properties
    • 🍱TestData Configuration
    • 👨‍💼Gherkin Language and Scriptless Automation Framework
  • Automation Import Notes
    • 🎨Points to Remember
  • Automation Platforms
    • 👾ScriptlessApi Automation
      • 🖊️Introduction
      • 🗜️Api Automation Setup
      • 🔃Supported API Request Types
      • 🪧API Automation Template
      • 📚Example of API Requests
        • ⬇️GET
        • ↕️POST
        • ⤵️PUT
        • ❌DELETE
      • 🎯API Response Validation
      • 👨‍👦API Dependent TestCase
      • 📝Store API Variables
      • 📔API with JSON body
      • 🙋‍♂️Api Wait
      • 🗜️API Schema Validation
      • 🏗️API Tailor-Made coding
      • 👨‍🦯API Support Generator
      • ↘️Api Response Store Objects
      • ✍️API Test Report
      • 🚃Api Response Type Validation
    • 🌐ScriptlessWeb Automation
      • 🖊️Introduction
      • 🗜️Web Automation Setup
      • 🪧Web Automation Template
      • 🧮page_object_locators
      • 📜Web Automation Key Phrases
        • 📃PAGE_NAME
        • ⌛WAIT_TYPE
        • 📜SCROLL_TYPE
        • 👨‍💼ELEMENT_NAME
        • 🏎️ACTIONS
        • ⌨️SEND_KEYS
        • ✔️VALIDATION
        • ✅VALIDATION_TYPE
      • 👨‍👦Web Dependent Test Case
      • 🐒MOCK
      • 🛂AutomationAsserts
      • 🏗️Web Tailor-Made coding
      • 📝Store Web Variables
      • 🤼‍♀️Web & API integration
      • 🖇️Dynamic Strings
      • 🗣️ReadFile Annotation for Custom Code
      • 🖼️Page_Comparison
      • 👨‍💼Gherkin Template for Web Automation
    • 📱Mobile Automation
  • 🪶Automation features
    • 🌲Environment and System Variables
    • 🗝️KeyInitializers
      • Types of KeyInitializers
    • ✍️Reporting
      • Dashboard
      • Category
      • Tests
        • Screenshot Section
    • 👯Parallel Testing
    • 🏗️Tailor-Made Coding
  • ⏩Automation Demo
Powered by GitBook
On this page
  • New Project
  • Dependency
  • Plugins
  • Conclusion

Was this helpful?

  1. Get Started

Setting Up Maven Project in IntelliJ IDEA

PreviousMaven ConfigurationNextScriptless Config

Last updated 11 months ago

Was this helpful?

New Project

  • Open IntelliJ IDEA and select "New Project."

  • Enter your project's name and other details.

  • Choose a project location

  • Choose "Maven" from the left-hand side and click "Create."

Dependency

  • Open the pom.xml file in your project.

  • Add any necessary dependencies in the <dependencies> section.

  • Save the file to automatically download the dependencies.

Plugins

Add below plugin to the pom.xml:

  • Add Compiler plugin to compile the framework.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
            <compilerArgument>-parameters</compilerArgument>
            <parameters>true</parameters>
            <testCompilerArgument>-parameters</testCompilerArgument>
        </configuration>
    </plugin>
  • Add exec-maven plugin to generate custom TestNg file as per the platform selected in automation configuration

    <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
             <execution>
               <goals>
                 <goal>java</goal>
                </goals>
             </execution>
            </executions>
            <configuration>
              <mainClass>in.precisiontestautomation.runner.ScriptlessApplication</mainClass>
                <arguments>
                  <argument>true</argument>
                </arguments>
            </configuration>
    </plugin>
  • Add maven-surefire-plugin to execute generated TestNg file through maven command mvn test

     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>3.0.0-M4</version>
           <configuration>
              <argLine>-XX:+ExplicitGInvokesConcurrent</argLine>
              <argLine>--add-opens java.base/java.lang.reflect=ALL-UNNAMED</argLine>
              <testFailureIgnore>false</testFailureIgnore>
                <suiteXmlFiles>
                   <suiteXmlFile>target/testngenerator.xml</suiteXmlFile>
                </suiteXmlFiles>
           </configuration>
      </plugin>

Conclusion

After add above configuration in pom.xml, it will look like below

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.Test</groupId>
    <artifactId>SampleTestProject</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.precissiontestautomaton</groupId>
            <artifactId>ScriptLess-Automation</artifactId>
            <version>LATEST</version>
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>${basedir}/src/main</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <compilerArgument>-parameters</compilerArgument>
                    <parameters>true</parameters>
                    <testCompilerArgument>-parameters</testCompilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>in.precisiontestautomation.runner.ScriptlessApplication</mainClass>
                    <arguments>
                       <argument>true</argument>
                    </arguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <argLine>-XX:+ExplicitGInvokesConcurrent</argLine>
                    <argLine>--add-opens java.base/java.lang.reflect=ALL-UNNAMED</argLine>
                    <testFailureIgnore>false</testFailureIgnore>
                    <suiteXmlFiles>
                        <suiteXmlFile>target/testngenerator.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
🗜️