Appium-Python3--UI自动化-[-14-]-Python+appium获取Toast内容

 

 需要获取到toast弹框内容

 

改toast弹框的属性有class等

1.可通过class属性,使用xpath定位

text = self.find_element_xpath('//*[@class="android.widget.Toast"]').text

2.若上面的定位不到,可加一属性

text = self.find_element_by_xpath('//*[@class="android.widget.Toast" and @index ="1"]').text

 

相关文章:

  • 2021-05-30
  • 2022-12-23
  • 2022-03-02
  • 2021-07-02
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2022-02-10
  • 2022-01-28
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案