收到以下块的 AttributeError: 'str' 对象没有属性 'text' 错误:
`version = driver.find_element_by_id('com.project.PROJECT:id/version').text
print(version)
for i in version:
if 'Version : 1.2.0.133' == str(i):
print('Step 46. NAS version is displayed correctly - PASS')
else:
print('Step 46. NAS version is incorrect - Fail')
time.sleep(2)
pass`
Run Code Online (Sandbox Code Playgroud)
也尝试过: if 'Version : 1.2.0.133' == i.text
还是行不通。
print(version)
返回正确的值:版本:1.2.0.133
但我无法打印if value is true: print('Step 46. NAS version is displayed correctly - PASS')
正在向我发送垃圾邮件else print FAIL value
另外,如果我使用.text
for EC 等待也会返回错误。
谢谢