После обновления Appium до более новой версии Appium 1.22.3 я получаю ошибку статуса 404 при попытке запустить Appium программно.
Раньше в старой версии все работало нормально, но теперь Я не совсем понимаю, почему получаю эту ошибку.
public void globalSetup(ITestContext context) throws Exception {
// Load Props
loadProperties("appiumTests.properties");
// Load Secrets, Create the file
loadSecrets(System.getProperty("user.home") + "/automationSecrets.properties");
// Get Suite name
prop.setProperty("SuiteName", context.getName());
if (getRestartDeviceProperty().equals("true")) {
DeviceInteractions.rebootDevice(getPlatformData(), getDeviceUdidData(getDeviceNameData()));
}
logger.info("Building Appium Server...");
AppiumServiceBuilder builder = new AppiumServiceBuilder()
.withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))
.withArgument(GeneralServerFlag.LOG_LEVEL, "info").withArgument(GeneralServerFlag.RELAXED_SECURITY)
.withLogFile(new File(System.getProperty("user.dir") + "/logs/appium.log")).usingAnyFreePort();
service = builder.build();
logger.info("The url is" +service);
logger.info("Appium server is built.");
logger.info("Starting appium server...");
service.start();
logger.info("Appium server started.");
cleanFileContent("report.txt");
// Clean TestID file
prop.setProperty(testRailRunIDProp, "");
}
public URL getServiceUrl() {
return service.getUrl();
}
А в настройке я вызываю драйвер вот так.
driver = new AndroidDriver(getServiceUrl(), capabilities);
Подробнее здесь: https://stackoverflow.com/questions/785 ... mmatically