title: Maven test - java.lang.ClassNotFoundException: org.testng.AssertJUnit
body: <p>I'm trying this <a href="https://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html#3" rel="nofollow noreferrer">guide</a> to learn to integrate Maven, Jenkins and Selenium. The issue with guides is the erosion of time and serious compatibility issues. I've been trying to debug it as I go, but right now I'm at step 15 and can't go further due to this issue:</p>
  <blockquote>
  <p>T E S T S
  ------------------------------------------------------- Running example.NewTest Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time
  elapsed: 2.255 sec &lt;&lt;&lt; FAILURE!</p>
  <p>Results :</p>
  <p>Failed tests:   example.NewTest.testEasy(): org/testng/AssertJUnit</p>
  <p>Tests run: 1, Failures: 1, Errors: 0, Skipped: 0</p>
  <p>[INFO]
  ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
  ------------------------------------------------------------------------ [INFO] Total time: 9.145s [INFO] Finished at: Tue Sep 12 09:42:36 PDT
  2017 [INFO] Final Memory: 7M/17M [INFO]
  ------------------------------------------------------------------------ [ERROR] Failed to execute goal
  org.apache.maven.plugins:maven-surefire-plugin:2.12:test
  (default-test) on project WDTest: There are test failures. [ERROR]
  [ERROR] Please refer to
  C:\ST\kpimuiws-build-changes\WDTest\target\surefire-reports for the
  individual test results.</p>
  </blockquote>
  <p>The surefire reports textfile shows:</p>
  <blockquote>
  <p>Test set: example.NewTest</p>
  <p>Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.255 sec &lt;&lt;&lt; FAILURE! example.NewTest.testEasy()  Time elapsed: 2.25 sec</p>
  <p>&lt;&lt;&lt; FAILURE! java.lang.NoClassDefFoundError: org/testng/AssertJUnit
  at example.NewTest.testEasy(NewTest.java:34) Caused by:
  java.lang.ClassNotFoundException: org.testng.AssertJUnit<br />
  at java.net.URLClassLoader.findClass(Unknown Source)  at
  java.lang.ClassLoader.loadClass(Unknown Source)   at
  sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)    at
  java.lang.ClassLoader.loadClass(Unknown Source)   ... 19 more</p>
  </blockquote>
  <p>Here is my pom;</p>
  <pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;WDTest&lt;/groupId&gt;
    &lt;artifactId&gt;WDTest&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.12&lt;/version&gt;
              &lt;inherited&gt;true&lt;/inherited&gt;
              &lt;configuration&gt;
                  &lt;suiteXmlFile&gt;testng.xml&lt;/suiteXmlFile&gt;
                  
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;            
          &lt;dependency&gt;                
               &lt;groupId&gt;junit&lt;/groupId&gt;                               
               &lt;artifactId&gt;junit&lt;/artifactId&gt;                             
               &lt;version&gt;3.8.1&lt;/version&gt;                               
               &lt;scope&gt;compile&lt;/scope&gt;                             
          &lt;/dependency&gt;               
          &lt;dependency&gt;                
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;                              
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;                              
              &lt;version&gt;2.45.0&lt;/version&gt;                               
          &lt;/dependency&gt;       
                  
  &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  <p>and here is my NewTest.java</p>
  <pre><code>package example;        
  
  import java.io.File;
  
  import org.testng.annotations.Test;
  //import org.testng.Assert;
  import org.testng.AssertJUnit;
  //import org.openqa.selenium.By;        
  import org.openqa.selenium.WebDriver;       
  import org.openqa.selenium.firefox.FirefoxBinary;
  import org.openqa.selenium.firefox.FirefoxDriver;       
  import org.openqa.selenium.firefox.FirefoxProfile;
  //import org.testng.annotations.Test;   
  import org.testng.annotations.BeforeTest;   
  import org.testng.annotations.AfterTest;        
  
  
  
  
  
  
  public class NewTest {      
          //private WebDriver driver;     
          
          File pathBinary = new File(&quot;C:\\Users\\T667627\\AppData\\Local\\MozillaFirefox\\firefox.exe&quot;);
          FirefoxBinary firefoxBinary = new FirefoxBinary(pathBinary);
          FirefoxProfile firefoxProfile = new FirefoxProfile();       
          WebDriver driver = new FirefoxDriver(firefoxBinary, firefoxProfile);
          
          @Test               
          public void testEasy() {    
              driver.get(&quot;http://demo.guru99.com/selenium/guru99home/&quot;);  
              String title = driver.getTitle();                
              AssertJUnit.assertTrue(title.contains(&quot;Demo Guru99 Page&quot;));         
          }   
          @BeforeTest
          public void beforeTest() {  
              driver = new FirefoxDriver();  
          }       
          @AfterTest
          public void afterTest() {
              driver.quit();          
          }       
  }   
  </code></pre>