我们如何将选择器/id 添加到 Flutter 小部件以便它们可以从 Appium 访问 [英] How do we add selectors/ids to Flutter widgets so they can be accessed from Appium

查看:31
本文介绍了我们如何将选择器/id 添加到 Flutter 小部件以便它们可以从 Appium 访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想使用 Appium/Selenium 对 Flutter 应用程序进行自动化测试.在 Selenium 中查看时,某些元素没有选择器.在 Android 中,我们只需将 id 添加到每个元素上,它们就会出现在 Appium 中.我们如何在 Flutter 环境中做到这一点?

we want to use Appium/Selenium to do automated testing on a Flutter application. Some elements do not have selectors when viewed in Selenium. In Android we just add ids onto every element and they appear in Appium. How do we do this in a flutter environment?

推荐答案

在今天早上之前,我对 Flutter 一无所知.几个小时后,我可以放心地说你没有."虽然 Flutter 使开发应用程序变得快速而轻松,但它消除了您拥有的许多控制权,包括您正在寻找的自定义级别.

Prior to this morning I knew nothing of Flutter. A few hours later and I can safely say "you don't." While Flutter makes developing an application quick and easy, it removes a lot of the control you have, including the level of customization you're looking for.

在一两年前的官方 Flutter 留言板上有一些关于此的点击,但没有答案.

There are hits on this on official Flutter message boards dating back a year or two, but there were no answers.

您可以尝试通过文本定位所有内容吗?Kluge,难以或不可能维护,但可能是此时您唯一的选择.

You could attempt locating everything by text? Kluge, difficult or impossible to maintain, but likely your only option at this point.

这篇关于我们如何将选择器/id 添加到 Flutter 小部件以便它们可以从 Appium 访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆