Всем привет. Пытаюсь подружить Idea и апиум сервер 1.6.3, но пока безрезультатно. Раньше пользовался Appium GUI и настраивалось легко. Сейчас нужно запускать апиум сервер через маковский терминал и в коде указывать параметры. Если я правильно понял, то после запуска апиум сервера и потом запуска Идеи идея пишет, что не может подключиться и указывает на:
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Что можете сказать? Помогите, пожалуйста
Смотрел доклад Dan Cuellar про Appium 1.6 и он писал про эти параметры, но у меня почему то не работает
java client 4.1.2
selenium server 3.3.0
private static AndroidDriver<MobileElement> driver;
public static void main(String[] args) throws MalformedURLException {
File app = new File("/Users/anatoliym/onedrive/builds/myapp.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
сapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "MEIZU MX5");
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,"uiautomator2");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.1");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.my.app”); capabilities.setCapability("appActivity", ".HomeScreenActivity");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
[Appium] Welcome to Appium v1.6.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/anatoliym/onedrive/builds/PressReaderUI-main_hc-5.2.17.0307.apk","appPackage":"com.newspaperdirect.pressreader.android.hc","appActivity":".HomeScreenActivity","platformVersion":"5.1","automationName":"uiautomator2","platformName":"Android","deviceName":"MEIZU MX5"},"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"app":"/Users/anatoliym/onedrive/builds/myapp.apk","appPackage":"com.my.app","appActivity":".HomeScreenActivity","platformVersion":"5.1","automationName":"uiautomator2","platformName":"Android","deviceName":"MEIZU MX5"},"requiredCapabilities":{}},"alwaysMatch":{"app":"/Users/anatoliym/onedrive/builds/myapp.apk","appPackage":"com.my.app","appActivity":".HomeScreenActivity","platformVersion":"5.1","automationName":"uiautomator2","platformName":"Android","deviceName":"MEIZU MX5"},"firstMatch":[]}
[debug] [MJSONWP] **Bad parameters: BadParametersError: Parameters were incorrect.** We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","capabilities","sessionId","id"]} and you sent ["desiredCapabilities","requiredCapabilities","capabilities","alwaysMatch","firstMatch"]
[HTTP] <-- POST /wd/hub/session 400 10 ms - 243
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=/Users/anatoliym/onedrive/builds/myapp.apk, appPackage=com.my.app, appActivity=.HomeScreenActivity, platformVersion=5.1, automationName=uiautomator2, platformName=Android, deviceName=MEIZU MX5}], required capabilities = Capabilities [{}]
Build info: version: '3.3.0', revision: 'b526bd5', time: '2017-03-07 11:21:31 -0800'
System info: host: 'Azy-mac-mini.local', ip: 'fe80:0:0:0:426c:8fff:fe27:e246%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_91'
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:114)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:132)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:92)
at androidTestNewApium.main(androidTestNewApium.java:40)
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:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Process finished with exit code 1