POM: noclassdeffounderror: org/junit/assert | Selenium Forum
M
Posted on 09/12/2015
i am facing NoClassdefFounderror: org/junit/assert issue while executing below scenario.

Framework: Cucumber- Maven-using java language

Scenario: 1. open browser
2. enter invalid username and correct password and click on submit button.
3. Compare error message displayed.
4. Assert.assertequals(expectedmsg,actual message)

1. When i am running the feature through runner.java file in eclipse its working as expected and results its showing in console as 1 scenario passes. without any NoClassdefFounderror: org/junit/assert error.

2. When I execute through pom.xml file in command promt so its opening browser ,performing all the steps as expected but in the last step of comparison using Assert.assertequals(expectedmsg,actual message), its through error only through command prompt as NoClassdefFounderror: org/junit/assert. While its working fine through runner.class.

For your details, I am using maven dependencyeclipse- junit version-4.12. Its downloaded in m2.repo correctly and its pointing also correctly to 4.12 junit version.. But still not able to find the root cause of this issue.

[attachment=0:7vc5i177]junit assert error.docx[/attachment:7vc5i177]

M
Replied on 09/12/2015

First

Check your Project Properties->Java Build Path->Libraries (tab). JUnit should be there although this usually will show up in the build.

Check you Project's Run Configurations->JUnit->Classpath (tab). JUnit should be under User Entries for your project.

Second

use org.junit 3.8