6

I am using Firefox 45.0 and Dependency added in pom.xml is selenium-firefox-driver 2.53.0.

java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException
    at TestFIles_MDM.Test_Authn.setup(Test_Authn.java:27)

Error is coming for both Firefox and Chrome.

How can I resolve it, it was working last week.

2
  • Are you trying to se the webdriver instance after it was closed, perhaps? Commented Apr 18, 2016 at 15:31
  • it looks like your browser and webdriver version not in sync. Commented Apr 18, 2016 at 15:35

5 Answers 5

4

I think you are missing this dependency in pom.xml:

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

Check Selenium docs about Maven dependencies.

Sign up to request clarification or add additional context in comments.

4 Comments

I have this dependency too in my pom.xml: <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>2.53.0</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.53.0</version> </dependency>
that should be enough. Try to include selenium-api dependency explicitly maybe and see if that makes any difference?
did that too, but still not running. selenium-api: 2.39.0
2

Voila, It's worked for me.Just updated the selenium-java dependency in pom.xml

<!--  Selenium java-jar dependency -->

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

Or here is the link to get the updated version- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java

Comments

2

Run mvn dependency:tree in your project, and check what is transitively depending on selenium-remote-driver.

In my project, I was correctly depending on selenium-java at 2.53.1, but another test dependency was depending on an older version (2.40.0); that meant my tests were using the 2.40.0 version of selenium-remote-driver at runtime, which causes the java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException error.

If you have transitive dependencies on selenium-remote-driver, you have two options for "fixing" them:

  1. Update the artifact that's depending on the older version to either
    • Not depend on the artifact at all, or
    • Use the latest version.
  2. Add an entry in your pom.xml's <dependencyManagement> section for selenium-java to peg the artifact at version 2.53.1.

    This will affect the version of selenium-java both in your project and all your nested maven dependencies, too; be aware that those nested artifacts may not work well with the latest version!

It's also worth mentioning that selenium-java version 2.53.0 had a Firefox incompatibility problem; version 2.53.1 allegedly fixes that. See http://seleniumsimplified.com/2016/06/use_selenium_webdriver_jar_locally/ for more details.

Hope this helps :)

Comments

1

This happened with me while trying to update to remote driver to 3.0.1 from 2.53.1. I just reverted it back to 2.53.1 and it went away

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>2.53.1</version>
</dependency>

Comments

-1

I ran into this too. I changed to the following and it went away.

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-server</artifactId>
  <version>4.0.0-alpha-2</version>
</dependency>


    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>6.1.0</version>
        <scope>provided</scope>
    </dependency>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.