appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
470 stars 183 forks source link

{"value":{"error":"unknown method","message":"Method has not yet been implemented","stacktrace":"NotYetImplementedError: Method has not yet been implemented\n at FlutterDriver.executeCommand #742

Closed ChandanMySelenium closed 1 month ago

ChandanMySelenium commented 1 month ago

code:

public static AppiumDriver driver; public static FlutterFinder finder; public static void main(String[] args) { try { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("appium:deviceName", "ZF6223VKHF"); capabilities.setCapability("appium:app", "C:\Users\ChandanM\StudioProjects\alink\build\app\outputs\flutter-apk\app-debug.apk"); capabilities.setCapability("appium:automationName", "Flutter"); capabilities.setCapability("appium:appPackage", "com.afs.alink"); capabilities.setCapability("appium:appActivity", "com.afs.alink.MainActivity");

driver = new AndroidDriver(new URL("http://0.0.0.0:4723/"), capabilities);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20));
System.out.println("app is launched");
finder = new FlutterFinder(driver);

FlutterElement tbEmail = finder.byValueKey("emailField");
FlutterElement tbPassword = finder.byValueKey("passwordField");
WebElement btnLogin = finder.byDescendant(finder.byType("ElevatedButton"), finder.byText("Login"), false, false);

tbEmail.sendKeys("xxxxx.com");
tbPassword.sendKeys("xxxxxx**");
System.out.println(tbEmail.getText());

PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Sequence longPress = new Sequence(finger, 0);
longPress.addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.fromElement(btnLogin), 0, 0));
longPress.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()));
longPress.addAction(finger.createPointerMove(Duration.ofSeconds(3), PointerInput.Origin.fromElement(btnLogin), 0, 0));
longPress.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
driver.perform(Arrays.asList(longPress));

i am trying to perform long press on flutter element but, i am getting error message":"Method has not yet been implemented","stacktrace":"NotYetImplementedError: serverlog image:- NotYetImplementedError

KazuCocoa commented 1 month ago

What about flutter:longTap command? https://github.com/appium/appium-flutter-driver

ChandanMySelenium commented 1 month ago

yes, figured it out after some time. Thank you for your replay. is there any function to achieve drag and drop.

KazuCocoa commented 1 month ago

I think no to drag and drop. What I could share is NATIVE_APP context may help, but FLUTTER context may not. https://github.com/appium/appium-flutter-driver/issues/332