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

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

问题描述

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

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.

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

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