A quick dive in the framework
Our framework will be driven using Maven. Lets look at the official definition of Maven as given by the official website maven.apache.org:- "Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information."
We will use Maven to download the required dependencies for us. Dependencies are added in the POM.xml file which gets created for you when you create a Maven project in eclipse. POM stands for Project Object Model. POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project.The structure of a basic POM.xml is given below
</project>
The line indicated by 1 above is the group-id and this should be the domain on which you have full control on and it is entered in reverse.
The line indicated by 2 above is the artifact-id and this should be the name of your JAR file is you plan to package the framework as a JAR, remember to put the name in this tag
The line indicated by 3 above is the version and this should be a number followed by -SNAPSHOT. SNAPSHOT indicates that this is a work in progress.
The lines starting at 4 above are the dependencies for ouur project. This is the most important part of the POM.xml. For now we have added Selenium WebDriver and TestNG dependencies.
On line 5 we have the selenium version listed which looks like ${selenium.version}. This simply means that replace this piece with the corresponding value in the properties tag. The value of selenium.version in the properties tag is 3.7.1. So this will be replaced at runtime. Same will be the case with testng.version.
On line 6 we have the version tag that has the value 'Test'. This indicates that the dependencies that have been listed will be loaded into the class path only when the tests are run.
No comments:
Post a Comment