简体   繁体   中英

Confused about TestNG version# and Selenium-JAVA version# - How to get version number for Maven POM.xml file

I've Eclipse and TestNG. I've played around with several projects using testng.xml. Now I want to run the projects using POM.xml. I've installed maven and created a new maven project. After creating a script I opened my pom.xml file and copied a sample pom.xml file that I copied from online but unfortunately I received TestNG dependency error. I assumed the error was because of incorrect TestNG version. So I went to Eclipse menu Help->About Eclipse IDE->Installation Details and got the version# of the TestNG that I'd installed.

TestNG M2E (Maven) Integration (Optional) 7.2.0.202004281604 org.testng.eclipse.maven.feature.feature.group TestNG Team

So I added the 7.2.0 to TestNG dependency to my Pom.xml but it's still showing error for TestNG dependency

 <dependency>
    <groupId>org.testng</groupId>
     <artifactId>testng</artifactId>
     <version>7.2.0</version>
     <scope>test</scope>
 </dependency>

After some research I found this site https://mvnrepository.com/artifact/org.testng/testng

  1. My question is why does eclipse show that I installed 7.2.0 version of TestNG when there is no 7.2.0 TestNG version to begin with? Anyhow version 7.3.0 finally worked. I don't understand why did version 7.3.0 work when I've 7.2.0 version installed on my machine.

  2. My second question is how do I find out what my Selenium-Java version I've installed on my machine?
    I've tried looking under Java Build Bath->Libraries tab and noticed that JRE System Library has JAVASE-13 and the Classpath is showing different version for different jar files. For example
    byte-buddy-1.8.15.jar
    client-comined-3.141.59-srouces.jar
    commons-codec-1.13.jar
    Can someone please help me how do I go about finding out the correct selenium-java version? Shouldn't maven just download the version I add under dependency?

Thanks in advance

"TestNG M2E (Maven) Integration" is an Eclipse plugin for integrating with TestNG. You have version 7.2 of that plugin.

That's completely different from the actual TestNG library.

Shouldn't maven just download the version I add under dependency?

Yes, it will download and use whatever you tell it to (provided it exists). Whether you have another version somewhere else on your computer is irrelevant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM