大家好!我是新人!
appium 测试 Android 手机使用 python 语言,请问如何书写结果判断语句?如何输出测试结果?
测试点: 1.联系人 Olm 存在 2.联系人电话是 “10010”
用例内容如下:
import os
import time
from selenium import webdriver
#Retuens ads path relative to this file and not cwd
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(file), p)
)
desired_caps = {}
desired_caps['device'] = 'Android'
desired_caps['browserName'] = ''
desired_caps['version'] = '4.3'
#desired_caps['app'] = PATH('D:\Appium\ContactManager.apk')
desired_caps['app-package'] = 'com.android.contacts'
desired_caps['app-activity'] = '.activities.PeopleActivity'
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
#driver.find_element_by_id("com.android.contacts:id/cliv_name_textview").click()
driver.find_element_by_name("Olm").click()
time.sleep(2)
number = driver.find_element_by_name("10010")
time.sleep(1)
print number
打印"number": CMD 输出内容 “”
请问如何书写判断语句?如何将结果输出?
谢谢!