我已经创建了一个自动化项目,使用appium flatter驱动程序测试flatter应用程序。但我不能用Flutter驱动器。
我的自动化项目没有将automationname检测为flatter。即使我尝试driver.context(“flutter”);我得到了nosuchcontextexception错误。
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();
DesiredCapabilities capabilities = new DesiredCapabilities();
File appDir = new File(System.getProperty("user.dir")+"/app");
File app = new File (appDir,"app-debug.apk");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability("automationName", "Flutter");
capabilities.setCapability("appPackage", "com.example.flutter_intellij_test");
capabilities.setCapability("appActivity","com.example.flutter_intellij_test.MainActivity");
driver = new AndroidDriver<MobileElement>(service.getUrl(), capabilities);
wait = new WebDriverWait(driver, 10);
find = new FlutterFinder(driver);
1条答案
按热度按时间fdbelqdn1#
确保您的appium服务器版本高于1.6
java客户机不应该有任何特定的功能,只要尝试以这种方式更改您的功能:
下一次发布应用程序服务器日志:)