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


Saturday, 14 December 2019

Top 11 Linux commands for Automation Tester/SDET interview?



  • ls: used for listing of files
                ls -al; gives detailed information of the files

                ls -a:Listing Hidden Files
  • cat: creating and viewing of files
                cat > filename : create new file

                cat filename: to view file

                cat fileone finetwo > filecombined : combine two files into one
  • rm: to delete files
                rm filename
  • mv: to move files
                mv file location   (location is the path where you want to move the file)
  • chmod: To change permission
               chmod 777 filename (777 is the permission code)

               chown: change ownership of file

               chown owner:groupowner filename
  • grep:To search pattern
              search test in all text files then grep command will be:

             grep test *.txt
  • tail: to display last lines of files
             tail -n 5 test.txt : it will display last 5 lines of test.txt file
  • ssh: to connect to remote linux machines
              ssh user@IP

             for example the command will look like; ssh sidharth@192.168.x.x

  • traceroute:
               tracks the route that a particular packet of information takes to reach to the host
               traceroute www.automationreinvented.blogspot.com
  • ftp and sftp:
               to connect to remote server and download files

               $ ftp IP/hostname

               ftp> mget *.txt

  • ps: to check process

               ps -ef: current running process

              we can choose more or less with below
              ps -ef | less or more
  •  dstat – view processes, memory, paging, I/O, CPU, etc., in real-time. All-in-one for vmstat, iostat, netstat, and ifstat.
  • iotop – interactive I/O viewer. Get an overview of storage r/w activity.
  • rsync – remote file transfers and syncing. 
 

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

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, 7 December 2019

Top 11 GIT Interview question for Automation Testing/SDET/Lead QA?

1. How to create repository in GIT?

    $ git init

2. How to clone a repo?

Clone the test repo into a new directory called TEST:
$ git clone https://github.com/<username>/test.git TEST

3. How to switch branch?
 git switch branchname

4.  How to unstage changes or restore files?

 Maybe you accidentally staged some files that you don't want to commit.
 $ git restore test.js
 $ git restore .

 5. How to undo commits?

 The following command will undo your most recent commit and put those changes back into staging, so you don't lose any work:
$ git reset --soft HEAD~1
The next one will completely delete the commit and throw away any changes. Be absolutely sure this is what you want:
$ git reset --hard HEAD~1

6. How to undo last push?

Some would say this is bad practice. Once you push something you shouldn't overwrite those changes. Instead, you're supposed to create a new commit that reverts the changes in the last one. So, technically, you shouldn't do this, but... you can?

$ git reset --hard HEAD~1 && git push -f origin master

7. How to fetch changes from both origin and upstream?

$ git fetch --multiple origin upstream

8. How to delete a local branch?

$ git branch -d <local_branch>
Use the -D option flag to force it.

9. How to stash ur chnages?

$ git stash


10.  How to push changes?

 git add -all
 git commit -m "message"
 git push remote_server branch_Name

11. Difference between rebase and merge?
 git merge apply all unique commits from branch A into branch B in one commit 
 git rebase gets all unique commits from both branches and applies them one by one.
 git rebase rewrites commit history but doesn't create extra commit for merging.

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

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

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...