Java Selenium Firefox geckodriverを使用すると問題が発生します。MozillaのGeckoDriverでSeleniumを使用しているときCircularOutputStreamクラスが見つかりません
* OS:Windows 7の
*セレンバージョン:セレン3.0.0 beta4
*ジャワ:8
* Geckodriver:ここに問題があるv0.10.0
Error msg: Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/remote/internal/CircularOutputStream at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:56) at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:52) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:92) at tools.Cadencie.LoginCad(Cadencie.java:24) at tools.Cadencie.main(Cadencie.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.internal.CircularOutputStream at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 10 more
コード:
public class Cadencie {
static WebDriver driver;
public void LoginCad(){
//System.setProperty("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
System.setProperty("webdriver.gecko.driver", "C:\\Program Files (x86)\\Mozilla Firefox\\geckodriver.exe");
driver = new FirefoxDriver();
driver.get("http://172.16.1.133:8090/CADENCIE/servlet/app");
try {
Thread.sleep(1000);
} catch(InterruptedException e){
e.printStackTrace();
}
Utilities.switchToWindow("Cadencie - User Logon [LOGON]", driver);
try{
Thread.sleep(2000);
} catch(InterruptedException e){
e.printStackTrace();
}
driver.findElement(By.id("idBANK")).clear();
driver.findElement(By.id("idBANK")).sendKeys("48");
driver.findElement(By.id("idEMPLOYEE")).clear();
driver.findElement(By.id("idEMPLOYEE")).sendKeys("200003");
driver.findElement(By.id("idPASSWORD")).clear();
driver.findElement(By.id("idPASSWORD")).sendKeys("Cadencie1");
driver.findElement(By.id("maintLOGON")).click();
driver.findElement(By.id("idPASSWORD")).clear();
driver.findElement(By.id("idPASSWORD")).sendKeys("Cadencie1");
driver.findElement(By.id("maint")).click();
}
私はそれが矛盾したバージョンの問題かもしれないと思う。私はmavenを使用している別の自動化プロジェクトを持っているので、セレン2.52.0 ..しかし、これが問題を引き起こしたかどうかは分かりません。今回はmavenを使用していません。 JAVA GUIプログラム(ツールキット)を作成してみてください。
こんにちはRavthiru、助けをありがとう。どんな瓶が紛失しているのかを明確にしてください。 IDEからヒントが見つかりませんでした。 –
この場所のコンパイルの依存関係を確認してください。https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server/3.0.0-beta4 – ravthiru
ありがとう、ありがとうございます。問題が解決しました。 –