2016-02-02 2 views
1

Я хочу запустить в то же время на ПК-браузере и в мобильном телефоне.
Как я могу использовать selendroid и seleniumhq в то же pom.xml
я пытался в моем pom.xml определить зависимости, как этот
Как использовать selendroid и seleniumhq в том же pom.xml?

<dependency> 
     <groupId>org.seleniumhq.selenium</groupId> 
     <artifactId>selenium-java</artifactId> 
     <version>2.50.0</version> 
    </dependency> 

    <dependency> 
     <groupId>net.lightbody.bmp</groupId> 
     <artifactId>browsermob-core-littleproxy</artifactId> 
     <version>2.1.0-beta-4</version> 
    </dependency> 

    <dependency> 
     <groupId>io.selendroid</groupId> 
     <artifactId>selendroid-standalone</artifactId> 
     <version>0.17.0</version> 
    </dependency> 

    <dependency> 
     <groupId>io.selendroid</groupId> 
     <artifactId>selendroid-client</artifactId> 
     <version>0.17.0</version> 
    </dependency> 

Но я получил эти ошибки

java.lang.NullPointerException: null 
at catchmedia.objects.DriverObject.setUp(DriverObject.java:198) 
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:497) 
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86) 
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142) 
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178) 
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) 
at org.testng.TestRunner.privateRun(TestRunner.java:782) 
at org.testng.TestRunner.run(TestRunner.java:632) 
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) 
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39) 
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:400) 
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:745) 

java.lang.NoClassDefFoundError: org/apache/commons/exec/DaemonExecutor 
at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:52) 
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38) 
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:161) 
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78) 
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644) 
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) 
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) 
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144) 
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170) 
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138) 
at catchmedia.objects.DriverObject.setUp(DriverObject.java:85) 
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:497) 
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86) 
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142) 
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178) 
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) 
at org.testng.TestRunner.privateRun(TestRunner.java:782) 
at org.testng.TestRunner.run(TestRunner.java:632) 
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) 
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39) 
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:400) 
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:745) 

Но когда просто используя зависимость seleniumhq и запуская только браузер, все в порядке.
Спасибо за помощь!

ответ

0

попробуйте добавить:

<dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>commons-exec</artifactId> 
     <version>1.3</version> 
    </dependency> 
Смежные вопросы