Monday, 15 May 2017

MAVEN TOOL

                                      MAVEN TOOL

What is Maven?

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework. Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.
In case of multiple development teams environment, Maven can set-up the way to work as per standards in a very short time. As most of the project setups are simple and reusable, Maven makes life of developer easy while creating reports, checks, build and testing automation setups. 

Maven Phases
Although hardly a comprehensive list, these are the most common default lifecycle phases executed.
§  validate: validate the project is correct and all necessary information is available
§  compile: compile the source code of the project
§  test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
§  package: take the compiled code and package it in its distributable format, such as a JAR.
§  integration-test: process and deploy the package if necessary into an environment where integration tests can be run
§  verify: run any checks to verify the package is valid and meets quality criteria
§  install: install the package into the local repository, for use as a dependency in other projects locally
§  deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
There are two other Maven lifecycles of note beyond the default list above. They are

§  clean: cleans up artifacts created by prior builds

STEPS TO CREATE A MAVEN TOOL:

steps1:

1.Download jdk8
2.Instal in tester computer
3.create JAVA_HOME environment variable
4.extend "path"variable value.

steps2:

Download eclipse IDE
Launch eclipse IDE and specify workspace to store scripts or programs.

steps3:

1.Goto help menu in eclipse IDE
2.click instal software option
3.click  add
4.enter name as M2Eclipse
***************************
click next until finish.( maven plugin to eclipse IDE was installed)
***************************

steps4:

File menu in eclipse IDE-->new-->other-->maven-->maven project-->click next-->select create a simple project option-->click next-->enter group id-->enter artifact id-->click finish.

Note:

After completion of maven  project creation ,we need to set compiler version and JRE version to latest by using "properties" option.

steps5:

Open POM.xml-->insert<dependencies>tag-->get and paste dependency code.

What is pom?

POM stands for Project Object Model. It is fundamental Unit of Work in Maven. It is an XML file. It always resides in the base directory of the project as pom.xml.
The POM contains information about the project and various configuration detail used by Maven to build the project(s)
eg:

<dependency>


    <groupid>org.seleniumhq.selenium</groupid>


    <artifactid>selenium.java</artifactid>


    <version>3.4.0</version>


</dependency>


First let us create a simple maven project;
Step 1: Navigate to File Menu -> New, and check if Maven Project is displaying if yes, click on Maven Project. If NOT, please click on Other.
Maven project selection.
Step 2: After Clicking on Other, it will display 'select a wizard' screen, please type as Maven in the text box to filter and find Maven. After that Select Maven and Click on next button.
Filter Maven project.
In the next screen, it will ask you to select project name and location. By default, 'Use default workspace location' will be selected. Just click on next button to proceed without making any changes.
Step 3: In the next screen, It will ask you to select an Archetype. Depending on the type of project that you are working, you need to choose the archetype.
select maven Archetype.
Here we will choose a basic archetype 'quickstart' and Click on Next button
Step 4: It will ask you to 'Enter a group id for the artifact.' Click here to know more about Group ID and Artifacts.
We will input as shown in the below image. Version number will be by default 0.0.1-SNAPSHOT
Maven Artifacts.
Step 5: Click on Finish. Now Creating a maven project is Done. Lets see how the project is created. If you expand and see the project structure,
Maven project.
If you observe, it has downloaded Maven Dependencies. You can see by expanding the Maven Dependencies. And also it has created pom.xml file. The below is the pom.xml file which got created.
Advantages: 
1. Selenium is pure open source, freeware and portable tool. 
2. Selenium supports variety of languages that include Java, Perl, Python, C#, Ruby, Groovy, Java Script, and VB Script. etc. 
3. Selenium supports many operating systems like Windows, Macintosh, Linux, Unix etc. 
8. Selenium can be integrated with other open source tools for supporting other features.
10. Selenium supports very less CPU and RAM consumption for script execution.
Disadvantages: 
1. Selenium needs very much expertise resources. The resource should also be very well versed in framework architecture. 
2. Selenium only supports web based application and does not support windows based application. 
3. It is difficult to test Image based application. 
4. Selenium need outside support for report generation activity like dependence on TestNG or Jenkins. 
5. Selenium does not support built in add-ins support. 
Share:

0 comments:

Post a Comment

Testersonly. Powered by Blogger.