Hi guys,
I meet one problem when I try using AppiumDriverLocalSerivce .start() to launch app server, code like below.
public class StartAppium {
private IOSDriver<MobileElement> iosDriver;
private AppiumDriverLocalService service;
@BeforeClass
public void setUp() throws Exception {
service = AppiumDriverLocalService
.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File("/usr/local/bin/node"))
.withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))
.withIPAddress("127.0.0.1").usingPort(4723));
service.start();
}
@Test
public void getAppiumStatus() {
}
@AfterClass
public void tearDown() {
// iosDriver.quit();
// service.stop();
}
}
however, I got same errors like below, Appium I was using latest one v1.6.5, but strangely it works fine when I use terminal command “node /usr/local/lib/node_modules/appium/build/lib/main.js”
Exception in thread “main” io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException: The local appium server has not been started. The given Node.js executable: /usr/local/Cellar/node/8.1.4/bin/node Arguments: [/usr/local/lib/node_modules/appium/build/lib/main.js, --port, 57565, --address, 127.0.0.1, --log-level, info, --bootstrap-port, 57567, --suppress-adb-kill-server, --selendroid-port, 57568]
at io.appium.java_client.service.local.AppiumDriverLocalService.start(AppiumDriverLocalService.java:149)
at appium.Manager.DeviceConfigurationImpl.main(DeviceConfigurationImpl.java:45)
Caused by: java.lang.IllegalAccessError: tried to access method com.google.common.util.concurrent.SimpleTimeLimiter.(Ljava/util/concurrent/ExecutorService;)V from class org.openqa.selenium.net.UrlChecker
at org.openqa.selenium.net.UrlChecker.(UrlChecker.java:67)
at io.appium.java_client.service.local.AppiumDriverLocalService.ping(AppiumDriverLocalService.java:113)
at io.appium.java_client.service.local.AppiumDriverLocalService.start(AppiumDriverLocalService.java:136)
… 1 more