If you are using maven project to run selenium or appium tests, find below pom.xml dependencies, you can just change the version of dependencies with the latest version available.
pom.xml – (Project Object Model)
It is an XML file that contains information about the project and configuration details used by Maven to build the project and resides in the base directory of current project.
configuration details can be –
- project dependencies
- plugins
- goals
- build profiles
- project version
- developers
- mailing list
Project dependencies – contains all the dependency.
Navigate to http://mvnrepository.com/ to search for dependencies (for selenium, testNG etc) and include them into the pom.xml
Maven searches the local repository to check if all the dependency present or not, if not, the libraries will be downloaded from online.
POM.xml
<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.practice</groupId> <artifactId>SeleniumTest</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>SeleniumTest</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <suiteXmlFile>testng.xml</suiteXmlFile> <slf4j-api.version>1.7.30</slf4j-api.version> <sel-version>4.10.0</sel-version> </properties> <dependencies> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>{sel-version}</version> </dependency> <!-- https://mvnrepository.com/artifact/org.testng/testng --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.8.0</version> <scope>compile</scope> </dependency> <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports --> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>5.0.9</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> <scope>runtime</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.2.3</version> </dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j-api.version}</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>5.2.3</version> </dependency> <!-- https://mvnrepository.com/artifact/org.freemarker/freemarker --> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.28</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M5</version> <configuration> <suiteXmlFiles> <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> </build> </project>
If you want to use appium java client, then use below dependency
<!-- https://mvnrepository.com/artifact/io.appium/java-client --> <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>8.5.1</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-support</artifactId> <version>4.10.0</version> </dependency>
Note :
If you are using appium java-client dependency, then no need to use selenium dependency. (Appium java client dependency has default selenium)
Dependencies –
You can change the version to latest version, and save the pom.xml, maven will download all required latest jar files automatically, else you can just build the project to download the latest libraries.
To get the latest version of each dependency, refer https://mvnrepository.com/
Plugins –
Get the list of maven plugins from here
Get maven compiler plugin from here
Get maven surefire plugin from here
That’s it about the pom.xml details, now move a step ahead and create a sample selenium / appium test!
Sunilpatro1985, thanks so much for the post.Much thanks again. Really Cool.
Thanks man :)
Thank You