Appium Flutter Finder Java
Flutter appium driver is automation tool with java implementation.
maven-plugin
Setup
Add maven dependency to pom.xml
<dependency>
<groupId>io.github.ashwithpoojary98</groupId>
<artifactId>appium_flutterfinder_java</artifactId>
<version>1.0.3</version>
</dependency>
Maven Center Repo link
https://mvnrepository.com/artifact/io.github.ashwithpoojary98/appium_flutterfinder_java
Usage
import io.appium.java_client.AppiumDriver;
public class FlutterFinderExampleTest {
RemoteWebDriver driver;
@BeforeMethod
public void openApp() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "emulator-5554");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("noReset", true);
capabilities.setCapability("app", "");
capabilities.setCapability("automationName", "Flutter");
driver = new AppiumDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));
}
@Test
public void appiumFlutterTest() {
FlutterFinder finder = new FlutterFinder(driver);
WebElement element = finder.byValueKey("increment");
element.click();
}
@AfterMethod
public void tearDown() {
if (driver != null) {
driver.quit();
}
}
}
Automation setup
https://dev.to/ashwithpoojary98/automating-flutter-app-using-flutter-appium-driver-1cmb
list of finder
- byValueKey(String key)
- byValueKey(int key)
- byToolTip(String toolTipText)
- byType(String type)
- byText(String input)
- byAncestor(FlutterElement of, FlutterElement matching, boolean matchRoot, boolean firstMatchOnly)
- byDescendant(FlutterElement of, FlutterElement matching, boolean matchRoot, boolean firstMatchOnly)
- bySemanticsLabel(String label)
- bySemanticsLabel(Pattern label)
Flutter Common Finders
https://api.flutter.dev/flutter/flutter_test/CommonFinders-class.html
More about flutter finder
https://github.com/appium-userland/appium-flutter-driver
License
appium_flutterfinder_java is released under
Copyright (c) 2023 appium_flutterfinder_java