2016-04-04 15 views
2

Bir Appium Android Testiyle çalışıyorum. Testim ile ilgili hiçbir sorunum olmadı ve iyi çalışıyordu. Birkaç hafta sonra, (herhangi bir değişiklik olmadan) yeniden çalıştırmayı denedi ve şimdi aşağıdaki hatayı alıyorum: Ayrıca burada Kur'ınjava.lang.NoSuchFieldError: Appium Android Testini Çalıştırırken INSTANCE İstisnası

<dependency> 
     <groupId>org.seleniumhq.selenium</groupId> 
     <artifactId>selenium-server</artifactId> 
     <version>2.48.2</version> 
    </dependency> 

    <dependency> 
     <groupId>nu.pattern</groupId> 
     <artifactId>opencv</artifactId> 
     <version>2.4.9-7</version> 
    </dependency> 

    <dependency> 
     <groupId>io.appium</groupId> 
     <artifactId>java-client</artifactId> 
     <version>2.1.0</version> 
    </dependency> 

:

java.lang.ExceptionInInitializerError 
at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:71) 
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:57) 
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:60) 
at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:251) 
at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.<init>(ApacheHttpClient.java:228) 
at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:96) 
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:70) 
at io.appium.java_client.remote.AppiumCommandExecutor.<init>(AppiumCommandExecutor.java:36) 
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:167) 
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:69) 
at QA.Test.setUp(Test.java:52) 
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) 
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) 
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) 
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) 
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) 
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) 
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) 
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
at org.junit.runner.JUnitCore.run(JUnitCore.java:137) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) 
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) 
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) 
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:144) 
Caused by: java.lang.RuntimeException: Stub! 
at org.apache.http.conn.ssl.AbstractVerifier.<init>(AbstractVerifier.java:5) 
at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<init>(AllowAllHostnameVerifier.java:5) 
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:124) 
... 39 more 

Güncel pom.xml dosyası bağımlılıkları

bir kez daha
DesiredCapabilities capabilities = new DesiredCapabilities(); 
capabilities.setCapability("appium-version", "1.4.13"); 
capabilities.setCapability("platformName", "Android"); 
capabilities.setCapability("deviceName", "Android Emulator"); 
capabilities.setCapability("platformVersion", "4.3"); 
capabilities.setCapability("appPackage", "<app_package>"); 
capabilities.setCapability("appActivity", "<app_activity>"); 
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); 

(I get the error in the last line while debugging)

: bu hatayı yoktu ve ben değil hiçbir şeyi değiştiremezsin.

Düzenleme: Ben 'java-client' ya geçirdiniz ve sonra aşağıdaki özel aldı:

java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing 

Sonra projeme hamcrest çekirdekli kavanoz dosyası ekledik. Şimdi aşağıdaki özel durum alıyorum:

java.lang.NoSuchFieldError: INSTANCE 

at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144) 
at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:71) 
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:57) 
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:60) 
at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:251) 
at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.<init>(ApacheHttpClient.java:228) 
at io.appium.java_client.remote.AppiumCommandExecutor.<init>(AppiumCommandExecutor.java:50) 
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:77) 
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:67) 
at QA.Test.setUp(Test.java:55) 
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) 
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) 
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) 
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) 
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) 
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) 
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) 
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
at org.junit.runner.JUnitCore.run(JUnitCore.java:137) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) 
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) 
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) 
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:144) 

java.lang.NullPointerException 
at QA.Test.tearDown(Test.java:200) 
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) 
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) 
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) 
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) 
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) 
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) 
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) 
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
at org.junit.runner.JUnitCore.run(JUnitCore.java:137) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) 
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) 
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) 
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:144) 

şimdiden teşekkürler Bu http isteği neden olduğu bir bağımlılık sorunu

+0

Mesaj gövdesinde mesaj başlığı ve istisna olarak kullanılan istisna tamamen farklı ??? –

+0

Oh, çok üzgünüm, yanlışlıkla başka bir hata yapıştırdım. Uyarı için teşekkürler. –

+0

, appium yükseltilmiş olabilir, appium sürümü kapabiltiy'i kaldırmayı deneyin ve – karthick23

cevap

2

,

İki nedenleri olabilir ur atıfta birden fazlahttp -jar, ur sınıf yolunda - ve sadece bir

ya da http req- add http çekirdek kavanozu gerçekleştirmek için bir http kavanozu yok,

<dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-core</artifactId> 
    <version>3.6.3.Final</version> 
</dependency> 
+0

Yardımlarınız için teşekkür ederiz. Şuan çalışıyor. Ama şimdi daha yavaş, sanırım, ayrıntılarını kontrol edeceğim. Tekrar teşekkürler! –

+0

, yardım ederse soruyu yanıtlamaktan çekinmeyin. Teşekkürler – karthick23

+0

Zaten yedekledim. Sadece kamuya açık görünemiyorum çünkü bu benim itibarım henüz yeterli değil. Tekrar teşekkürler. –

1

ben java-istemci geçiş yaptıysanız ve daha sonra yine aynı sorunu vardı pom.xml updated ama kavanoz kütüphanesine http-istemci ve http-çekirdek ekledi. Ve şimdi çalışıyor. Teşekkür ederiz @ karthick23

İlgili konular