在Mac中配置了appium和eclipse。
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
运行硒显示异常错误为:
org.openqa.selenium.WebDriverException:处理命令时发生未知服务器端错误。原始错误:命令'java -version'退出,代码为2
在appium服务器中显示为:
[W3C]遇到内部错误运行命令:错误:命令'java -version'退出,代码为2
代码如下:
DesiredCapabilities capabilities = new DesiredCapabilities();
String apkpath="apk/path";
File app=new File(apkpath);
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("deviceName","G2AXB711Y044HV6");
capabilities.setCapability(CapabilityType.VERSION, "6.0.1");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("appPackage", "com.ABC");
capabilities.setCapability("appActivity", "com.ABC.Activity");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);`enter code here`
[W3C],位于ChildProcess.proc.on.code上
(/Applications/Appium.app/Contents/Resources/app/node_modules/teen_process/lib/exec.js:94:19)[W3C]位于ChildProcess.emit(events.js:182:13)
[W3C]位于也许关闭(internal / child_process.js:961:16)
[W3C]位于Socket.stream.socket.on(internal / child_process.js:380:11)
[W3C]位于Socket.emit(events.js:182:13)
[W3C]位于Pipe._handle.close [作为_onclose](net.js:596:12)
请提出任何解决方案?