2016-10-12 2 views
2

Java Selenium Firefox geckodriver를 사용할 때 문제가 있습니다.Mozilla의 GeckoDriver에서 Selenium을 사용할 때 CircularOutputStream 클래스를 찾을 수 없습니다.

* OS : 윈도우 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, Selenium 2.52.0을 사용하는 또 다른 자동화 프로젝트를 가지고 있기 때문에 .. 그러나 이것이 문제를 일으키는 지 확실하지 않습니다. 나는 이번에 maven을 사용하지 않는다. 자바 GUI 프로그램 (툴킷)을 만들려고 노력하십시오.

답변

1

classpath의 jar 파일이 누락되어 예외가 발생했습니다.

Maven을 사용하지 않는 경우 Compile Dependencies at MVN Repository page을 확인하고 수동으로 클래스 경로에 병을 추가하십시오.

당신은 메이븐을 사용하는 경우, 참조 : 도움을 java.lang.classnotfoundexception: org.openqa.selenium.io.Circular OutputStream

+0

안녕 Ravthiru, 감사합니다. 항아리가 무엇인지 분명히 설명해주십시오. IDE에서 힌트를 찾지 못했기 때문입니다. –

+0

이 위치의 컴파일 종속성을 확인하십시오. https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server/3.0.0-beta4 – ravthiru

+0

고맙습니다. 문제 해결됨. –

관련 문제