【问题标题】:how to test toast messages using appium 1.6.3如何使用 appium 1.6.3 测试 toast 消息
【发布时间】:2020-05-03 00:14:36
【问题描述】:

我想验证 android app insutumentation 中是否显示 toast 消息,我正在使用 appium 1.6.3 来执行此操作。我检查了许多链接但找不到解决方案,有人可以提出解决方案。

【问题讨论】:

  • 您是否尝试在 Capabilities 中提及automationName 与 uiautomator2 一样?
  • 我已经设置了属性 setCapability("automationName","uiautomator2") 。仍然无法正常工作。可以举个例子吗?
  • 我们在谈论 SnackBar 吐司消息吗?

标签: appium


【解决方案1】:

从 Appium 1.6.3 版本开始支持 toast 消息,为此您需要使用automationName:'uiautomator2'.

  toast = driver.find_element(:xpath, "//android.widget.Toast[1]")
  if toast.text == "Hello" 

但我不推荐这个,因为 uiautomator2 还不稳定。

【讨论】:

  • 不错!谢谢它帮助了我。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-25
  • 1970-01-01
  • 2020-06-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多