【发布时间】:2016-05-29 11:10:00
【问题描述】:
如何使用 Appium 在 python 中声明特殊字符。我尝试更改文本编码,但没有帮助,默认情况下我使用的是 UTF-8 文本编码 (Eclipse)
我想断言下面提到的文字:
文字:Köp avslutat
我的文本 xpath 是:
Xpath: //UIAApplication[1]/UIAWindow[4]/UIAStaticText[1]
我的代码在这里:
try:
assert_var = self.driver.find_element_by_xpath("//UIAApplication[1]/UIAWindow[4]/UIAStaticText[1]")
return assert_var.text == "Köp avslutat"
WebdriverWait(self.driver, 10).until(EC.presence_of_element_located(xpath of element))
except:
raise NoSuchElementException("Unable to locate assert text")
【问题讨论】:
-
您在这里遇到的错误是什么?
标签: python ios selenium appium