Tuesday, 9 February 2021

Maven dependencies with pom.xml for Automation Framework design?How to add selenium, testng,cucumber dependency in Maven?

 

 

 Maven Interview question for SDET/QAE/Automation Testing/QA Lead:

https://automationreinvented.blogspot.com/2019/12/top-11-interview-questions-on-maven.html

Maven dependencies to add below jars in Automation Framework Design:

  •  Selenium Webdriver
  • TestNG
  • Extent Report
  • Log4j
  • Cucumber
  • Json


    ********************************************************

    Framework Design Tips & Interview Question-Click Here

    ************************************************** 

     
  • How to add dependency for selenium/testng/json/extent reporting in maven?

Copy and paste the below pom.xml in you pom.xml and then run maven build to make sure all the dependencies has been added to your automation project.(pom.xml for selenium and testNg along with cucumber)

 ************************************************

<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.testing.UIassistant.automation</groupId>
    <artifactId>UIAssistantAutomation</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>WEGUIProject</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <fork>true</fork>
                    <executable>C:\Program Files\Java\jdk1.8.0_231\bin\javac</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>resources\testNG_xml\SmokeSuite.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <properties>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                        <property>
                            <name>listener</name>
                            <value>org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter</value>
                        </property>
                    </properties>
                    <workingDirectory>target/</workingDirectory>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <dependencies>
    
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>
       
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20180813</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>
        </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <version>2.4.0</version>
        </dependency>

        <dependency>
            <groupId>net.minidev</groupId>
            <artifactId>json-smart</artifactId>
            <version>2.3</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.14.0</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
        </dependency>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.4</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>3.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>velocity</groupId>
            <artifactId>velocity-dep</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.11.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.11.2</version>
        </dependency>

        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility-proxy</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.9.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>1.2.5</version>
        </dependency>
            <dependency>
            <groupId>com.relevantcodes</groupId>
            <artifactId>extentreports</artifactId>
            <version>2.41.2</version>
        </dependency>
        <dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.0</version>
</dependency>


    </dependencies>
</project>

 ***************************************************

TOP INTERVIEW PREPARATION TIPS:

**************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Sunday, 7 February 2021

How to run test automation TestNG suite with gradle from jenkins job? Jenkins Integration with Gradle and TestNG.xml suite?Run TestNG suite with Gradle?

 

 

 

**************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 ***************************************************

STEP  - 01:

 Add test to build.gradle file and define the testng Automation suite.xml path as shown below :

// in below screenshot SmokeSuite.xml has all the test scripts to run and the path in project folder is Resources/TestSuite/SmokeSuite.xml

test {

    useTestNG() {

        useDefaultListeners = true

        suites "Resources/TestSuite/SmokeSuite.xml"

    }

 

STEP -02:

Go to the project path and open cmd, then type below command to check gradle task is executing properly:

gradlew clean test


 

 STEP - 03:

Click on new item in Jenkins



 STEP - 04:

Give project name and select freestyle project


********************************************************

Framework Design Tips & Interview Question-Click Here

**************************************************

 STEP - 05:

Go To Build ==> Invoke Gradle Script


 

STEP - 06:

Define Tasks as "clean test" and Buildfile is the path of your project build.gradle



 

STEP - 07:

Click on Build Now button in the left panel to run your suite.

 


 

 

**************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

 

Saturday, 6 February 2021

Automation testing pre setup in local machine for Web UI Automation? 7 Steps to set-up UI Test Automation in local machine

 



Step-01:
Chropath in chrome by visiting below :
https://chrome.google.com/webstore/detail/chropath

You can use selectors hub too. Those tools helps to identify the locators for web-element.

To know more about Xpath identification check below link:
Click the link here for details on XPATH


Step-02

Download eclipse as IDE as mentioned in below link:
https://automationreinvented.blogspot.com/2020/04/top-question-to-start-career-as-api.html

Download JDK and check inside java folder you should have both jre and jdk folder with same version.
To check installation is correct or not: type java -version and javac in your cmd.

Step-03
https://github.com/
Create account in git hub to upload automation project for source code repository.

To know all the commands on GIT please check below link:
Click link here for details and git commands


Step:-04
https://hub.docker.com/
Create account in dockerhub to do selenium grid + docker container setup.

How to do the Docker setup with Selenium Grid:
Click on link to get all the steps

 
Step:05

- Add TestNG to eclipse:

- To add TestNG to eclipse follow below steps:
Help-->Install New Software-->Add-->Name:TestNG & Location:http://dl.bintray.com/testng-team/testng-eclipse-release/ -->Next-->Finish

TestNG will be used to design the test script.

********************************************************

Framework Design Tips & Interview Question-Click Here

**************************************************  


Step-06
Add Maven to eclipse:

- To add maven to eclipse follow below steps:
Help-->Install New Software--> Add-->Name:Maven & Location:  http://download.eclipse.org/technology/m2e/releases -->Next-->Finish

Maven is required for dependency management.

Step-07

Add the below pom.xml which has all the dependencies required for Automation framework

Click here for the pom.xml file

This above pom file has all dependencies required for pre setup to perform WebUI automation: Selenium, TestNG, Extent Report, JSON etc.

 ***************************************************

TOP INTERVIEW PREPARATION TIPS:

**************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

 

All Time Popular Posts

Most Featured Post

𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀?

❓ 𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀? The issue isn’t your logic—it’s the lack of pattern recogniti...