0

I am trying to update my selenium to the latest version here is my 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>sXXXXXXQA</groupId>
  <artifactId>selnm</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>selnm</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>eclipselink</artifactId>
    <version>2.5.0</version>
</dependency>

    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.44.0</version>
</dependency>

  </dependencies>
</project>

but the it keeps giving error like

artifact descriptor exception: failed to read artifact descriptor for org.selenium
missing artifact org.eclipse.persistence.....    

if i add a maven dependency for it then it shows some other missing artifact and after adding 3, 4 dependencies it starts to give the same error of same missing artifacts, which I've already added in my pom.xml

I've also updated my maven eclipse plugin still nothing seems to resolve my problem

EDIT: after I updated my java maven project maven-> Update Project, it fixed the problem with pom.xml now its not showing any errors but for apparently no reason i see a RED_CROSS sign at root folder of my project and no other package or file inside it has this red cross.. again not able to figure out why? I tried to proceed with running the project by ignoring the errors.. so it gave the following errors in console

 org.testng.TestNGException: 
 Cannot find class in classpath: com.sxxxxl.oxxs.tests.CartTestLoggedIn
    at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
    at org.testng.xml.XmlClass.init(XmlClass.java:73)
    at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
    at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:543)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.testng.xml.XMLParser.parse(XMLParser.java:39)
    at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
    at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
    at org.testng.xml.Parser.parse(Parser.java:168)
    at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:88)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

while i was running these java classes successfully with selenium 2.43.1 I think i have some error with my build path how to find out?

Alpana Chauhan
  • 407
  • 1
  • 9
  • 18
  • Try cleaning the maven cache – Sakshi Singla Jan 08 '15 at 11:04
  • possible duplicate of [Maven: Failed to read artifact descriptor](http://stackoverflow.com/questions/6642146/maven-failed-to-read-artifact-descriptor) – Zoltán Jan 08 '15 at 11:06
  • I could not be sure about it, I just added your dependency to an empty test project and it resolves. However, I see you use an old junit version. Have you tried with junit 4.11? – Martin Jan 08 '15 at 11:09
  • @Martin yeah just tried to do it with junit 4.11 it is still having the same issue – Alpana Chauhan Jan 08 '15 at 11:18
  • Well, check the other comments you got... Maybe it's only the maven cache... I can confirm that you don't need any other special imports for it to resolve properly... – Martin Jan 08 '15 at 11:23
  • Well from here : http://stackoverflow.com/questions/6642146/maven-failed-to-read-artifact-descriptor i got an answer which says to update the maven project , i did and it worked for me. – Alpana Chauhan Jan 08 '15 at 11:27
  • Which Maven and Java version are you using? – Tšeliso Molukanele Jan 08 '15 at 11:31
  • Did you clean the Java project? Do u have TestNG libraries added? – Sakshi Singla Jan 08 '15 at 11:50
  • @SakshiSingla yup i tried cleaning the project multiple times and restarting eclipse plus I have all the testNG libraries .. but this also do not seem to resolve the issue – Alpana Chauhan Jan 08 '15 at 11:56
  • http://stackoverflow.com/questions/25543910/error-org-testng-testngexception-cannot-find-class-in-classpath-empclass Please see if this helps – Sakshi Singla Jan 08 '15 at 11:58

1 Answers1

1

Okay so finally after a lot of struggle my issue is resolved. I did the following:

  1. updated my selenium dependency to 2.44.0
  2. updated my maven project (right click project-> maven-> update project)

still had some issues in my build path due to some outdated jars , which i could see in the marker tab/problem tab next to console tab in eclipse, so

  1. cleaned my .m2/repository folder
  2. restarted eclipse and compiled my project and the whole work-space was build again.

and it worked for me :)

Alpana Chauhan
  • 407
  • 1
  • 9
  • 18