0
IntelliJでNoClassDefFoundErrorが表示されていますが、ソースフォルダを正しく設定したと思います。 Selenium(バージョン3.5.3)のリファレンスを削除すると、コードが動作します。IntelliJでSeleniumを追加するとNoClassDefFoundErrorが作成されます
これは、私は互換性のないライブラリをダウンロードしていた
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class NavigateToAUrl {
public static void main(String[] args){
System.out.println("test2");
// WebDriver driver = new FirefoxDriver();
}
}
が、これがないではない
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class NavigateToAUrl {
public static void main(String[] args){
System.out.println("test2");
WebDriver driver = new FirefoxDriver();
}
}
ほとんどの場合、プロジェクトに必要な依存性がいくつか欠けています。https://www.jetbrains.com/help/idea/working-with-module-dependencies.htmlを参照してください。 – CrazyCoder