- Selenium WebDriver Quick Start Guide
- Pinakin Chaubal
- 143字
- 2021-06-24 18:26:27
Understanding pom.xml
It's time to explore pom.xml. This is what pom.xml looks like:
<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>org.packt.selenium</groupId>
<artifactId>FirstSelenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
</project>
Group ID and Artifact ID that you added in the previous screens have appeared in the preceding file, inside the Project tag. In order to work with Selenium, we will need to add Selenium dependencies within the Project tag. Let's go ahead and add those from the Maven repository:
- Go to the Maven repository (https://mvnrepository.com) and grab the dependency shown here:
<!--
https://mvnrepository.com/artifact/org.seleniumhq.selenium/
selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.13.0</version>
</dependency>
- Place this dependency inside a dependencies tag, as shown in the pom.xml file here:
<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>org.packt.selenium</groupId>
<artifactId>FirstSelenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!--
https://mvnrepository.com/artifact/org.seleniumhq.selenium/
selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.13.0</version>
</dependency>
</dependencies>
</project>
- Save the pom.xml. You will see a small activity in the bottom-right corner of Eclipse, stating that the project is being built.
The Maven Dependencies folder now gets populated with all of the downloaded JARs, as shown previously.
推薦閱讀
- Implementing Cisco UCS Solutions
- 阿里云數字新基建系列:云原生操作系統Kubernetes
- Haskell Financial Data Modeling and Predictive Analytics
- SharePoint 2013 WCM Advanced Cookbook
- Installing and Configuring Windows 10:70-698 Exam Guide
- 嵌入式Linux應用開發菜鳥進階
- Windows Server 2019 Administration Fundamentals
- 嵌入式實時操作系統μC/OS原理與實踐
- Mobile First Design with HTML5 and CSS3
- Hands-On UX Design for Developers
- Building Telephony Systems With Asterisk
- 從實踐中學習Windows滲透測試
- Linux網絡操作系統項目教程(RHEL 7.4/CentOS 7.4)(第3版)(微課版)
- Raspberry Pi入門指南
- 應急指揮信息系統設計