Friday 20 December 2019

Top 15 Interview questions on Maven for Automation Testing/SDET/Lead QA in 2023?



SDET Interview Questions and Answers.  

Jenkins Interview Questions and Answers

Appium Interview Questions and Answers

Selenium Interview Questions and answers

GIT Interview Questions and Answers


MAVEN:


At first glance Maven can appear to be many things, but in a nutshell Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:

  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution

Pipeline Script Fundamentals

Click Here:   DevOps Related Posts




  1. How does Maven manage dependencies and transitive dependencies? Ans: Maven manages dependencies and transitive dependencies through the use of a Project Object Model (POM) file. This file contains information about the project, including a list of dependencies and their versions. When a project depends on another project, Maven will automatically include that project's dependencies (transitive dependencies) in the final build, eliminating the need for manual management of these dependencies. Maven uses a repository to store these dependencies, and it will automatically download them from the repository when they are needed. Additionally, Maven uses a dependency hierarchy to resolve conflicts between different versions of the same dependency, using the "nearest definition" strategy.
  2. How to install Maven on Linux machine? Ans: Click Here for Answer with code & Screenshots
  3. What is a SNAPSHOT version?
     Ans

Notice the value of the version tag in the pom.xml file shown below has the suffix: -SNAPSHOT.
  1. <project xmlns="http://maven.apache.org/POM/4.0.0"
  2. ...
  3. <groupId>...</groupId>
  4. <artifactId>my-app</artifactId>
  5. ...
  6. <version>1.0-SNAPSHOT</version>
  7. <name>Maven Quick Start Archetype</name>
  8. ...

The SNAPSHOT value refers to the 'latest' code along with a development branch, and provides no guarantee the code is stable or unchanged. Conversely, the code in a 'release' version (any version value without the suffix SNAPSHOT) is unchanging.

In other words, a SNAPSHOT version is the 'development' version before the final 'release' version. The SNAPSHOT is "older" than its release.

During the release process, a version of x.y-SNAPSHOT changes to x.y

The release process also increments the development version to x.(y+1)-SNAPSHOT. For example, version 1.0-SNAPSHOT is released as version 1.0, and the new development version is version 1.1-SNAPSHOT.

How do I send email notifications with groovy script in Jenkins pipeline?



3.What is the purpose of mvn clean command?

     Ans:    This command removes the target directory before the starting of a build process.

4. How to integrate Maven pom.xml with Jenkins job?


5. List out the dependency scope in Maven?

      The various dependency scopes used in Maven are:

        • Compile: It is the default scope, and it indicates what dependency is available in the classpath of the project
       • Provided: It indicates that the dependency is provided by JDK or web server or container at runtime
       • Runtime: This says that the dependency is not needed for compilation but is required during   execution
       • Test: It says dependency is available only for the test compilation and execution phases
       • System: It indicates you have to provide the system path
       • Import: This indicates that the identified or specified POM should be replaced with the dependencies in that POM’s section


6.  In Maven, what are the two settings files called and what are their locations?

In Maven, the settings files are called settings.xml, and the two settings files are located at

• Maven installation directory: $M2_Home/conf/settings.xml
• User’s home directory: ${ user.home }/ .m2 / settings.xml

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

Click Here For POM.xml

This has the entire list dependencies required to design a Selenium Automation Framework from scratch.


Both plugins and dependencies are Jar files.

But the difference between them is, most of the work in maven is done using plugins; whereas dependency is just a Jar file which will be added to the classpath while executing the tasks.

So, we can say, plugin is a Jar file which executes the task, and dependency is a Jar which provides the class files to execute the task.

9. Group id vs artifact id

         groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. You have to follow the package name rules, which means that it has to be at least as a domain name you control, and you can create as many subgroups as you want.
eg. org.apache.maven, org.apache.commons

         artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed.
eg. maven, commons-math


10. What is the default location for your local repository?
        
Answer: ~ / M2 / repository.


11. Maven plugins?

         1. surefire plugin
         2. compiler plugin
         3. resource plugin

12. What is the default scope that the maven uses if we do not specify the scope element in pom.xml?

Answer: Compile

How do I create documentation?

To get you jump started with Maven's documentation system you can use the archetype mechanism to generate a site for your existing project using the following command:

mvn archetype:generate \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DarchetypeArtifactId=maven-archetype-site \
  -DgroupId=com.mycompany.app \
  -DartifactId=my-app-site

13. What scope can be used to make certain dependencies available only while compiling and running tests?
         
Answer: Test


14. What is archetype?

Answer: We will use maven archetype to generate the maven folder structure based on the   inputs.
        
Ex: mvn archetype:generate.

TOP INTERVIEW QUESTIONS

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

TOP 15 BDD - CUCUMBER Interview Q&A


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

✍️AUTHORLinkedIn Profile

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

Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below, API Training Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
This includes classnotes, 300+ interview questions, 3 projects, and Java Coding question sets for product companies along with career guidance from FAANG employees for Automation and SDET.

For more details whatsapp: https://lnkd.in/dnBWDM33

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

SeleniumWebdriver Automation Testing Interview Questions:

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

API Testing Interview Question Set:

https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

DevOps Interview Q&A:

https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

Kubernetes Interview Question Set

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

Docker Interview Question Set

https://automationreinvented.blogspot.com/Docker

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/2021/09/top-40-git-interview-questions-and.html

Coding Interview Question Set:

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

Mobile Testing Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:

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


No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

Introduction to Web Testing with Playwright

  Introduction to Web Testing with Playwright 📌  Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 📌  YouTube channel:  https://lnkd.in/gGUG...