1 year ago

#232728

test-img

ma5039

How to identify and click on a html element using flutter driver?

My flutter app has a html link

   return Padding(
        padding: const EdgeInsets.all(16.0),
        child: Center(
            child: Html(
          data: message,
          style: {"body": Style(color: Colors.white), "a": Style(color: Colors.tealAccent), "p": Style(textAlign: TextAlign.center)},
          onLinkTap: (url, _, __, ___) async {
            isSettingsMessage ? await AppSettings.openDeviceSettings() : await AppSettings.openAppSettings();
          }, 
              key: Key('deviceSettings'),
        )));

here is the html message

static String enableBluetoothAndLocationMessage =
      """<p>Enable Bluetooth and Location in <a href=''>device settings</a> to continue.</p>""";

I want to click on "device settings". I have tried using key

final settings=find.byValueKey('deviceSettings');

It is returning "Enable Bluetooth and Location in device settings to continue."

How to identify only "device settings" link?

flutterdriver

0 Answers

Your Answer

Accepted video resources