Затянул пример с офф странички (GitHub - selenide/selenide-appium: Selenide adaptor for Appium framework).
По образу и подобию переписал тест под своё приложение.
На этапе выполнения @BeforeEach SetUp(){…} приложение запускается и спустя секунду закрывается. в логе:
[ADB] Running 'C:\Java\Android\SDK\platform-tools\adb.exe -P 5037 -s 1015faf93b872302 shell am start -W -a android.intent.action.VIEW -d http\://localhost\:8080/ com.bitrix24.android'
[W3C (146104f8)] Encountered internal error running command: Error: Error attempting to start URI. Original error: Error: Starting: Intent { act=android.intent.action.VIEW dat=http://localhost:8080/... pkg=com.testApp.android launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } }
[W3C (146104f8)] Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=http://localhost:8080/... flg=0x10000000 pkg=com.testApp.android launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } }
[W3C (146104f8)] at ADB.startUri (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:72:11)
То есть до самого теста даже не доходит.
Переписал тест на голый Selenium. Всё запустилось. Отработало.
Capabilities:
public DesiredCapabilities getGalaxyS6() {
desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Galaxy S6");
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, 7.0);
desiredCapabilities.setCapability(MobileCapabilityType.UDID, "1015faf93b872302");
desiredCapabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "Appium");
desiredCapabilities.setCapability("unlockType", "pin");
desiredCapabilities.setCapability("unlockKey", "0000");
desiredCapabilities.setCapability("autoGrantPermissions", true);
desiredCapabilities.setCapability("appPackage", "com.testApp.android");
desiredCapabilities.setCapability("appActivity", ".MainActivity");
return desiredCapabilities;
}
AndroidDriverProvider:
public class AndroidDriverProvider implements WebDriverProvider {
public WebDriver createDriver(DesiredCapabilities capabilities) {
Configuration.startMaximized = false;
Configuration.browserSize = null;
Configuration.timeout = 10000;
// capabilities = new AndroidCaps().getBoost3();
capabilities = new AndroidCaps().getGalaxyS6();
// capabilities.merge(new AndroidCaps().getGalaxyS6());
try {
return new AndroidDriver(new URL("http://localhost:4723/wd/hub"),
capabilities);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
}
Остальное без изменений передрал с примера в источнике.
Логи и ошибка вот такая …
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.
Original error: Error attempting to start URI.
Original error: Error: Starting: Intent { act=android.intent.action.VIEW dat=http://localhost:8080/... pkg=com.testApp.android launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } }
Error: Activity not started, unable to resolve Intent
{ act=android.intent.action.VIEW dat=http://localhost:8080/... flg=0x10000000 pkg=com.testApp.android launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } }
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'AT, ip: '192.168.1.173', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_201'
Driver info: io.appium.java_client.android.AndroidDriver
selenide.url: http://localhost:8080/
Capabilities
{appActivity: .MainActivity, appPackage: com.testApp.android, autoGrantPermissions: true, automationName: Appium, databaseEnabled: false,
desired: {appActivity: .MainActivity, appPackage: com.testApp.android, autoGrantPermissions: true, automationName: Appium, deviceName: Galaxy S6, platformName: android, platformVersion: 7, udid: 1015faf93b872302, unlockKey: 0000, unlockType: pin},
deviceApiLevel: 24, deviceManufacturer: samsung, deviceModel: SM-G920F, deviceName: 1015faf93b872302, deviceScreenDensity: 640, deviceScreenSize: 1440x2560, deviceUDID: 1015faf93b872302, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 4, platform: LINUX, platformName: Android, platformVersion: 7.0, statBarHeight: 96, takesScreenshot: true, udid: 1015faf93b872302, unlockKey: 0000, unlockType: pin, viewportRect: {height: 2464, left: 0, top: 96, width: 1440}, warnings: {}, webStorageEnabled: false}
selenide.baseUrl: http://localhost:8080
Session ID: a4861c2c-5707-48ac-a661-f9c7995eec8f
Версии ОС и софта следующие
Windows 7 x64
Samsung Galaxy S6 Android 7.0
HighScreenBoost 3 se Android 6.0
AVD Pixel 2 Android 9.0
Java 8, 12
Может кто встречался с подобным поведением.
Подскажите в каком направлении копать.
Всем добра.