@slipy12 from console if I do the following it does start appium ( see
screenshot ) but I want to start it from within my test . How do i do that
?
I modified my test like this :
Runtime.getRuntime().exec("/bin/bash ");
// CommandLine command = new CommandLine("/bin/sh ");
//
command.addArgument("/Applications/Appium.app/Contents/Resources/node/bin/node");
CommandLine command = new CommandLine(
"/Applications/Appium.app/Contents/Resources/node/bin");
//
command.addArgument("/Applications/Appium.app/Contents/Resources/node_modules/
appium/build/lib/main.js");
command.addArgument("appium");
command.addArgument("--address");
command.addArgument("0.0.0.0");
command.addArgument("--port");
command.addArgument("4723");
command.addArgument("--no-reset", false);
command.addArgument("--log-level");
command.addArgument("info");
DefaultExecuteResultHandler resultHandler = new
DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
executor.execute(command, resultHandler);
String appPath =
"/Users/khyati.dave/src/workspace/MobileTestAutomation/MoPubSampleApp.ipa";
File app = new File(appPath);
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("platformName", "iOS");
desiredCapabilities.setCapability("platformVersion", "9.3");
desiredCapabilities.setCapability("deviceName", "iPhone 6");
desiredCapabilities.setCapability("app", app.getAbsolutePath());
driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"),
desiredCapabilities);
}
But it gives the error :
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a
new session. Possible causes are invalid address of the remote server or
browser start-up failure.