java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
<p>I am trying to run a Java project using page factory and page object model, I want to run it on Chrome, IE and on Firefox, but I am not able to run it on Firefox, the browser is not opening, I am getting this error : <code>java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal</code></p>

<p>My Code is :</p>

<pre><code>@BeforeMethod
public static void openBrowser() {
    String browser = "";
    if (browser.equalsIgnoreCase("chrome")){
        System.setProperty("webdriver.chrome.driver", "src\\test\\Resources\\BrowserDrivers\\chromedriver.exe");
        driver = new ChromeDriver();
    }
    else if (browser.equalsIgnoreCase("ie")){
        System.setProperty("webdriver.ie.driver", "src\\test\\Resources\\BrowserDrivers\\IEDriverServer.exe");
        driver = new InternetExplorerDriver();
    }
    else {
        driver = new FirefoxDriver();
    }
    driver = new FirefoxDriver();
    driver.get("http://www.google.com/");
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
    driver.manage().window().maximize();
}

@AfterMethod
public  static void closeBrowser(){
    driver.quit();
}
</code></pre>