十三、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-07-02
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-09-29
  • 2021-08-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案