How to Use Katalon for Flutter App Testing? Prerequisites & Best Practices

Hi Everyone,

I’m currently working on automating a Flutter mobile application and would like to understand how Katalon Studio can be effectively used for Flutter app testing.

I would appreciate guidance on the following:

  1. What is the recommended approach to automate Flutter apps using Katalon?

    • Is it better to rely on UiAutomator2 (Android) and XCUITest (iOS)?

    • Are there any limitations when testing Flutter-specific widgets?

  2. What are the key prerequisites for achieving stable and reliable automation?

    • Should we expose resource-id (Android) and accessibility identifiers (iOS) explicitly in Flutter?

    • Is using Semantics with unique identifiers the recommended approach?

    • Any specific Flutter configurations needed ?

2 Likes

Click on the below link , there are some posts related to it. go through them and you might get started

https://forum.katalon.com/tag/flutter/141

2 Likes

Thank you so much

Hi Anandhu,

Plz Check this
https://forum.katalon.com/tag/flutter/141

1 Like

‘Below are the suggestion of working with automating flutter mobile app. Hope it coveres most of the queries

Flutter automation is a bit different compared to native Android/iOS apps, and since you’re already working in automation (Katalon, Selenium, etc.), I’ll give you a practical, implementation-focused answer.


Recommended Approach to Automate Flutter Apps Using Katalon

Katalon Studio uses Appium underneath for mobile automation.

Flutter apps do NOT expose native UI elements directly like standard Android (View-based) or iOS (UIKit) apps.

So below can be the best approach

Recommended Strategy for Automating Flutter Apps with Katalon

First: Understand the Core Reality

Flutter apps:

  • Render UI via Skia (not native Android Views / iOS UIKit)

  • Appear as a single native container to UiAutomator2 / XCUITest

  • Require instrumentation for stable automation

So your success depends on:

:red_exclamation_mark: How much control you have over the Flutter codebase.


The Best Overall Strategy

Use Dual Driver Strategy (Most Practical Enterprise Approach)

Purpose Driver
Flutter widget interaction Appium Flutter Driver
Native dialogs / OS popups UiAutomator2 / XCUITest

When to Use What?

Use appium-flutter-driver when:

  • You need stable widget-level interaction

  • Flutter widgets are not visible in native hierarchy

  • XPath is unreliable

  • UI changes frequently

  • You want direct widget tree access

This is the MOST powerful approach for pure Flutter apps.


Use UiAutomator2 / XCUITest when:

  • Handling:

    • Permission dialogs

    • Notifications

    • System popups

    • Biometric prompts

    • Hybrid/native screens

  • Flutter driver is not installable in your environment


Now Let’s Address Each of Your Questions Clearly


What Is the Recommended Approach?

BEST:

Use appium-flutter-driver + Katalon custom keywords

Because:

  • You can directly access Flutter widget tree

  • No dependency on native accessibility hierarchy

  • More stable for Flutter-heavy apps

BUT…

:warning: Katalon does NOT natively support Flutter driver commands.

So you must:

  • Install flutter driver in Appium

  • Create custom Groovy keywords

  • Use driver.executeScript("flutter:...")

If your team is mature → go this route.

If not → fallback to accessibility approach.


Is It Better to Rely on UiAutomator2 & XCUITest?

Answer: ONLY if app is properly instrumented.

If developers expose:

  • Semantics labels

  • Unique Keys

  • Accessibility identifiers

Then yes — UiAutomator2/XCUITest works fine.

If not → they will see:

android.view.View
XCUIElementTypeOther

And your automation becomes fragile.


Are There Limitations with Flutter Widgets?

Yes.

Without Flutter driver:

  • Custom widgets invisible

  • Limited element tree

  • XPath unreliable

  • No resource-id by default

  • Text-based locators unstable

With Flutter driver:

  • Can access:

    • ByValueKey

    • ByText

    • ByType

    • Descendant matchers

  • Much more stable

So Flutter driver removes most widget limitations.


Key Prerequisites for Stable Automation

This is where BOTH suggestions align strongly.

MUST HAVE:

Unique Identifiers in Code

Example:

ElevatedButton(
  key: ValueKey('btn_login'),
)

OR

Semantics(
  label: 'btn_login',
  child: ElevatedButton(...)
)

Stable Naming Convention

Never use:

LoginButton1
LoginButtonFinal
LoginButtonNew

Use:

btn_login
txt_username
lbl_error_invalid_login

Testable Build Variant

Developers must:

  • Keep semantics enabled

  • Avoid stripping identifiers in release

  • Avoid obfuscating labels


Explicit Waits

Flutter has animations & async rendering.

In Katalon:

Mobile.waitForElementPresent()

Avoid:

delay(5)

Should We Expose resource-id and accessibilityIdentifier?

YES. Absolutely.

Even if using Flutter driver.

Because:

  • Native driver needs them

  • Accessibility testing needs them

  • Screen readers need them

  • Hybrid screens need them

In Flutter, this is done using:

  • Semantics

  • ValueKey

  • Custom testId mapping

This is non-negotiable for stable automation.


Is Using Semantics with Unique Identifiers Recommended?

YES — It is the industry best practice.

Semantics is the bridge between:

Flutter Widget Tree

:down_arrow:

Native Accessibility Tree

:down_arrow:

Appium

:down_arrow:

Katalon

Without semantics → automation pain.


Specific Flutter Configurations Needed?

Yes:

Developers should:

  • Add Semantics to important widgets

  • Add ValueKey to interactive components

  • Ensure semantics are NOT excluded

  • Avoid excludeSemantics: true

  • Avoid custom RenderObjects without semantics

  • Preserve semantics in test build


Now The Most Important Decision for YOU

Since you:

  • Work in enterprise automation

  • Use Katalon heavily

  • Want stable CI/CD

  • Probably don’t want heavy driver hacks

I Recommend This Practical Architecture:

OPTION A (Advanced / Best Control)

Flutter App
   ↓
ValueKey + Semantics
   ↓
Appium Flutter Driver
   ↓
Custom Katalon Keywords
   ↓
CI/CD

Best for:

  • Dedicated automation team

  • Long-term framework investment


OPTION B (Simpler / Lower Setup Overhead)

Flutter App
   ↓
Semantics + accessibilityIdentifier
   ↓
UiAutomator2 / XCUITest
   ↓
Katalon Mobile Keywords

Best for:

  • Teams new to Flutter

  • Minimal framework change

  • Faster implementation


Final Verdict

Question Final Answer
Recommended approach? Dual strategy (Flutter driver + Native driver)
Should we rely only on UiAutomator2? :cross_mark: No, unless app is well instrumented
Are Flutter widgets limited? Yes without Flutter driver
Must expose IDs? :white_check_mark: Absolutely
Use Semantics? :white_check_mark: Strongly recommended
Flutter config needed? Yes – preserve semantics & keys
Most stable solution? Flutter driver + unique ValueKey

My Honest Professional Advice

If you are starting fresh:

→ Implement ValueKey everywhere

→ Use Semantics labels

→ Install appium-flutter-driver

→ Create reusable Katalon custom keywords

That gives you long-term stability.

If this is an already built app and devs resist changes:

→ Use accessibility + UiAutomator2

→ Accept some limitations

1 Like