├── .idea ├── Nidone_appium.iml ├── inspectionProfiles │ └── profiles_settings.xml ├── modules.xml └── workspace.xml ├── .project ├── .pydevproject ├── .settings └── org.eclipse.core.resources.prefs ├── BasePage ├── ReadXml.py ├── ReadXml.pyc ├── __init__.py └── __init__.pyc ├── Email_Address.ini ├── Exception ├── Custom_exception.py ├── Custom_exception.pyc ├── __init__.py └── __init__.pyc ├── README.md ├── Report ├── Send_report.py ├── __init__.py ├── __init__.pyc ├── configemail.py ├── generate_test_report.py └── generate_test_report.pyc ├── Test_Report ├── 2017-09-30_13_34_42_error │ └── error.txt ├── 2017-09-30_13_35_19.html ├── 2017-09-30_13_35_19_error │ ├── test_login12017-09-30_13_35_19.png │ ├── test_login2017-09-30_13_35_19.png │ ├── 正常登录1.txt │ └── 正确登录.txt ├── 2017-09-30_13_42_09.html ├── 2017-09-30_13_42_09_error │ ├── test_login12017-09-30_13_42_09.png │ ├── test_login2017-09-30_13_42_09.png │ ├── 正常登录1.txt │ └── 正确登录.txt ├── 2017-09-30_13_52_39_error │ └── error.txt ├── 2017-09-30_13_52_59_error │ └── error.txt ├── 2017-09-30_13_55_12.html ├── 2017-09-30_13_55_12_error │ ├── test_login12017-09-30_13_55_12.png │ ├── test_login2017-09-30_13_55_12.png │ ├── 正常登录1.txt │ └── 正确登录.txt ├── 2017-09-30_14_00_50.html ├── 2017-09-30_14_00_50_error │ ├── test_login12017-09-30_14_00_50.png │ ├── test_login2017-09-30_14_00_50.png │ ├── 正常登录1.txt │ └── 正确登录.txt ├── 2017-09-30_15_16_19_error │ └── error.txt ├── 2017-09-30_15_16_56.html ├── 2017-09-30_15_16_56_error │ ├── test_login12017-09-30_15_16_56.png │ ├── test_login2017-09-30_15_16_56.png │ ├── 正常登录1.txt │ └── 正确登录.txt └── 2017-11-23_16_46_27_error │ └── error.txt ├── case.xls ├── case ├── AllCase.py ├── AllCase.pyc ├── Get_Driver.py ├── Get_Driver.pyc ├── Test_Case.py ├── Test_Case.pyc ├── __init__.py ├── __init__.pyc ├── run.py ├── run_list.py └── run_list.pyc ├── common ├── Element.py ├── Element.pyc ├── Get_Phone.py ├── Get_Phone.pyc ├── Global.py ├── Global.pyc ├── Path.py ├── Path.pyc ├── ReadData.py ├── ReadData.pyc ├── __init__.py ├── __init__.pyc ├── creat_case.py ├── creat_case.pyc ├── del_past_dir.py ├── del_past_dir.pyc ├── log.py ├── log.pyc ├── mkdir_log_directory.py ├── mkdir_log_directory.pyc ├── operation.py ├── operation.pyc ├── runtime.py ├── runtime.pyc ├── server.py └── server.pyc ├── log ├── 2017-09-30_15_16_19 │ ├── 2017-09-30_15_16_19.log │ └── 2017-09-30_15_16_19appium.log ├── 2017-09-30_15_16_56 │ ├── 2017-09-30_15_16_56.log │ └── 2017-09-30_15_16_56appium.log ├── 2017-11-23_16_17_27 │ ├── 2017-11-23_16_17_27.log │ └── 2017-11-23_16_17_27appium.log ├── 2017-11-23_16_18_53 │ ├── 2017-11-23_16_18_53.log │ └── 2017-11-23_16_18_53appium.log ├── 2017-11-23_16_19_22 │ ├── 2017-11-23_16_19_22.log │ └── 2017-11-23_16_19_22appium.log ├── 2017-11-23_16_22_01 │ ├── 2017-11-23_16_22_01.log │ └── 2017-11-23_16_22_01appium.log ├── 2017-11-23_16_23_58 │ ├── 2017-11-23_16_23_58.log │ └── 2017-11-23_16_23_58appium.log ├── 2017-11-23_16_25_18 │ ├── 2017-11-23_16_25_18.log │ └── 2017-11-23_16_25_18appium.log ├── 2017-11-23_16_25_52 │ ├── 2017-11-23_16_25_52.log │ └── 2017-11-23_16_25_52appium.log ├── 2017-11-23_16_26_15 │ ├── 2017-11-23_16_26_15.log │ └── 2017-11-23_16_26_15appium.log ├── 2017-11-23_16_26_45 │ ├── 2017-11-23_16_26_45.log │ └── 2017-11-23_16_26_45appium.log ├── 2017-11-23_16_28_09 │ ├── 2017-11-23_16_28_09.log │ └── 2017-11-23_16_28_09appium.log ├── 2017-11-23_16_28_41 │ ├── 2017-11-23_16_28_41.log │ └── 2017-11-23_16_28_41appium.log ├── 2017-11-23_16_29_23 │ ├── 2017-11-23_16_29_23.log │ └── 2017-11-23_16_29_23appium.log ├── 2017-11-23_16_29_34 │ ├── 2017-11-23_16_29_34.log │ └── 2017-11-23_16_29_34appium.log ├── 2017-11-23_16_33_36 │ └── 2017-11-23_16_33_36.log ├── 2017-11-23_16_34_28 │ └── 2017-11-23_16_34_28.log ├── 2017-11-23_16_35_46 │ └── 2017-11-23_16_35_46.log ├── 2017-11-23_16_37_03 │ └── 2017-11-23_16_37_03.log ├── 2017-11-23_16_37_31 │ └── 2017-11-23_16_37_31.log ├── 2017-11-23_16_37_48 │ └── 2017-11-23_16_37_48.log ├── 2017-11-23_16_38_19 │ └── 2017-11-23_16_38_19.log ├── 2017-11-23_16_40_08 │ ├── 2017-11-23_16_40_08.log │ └── 2017-11-23_16_40_08appium.log ├── 2017-11-23_16_40_42 │ ├── 2017-11-23_16_40_42.log │ └── 2017-11-23_16_40_42appium.log ├── 2017-11-23_16_41_06 │ ├── 2017-11-23_16_41_06.log │ └── 2017-11-23_16_41_06appium.log ├── 2017-11-23_16_41_29 │ ├── 2017-11-23_16_41_29.log │ └── 2017-11-23_16_41_29appium.log ├── 2017-11-23_16_42_47 │ ├── 2017-11-23_16_42_47.log │ └── 2017-11-23_16_42_47appium.log ├── 2017-11-23_16_43_30 │ ├── 2017-11-23_16_43_30.log │ └── 2017-11-23_16_43_30appium.log ├── 2017-11-23_16_44_51 │ ├── 2017-11-23_16_44_51.log │ └── 2017-11-23_16_44_51appium.log ├── 2017-11-23_16_45_13 │ ├── 2017-11-23_16_45_13.log │ └── 2017-11-23_16_45_13appium.log ├── 2017-11-23_16_45_49 │ ├── 2017-11-23_16_45_49.log │ └── 2017-11-23_16_45_49appium.log ├── 2017-11-23_16_46_27 │ └── 2017-11-23_16_46_27.log ├── 2017-11-23_17_12_12 │ ├── 2017-11-23_17_12_12.log │ └── 2017-11-23_17_12_12appium.log ├── 2017-11-23_17_20_17 │ ├── 2017-11-23_17_20_17.log │ └── 2017-11-23_17_20_17appium.log ├── 2017-11-23_17_20_37 │ ├── 2017-11-23_17_20_37.log │ └── 2017-11-23_17_20_37appium.log ├── 2017-11-23_17_20_48 │ ├── 2017-11-23_17_20_48.log │ └── 2017-11-23_17_20_48appium.log ├── 2017-11-23_17_21_04 │ ├── 2017-11-23_17_21_04.log │ └── 2017-11-23_17_21_04appium.log ├── 2017-11-23_17_21_14 │ ├── 2017-11-23_17_21_14.log │ └── 2017-11-23_17_21_14appium.log ├── 2017-11-23_17_21_38 │ ├── 2017-11-23_17_21_38.log │ └── 2017-11-23_17_21_38appium.log ├── 2017-11-23_17_22_09 │ ├── 2017-11-23_17_22_09.log │ └── 2017-11-23_17_22_09appium.log ├── 2017-11-23_17_23_17 │ ├── 2017-11-23_17_23_17.log │ └── 2017-11-23_17_23_17appium.log ├── 2017-11-23_17_25_51 │ ├── 2017-11-23_17_25_51.log │ └── 2017-11-23_17_25_51appium.log ├── 2017-11-23_17_26_06 │ ├── 2017-11-23_17_26_06.log │ └── 2017-11-23_17_26_06appium.log ├── 2017-11-23_17_26_37 │ ├── 2017-11-23_17_26_37.log │ └── 2017-11-23_17_26_37appium.log ├── 2017-11-23_17_31_40 │ ├── 2017-11-23_17_31_40.log │ └── 2017-11-23_17_31_40appium.log ├── 2017-11-23_17_32_15 │ ├── 2017-11-23_17_32_15.log │ └── 2017-11-23_17_32_15appium.log ├── 2017-11-23_17_33_20 │ ├── 2017-11-23_17_33_20.log │ └── 2017-11-23_17_33_20appium.log ├── 2017-11-23_17_35_53 │ ├── 2017-11-23_17_35_53.log │ └── 2017-11-23_17_35_53appium.log ├── 2017-11-23_17_36_02 │ ├── 2017-11-23_17_36_02.log │ └── 2017-11-23_17_36_02appium.log ├── 2017-11-23_17_36_11 │ ├── 2017-11-23_17_36_11.log │ └── 2017-11-23_17_36_11appium.log └── 2017-11-23_17_36_34 │ ├── 2017-11-23_17_36_34.log │ └── 2017-11-23_17_36_34appium.log ├── page.xml ├── step.xls └── test_data └── Cover.jpg /.idea/Nidone_appium.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 13 | 14 | 15 | 1503395636402 16 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nidone_appium 4 | 5 | 6 | 7 | 8 | 9 | org.python.pydev.PyDevBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.python.pydev.pythonNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.pydevproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | Default 4 | python 2.7 5 | 6 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//case/run.py=utf-8 3 | -------------------------------------------------------------------------------- /BasePage/ReadXml.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月24日 5 | 6 | @author: li tao 7 | """ 8 | import xml.etree.ElementTree 9 | import logging 10 | from Exception import Custom_exception 11 | 12 | 13 | class BastPage: 14 | """ 15 | 封装读取page.xml 16 | """ 17 | def __init__(self, filename): 18 | """ 19 | 20 | :param filename: page.xml文件路径 21 | """ 22 | try: 23 | self.level = 1 # 节点的深度从1开始 24 | self.root = xml.etree.ElementTree.parse(filename).getroot() 25 | self.result_list = [] 26 | except Exception as e: 27 | logging.error(e) 28 | raise Custom_exception.ReadXmlError 29 | 30 | def walk_data(self, root_node, level, page_name, locator): 31 | """ 32 | 遍历所有的节点 33 | :param root_node: 34 | :param level: 节点深度 35 | :param page_name: 页面名称 36 | :param locator: 元素名称 37 | :return: 38 | """ 39 | if root_node.text.encode('utf-8') == locator: 40 | self.result_list = root_node.attrib 41 | return 42 | else: 43 | try: 44 | if root_node.tag == 'map' or root_node.attrib['pageName'] == page_name: 45 | children_node = root_node.getchildren() 46 | if len(children_node) == 0: 47 | pass 48 | for child in children_node: 49 | self.walk_data(child, level + 1, page_name, locator) 50 | return self.result_list 51 | except: 52 | pass 53 | 54 | def run(self, page_name, locator): 55 | """ 56 | 57 | :param page_name: 页面名称 58 | :param locator: 元素名称 59 | :return: 60 | """ 61 | result = self.walk_data(self.root, self.level, page_name, locator) 62 | return result 63 | -------------------------------------------------------------------------------- /BasePage/ReadXml.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/BasePage/ReadXml.pyc -------------------------------------------------------------------------------- /BasePage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/BasePage/__init__.py -------------------------------------------------------------------------------- /BasePage/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/BasePage/__init__.pyc -------------------------------------------------------------------------------- /Email_Address.ini: -------------------------------------------------------------------------------- 1 | [email_address] 2 | Sender = 18202886913@163.com 3 | Addressee = litao_mamainst@163.com 4 | smtp = smtp.163.com 5 | login = m18202886913@163.com 6 | AuthorizationCode = q123456 -------------------------------------------------------------------------------- /Exception/Custom_exception.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月22日 5 | 6 | @author: li tao 7 | """ 8 | # 自定义异常类,可自行添加 9 | 10 | 11 | class WrongLocation(Exception): 12 | def __init__(self, err='错误的元素定位方式'): 13 | Exception.__init__(self, err) 14 | 15 | 16 | class ReadXmlError(Exception): 17 | def __init__(self, err='Xml读取初始化失败'): 18 | Exception.__init__(self, err) 19 | 20 | 21 | class MailInitializationError(Exception): 22 | def __init__(self, err='邮件初始化'): 23 | Exception.__init__(self, err) 24 | 25 | 26 | class GetDriverError(Exception): 27 | def __init__(self, err='初始化driver失败'): 28 | Exception.__init__(self, err) 29 | 30 | 31 | class OpenXlsError(Exception): 32 | def __init__(self, err='打开用例文件失败'): 33 | Exception.__init__(self, err) 34 | 35 | 36 | class CreatTestCaseError(Exception): 37 | def __init__(self, err='创建用例脚本失败'): 38 | Exception.__init__(self, err) 39 | 40 | 41 | class CloseFileError(Exception): 42 | def __init__(self, err='关闭文件是发生错误'): 43 | Exception.__init__(self, err) 44 | 45 | 46 | class ReadDeviceError(Exception): 47 | def __init__(self, err='读取待测设备时发生错误'): 48 | Exception.__init__(self, err) 49 | 50 | 51 | class LogConfigError(Exception): 52 | def __init__(self, err='日志配置初始化错误'): 53 | Exception.__init__(self, err) 54 | 55 | 56 | class InitResultError(Exception): 57 | def __init__(self, err='初始化测试结果表失败'): 58 | Exception.__init__(self, err) 59 | 60 | 61 | class WriteResultError(Exception): 62 | def __init__(self, err='写入测试结果失败'): 63 | Exception.__init__(self, err) 64 | 65 | 66 | class SaveReusltError(Exception): 67 | def __init__(self, err='保存测试结果失败'): 68 | Exception.__init__(self, err) 69 | 70 | 71 | class ElementNotExist(Exception): 72 | def __init__(self, err='页面元素不存在'): 73 | Exception.__init__(self, err) 74 | -------------------------------------------------------------------------------- /Exception/Custom_exception.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Exception/Custom_exception.pyc -------------------------------------------------------------------------------- /Exception/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Exception/__init__.py -------------------------------------------------------------------------------- /Exception/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Exception/__init__.pyc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-appium 2 | App Ui自动化测试框架,采用OP设计模式,xml管理元素信息,excel管理用例 3 | -------------------------------------------------------------------------------- /Report/Send_report.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月22日 5 | 6 | @author: li tao 7 | """ 8 | from Report import configemail 9 | from common import Path, log 10 | import smtplib 11 | import email.MIMEMultipart 12 | import email.MIMEText 13 | import os.path 14 | import mimetypes 15 | import email.MIMEImage 16 | import logging 17 | 18 | 19 | @log.deco(u'发送邮件') 20 | # test_time 测试时间 21 | def send_email(test_time): 22 | address = configemail.ConfigEmail() 23 | # 发件人地址 24 | From = address.get_sender() 25 | # 收件人地址,多个收件人用逗号隔开 26 | To = address.get_addressee() 27 | # 附件名 28 | file_name = Path.report_path()+test_time+'.html' 29 | 30 | server = smtplib.SMTP(address.get_smtp()) 31 | # 仅smtp服务器需要验证时 32 | server.login(address.get_login(), address.get_authorization_code()) 33 | 34 | # 构造MIMEMultipart对象做为根容器 35 | main_msg = email.MIMEMultipart.MIMEMultipart() 36 | 37 | # 构造MIMEText对象做为邮件显示内容并附加到根容器 38 | text_msg = email.MIMEText.MIMEText("Nidone测试报告", charset="utf-8") 39 | main_msg.attach(text_msg) 40 | 41 | # 构造MIMEBase对象做为文件附件内容并附加到根容器 42 | ctype, encoding = mimetypes.guess_type(file_name) 43 | if ctype is None or encoding is not None: 44 | ctype = 'application/octet-stream' 45 | maintype, subtype = ctype.split('/', 1) 46 | file_msg = email.MIMEImage.MIMEImage(open(file_name, 'rb').read(), subtype) 47 | logging.info(ctype, encoding) 48 | # 设置附件头 49 | basename = os.path.basename(file_name) 50 | # 修改邮件头 51 | file_msg.add_header('Content-Disposition', 'attachment', filename=basename) 52 | main_msg.attach(file_msg) 53 | 54 | # 设置根容器属性 55 | main_msg['From'] = From 56 | main_msg['To'] = To 57 | main_msg['Subject'] = "Nidone测试报告 " 58 | main_msg['Date'] = email.Utils.formatdate() 59 | 60 | # 得到格式化后的完整文本 61 | fulltext = main_msg.as_string() 62 | 63 | # 用smtp发送邮件 64 | try: 65 | server.sendmail(From, To, fulltext) 66 | finally: 67 | server.quit() 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /Report/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Report/__init__.py -------------------------------------------------------------------------------- /Report/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Report/__init__.pyc -------------------------------------------------------------------------------- /Report/configemail.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月22日 5 | 6 | @author: li tao 7 | """ 8 | import configparser 9 | from common import Path, log, creat_case 10 | from Exception import Custom_exception 11 | 12 | 13 | class ConfigEmail: 14 | # 读取邮件发送配置信息 15 | @log.deco(u'邮件信息初始化') 16 | def __init__(self): 17 | config = configparser.ConfigParser() 18 | config.read(Path.scan_files(prefix='email_address')) 19 | try: 20 | # 发件人地址 21 | self.Sender = config['email_address']['Sender'] 22 | # 收件人地址,多个收件人用逗号隔开 23 | self.Addressee = config['email_address']['Addressee'] 24 | # 第三方smtp,例如网易的,smtp.163.com 25 | self.smtp = config['email_address']['smtp'] 26 | # 授权登录账号 27 | self.login = config['email_address']['login'] 28 | # 授权码 29 | self.AuthorizationCode = config['email_address']['AuthorizationCode'] 30 | except Exception as e: 31 | creat_case.exception_handling(e, "邮件信息初始化") 32 | raise Custom_exception.MailInitializationError 33 | 34 | def get_sender(self): 35 | return self.Sender 36 | 37 | def get_addressee(self): 38 | return self.Addressee 39 | 40 | def get_smtp(self): 41 | return self.smtp 42 | 43 | def get_login(self): 44 | return self.login 45 | 46 | def get_authorization_code(self): 47 | return self.AuthorizationCode 48 | -------------------------------------------------------------------------------- /Report/generate_test_report.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | """ 3 | Created on 2017年9月28日 4 | 5 | @author: lt 6 | """ 7 | # 读取测试用例 8 | # import xlrd 9 | # import logging 10 | # from Exception import Custom_exception 11 | # from common import creat_case, Path 12 | # Path.scan_files(postfix='.xls') 13 | # 14 | # 15 | # class ReadExcelResult: 16 | # 17 | # def __init__(self, fp): 18 | # try: 19 | # self.data = xlrd.open_workbook(fp) 20 | # except Exception, e: 21 | # logging.error("%s" % e) 22 | # try: 23 | # self.case = self.data.sheet_by_name(u'测试结果') 24 | # self.case_num = self.case.nrows # 读取测试结果条数+1 25 | # except Exception as e: 26 | # creat_case.exception_handling(e) 27 | # raise Custom_exception.OpenXlsError 28 | # 29 | # def test_results(self): 30 | # results = [] 31 | # for i in range(1, self.case_num): 32 | # single_results = [] 33 | # number = int(self.case.row(i)[0].value) 34 | # mod_ule = self.case.row(i)[1].value.encode('utf8') 35 | # test_point = self.case.row(i)[2].value.encode('utf8') 36 | # test_name = self.case.row(i)[3].value.encode('utf8') 37 | # degree_of_importance = self.case.row(i)[4].value.encode('utf8') 38 | # expected_result = self.case.row(i)[5].value.encode('utf8') 39 | # actual_result = self.case.row(i)[6].value.encode('utf8') 40 | # error_log = self.case.row(i)[7].value.encode('utf8') 41 | # error_screenshot = self.case.row(i)[8].value.encode('utf-8') 42 | # single_results.append(number) 43 | # single_results.append(mod_ule) 44 | # single_results.append(test_point) 45 | # single_results.append(test_name) 46 | # single_results.append(degree_of_importance) 47 | # single_results.append(expected_result) 48 | # single_results.append(actual_result) 49 | # single_results.append(error_log) 50 | # single_results.append(error_screenshot) 51 | # # single_results = [number, mod_ule, test_point, test_name, degree_of_importance, expected_result, 52 | # # actual_result, error_log] 53 | # results.append(single_results) 54 | # return results 55 | from common import runtime 56 | import datetime 57 | from common import Path 58 | 59 | 60 | def ab(l): 61 | end_time = datetime.datetime.now() 62 | run_time = (datetime.datetime.now()-runtime.start_time_test()).seconds 63 | second = run_time % 60 64 | minute = run_time / 60 % 60 65 | hours = run_time / 60 / 60 % 24 66 | day = run_time / 60 / 60 / 24 67 | elapsed_time = ' %s 天 %s 小时 %s 分 %s 秒' % (day, hours, minute, second) 68 | total_count = len(l) 69 | fail_count = 0 70 | error_count = 0 71 | for j in range(0, len(l)): 72 | if l[j][6] == 'error': 73 | error_count += 1 74 | if l[j][6] == 'fail': 75 | fail_count += 1 76 | fail_proportion = round(fail_count / total_count, 2) 77 | error_proportion = round(error_count / total_count, 2) 78 | success_proportion = 1-fail_proportion-error_proportion 79 | f = open(Path.father_path+'\\Test_Report\\'+runtime.test_start_time()+'.html', 'w') 80 | f.write(''' 81 | 82 | 83 | 84 | nidone测试报告 85 | 86 | 87 |

nidone6测试报告

88 |

测速开始时间: 89 | %s 90 |

91 |

测试结束时间: 92 | %s 93 |

94 |

测试耗时: 95 | %s 96 |

97 |

Total: 98 | %s 99 | Fail: %s 100 | Error: 101 | %s

102 |

103 | 104 | 浏览器不支持canvas 105 | 106 |

''' % (runtime.start_time_test(), end_time, elapsed_time, total_count, fail_count, error_count)) 107 | 108 | f.write(''' 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | ''') 133 | for i in range(0, len(l)): 134 | if l[i][6] == '': 135 | l[i][6] = 'success' 136 | f.write(''' 137 | 138 | 139 | 140 | 141 | 142 | 143 | > 144 | > 148 | 151 | ''' % (l[i][7].encode('utf8'), l[i][8].encode('utf8'))) 152 | f.write('''
测试ID所属模块测试点测试标题重要程度预期结果执行结果错误日志错误截图
%s%s%s%s%s%s%s''' % (l[i][0], l[i][1], l[i][2], l[i][3], l[i][4], l[i][5], l[i][6])) 145 | if l[i][7]: 146 | f.write(''' 错误日志 147 | 149 | 截图 150 |
153 | 211 | ''' % (fail_proportion, success_proportion, error_proportion)) 213 | f.close() 214 | 215 | -------------------------------------------------------------------------------- /Report/generate_test_report.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Report/generate_test_report.pyc -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_34_42_error/error.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_35_19.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nidone测试报告 6 | 7 | 8 |

nidone6测试报告

9 |

测速开始时间: 10 | 2017-09-30 13:35:19.236000 11 |

12 |

测试结束时间: 13 | 2017-09-30 13:36:04.327000 14 |

15 |

测试耗时: 16 | 0 天 0 小时 0 分 45 秒 17 |

18 |

Total: 19 | 2 20 | Fail: 0 21 | Error: 22 | 2

23 |

24 | 25 | 浏览器不支持canvas 26 | 27 |

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | > 59 | > 61 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | > 72 | > 74 | 77 |
测试ID所属模块测试点测试标题重要程度预期结果执行结果错误日志错误截图
1登录模块登录正确登录进入首页error 错误日志 60 | 62 | 截图 63 |
2登录模块登录 正常登录1进入首页error 错误日志 73 | 75 | 截图 76 |
78 | 134 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_35_19_error/test_login12017-09-30_13_35_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_13_35_19_error/test_login12017-09-30_13_35_19.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_35_19_error/test_login2017-09-30_13_35_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_13_35_19_error/test_login2017-09-30_13_35_19.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_35_19_error/正确登录.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 13:35:40,426 - log.py[line:88] - INFO: run 正确登录. 3 | 2017-09-30 13:35:40,426 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea/context {"sessionId": "c8374ccb-ae86-4c65-ba9c-f21584f58cea", "name": "WEBVIEW"} 4 | 2017-09-30 13:35:40,490 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 13:35:40,492 - creat_case.py[line:116] - ERROR: Message: No such context found. 6 | 7 | 2017-09-30 13:35:40,492 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea/screenshot {"sessionId": "c8374ccb-ae86-4c65-ba9c-f21584f58cea"} 8 | 2017-09-30 13:35:41,654 - remote_connection.py[line:565] - DEBUG: Finished Request 9 | 2017-09-30 13:35:41,655 - operation.py[line:81] - INFO: 错误截图已保存在 H:\project\python_appium\Test_Report\2017-09-30_13_35_19_error 10 | [36minfo: [debug] badging act: com.sixty.nidoneClient.view.activity.SDK_WebApp 11 | info: [debug] Parsed package and activity are: com.sixty.nidoneClient/com.sixty.nidoneClient.view.activity.SDK_WebApp 12 | info: [debug] Using fast reset? true 13 | info: [debug] Preparing device for session 14 | info: [debug] Checking whether app is actually present 15 | info: Retrieving device 16 | info: [debug] Trying to find a connected android device 17 | info: [debug] Getting connected devices... 18 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe devices 19 | info: [debug] 1 device(s) connected 20 | info: Found device EAROU8VOSKAM99I7 21 | info: [debug] Setting device id to EAROU8VOSKAM99I7 22 | info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) 23 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 wait-for-device 24 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "echo 'ready'" 25 | info: [debug] Starting logcat capture 26 | info: [debug] Getting device API level 27 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "getprop ro.build.version.sdk" 28 | info: [debug] Device is at API Level 19 29 | info: Device API level is: 19 30 | info: [debug] Extracting strings for language: default 31 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "getprop persist.sys.language" 32 | info: [debug] Current device persist.sys.language: 33 | info: [debug] java -jar "F:\test_tools\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "H:\project\python_appium\app-client-debug.apk" "C:\Users\SIMO\AppData\Local\Temp\com.sixty.nidoneClient" 34 | info: [debug] Reading strings from converted strings.json 35 | info: [debug] Setting language to default 36 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 push "C:\\Users\\SIMO\\AppData\\Local\\Temp\\com.sixty.nidoneClient\\strings.json" /data/local/tmp 37 | info: [debug] Checking whether aapt is present 38 | info: [debug] Using aapt from F:\测试工具安装包\sdk\build-tools\android-4.4W\aapt.exe 39 | info: [debug] Retrieving process from manifest. 40 | info: [debug] executing cmd: F:\测试工具安装包\sdk\build-tools\android-4.4W\aapt.exe dump xmltree H:\project\python_appium\app-client-debug.apk AndroidManifest.xml 41 | info: [debug] Set app process to: com.sixty.nidoneClient 42 | info: [debug] Not uninstalling app since server not started with --full-reset 43 | info: [debug] Checking app cert for H:\project\python_appium\app-client-debug.apk. 44 | info: [debug] executing cmd: java -jar F:\test_tools\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar H:\project\python_appium\app-client-debug.apk 45 | info: [debug] App already signed. 46 | info: [debug] Zip-aligning H:\project\python_appium\app-client-debug.apk 47 | info: [debug] Checking whether zipalign is present 48 | info: [debug] Using zipalign from F:\测试工具安装包\sdk\build-tools\android-4.4W\zipalign.exe 49 | info: [debug] Zip-aligning apk. 50 | info: [debug] executing cmd: F:\测试工具安装包\sdk\build-tools\android-4.4W\zipalign.exe -f 4 H:\project\python_appium\app-client-debug.apk C:\Users\SIMO\AppData\Local\Temp\117830-3204-oxhqtf.vlrcp1ra4i\appium.tmp 51 | info: [debug] MD5 for app is 85b42dada3ddf5ccfe399142ccc6d8c9 52 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "ls /data/local/tmp/85b42dada3ddf5ccfe399142ccc6d8c9.apk" 53 | info: [debug] Getting install status for com.sixty.nidoneClient 54 | info: [debug] Getting device API level 55 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "getprop ro.build.version.sdk" 56 | info: [debug] Device is at API Level 19 57 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "pm list packages -3 com.sixty.nidoneClient" 58 | info: [debug] App is installed 59 | info: App is already installed, resetting app 60 | info: [debug] Running fast reset (stop and clear) 61 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "am force-stop com.sixty.nidoneClient" 62 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "pm clear com.sixty.nidoneClient" 63 | info: [debug] Forwarding system:9517 to device:4724 64 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 forward tcp:9517 tcp:4724 65 | info: [debug] Pushing appium bootstrap to device... 66 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 push "F:\\test_tools\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/ 67 | info: [debug] Enabling Unicode keyboard support 68 | info: [debug] Pushing unicode ime to device... 69 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 install "F:\test_tools\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk" 70 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "settings get secure default_input_method" 71 | info: [debug] Unsetting IME 'io.appium.android.ime/.UnicodeIME' 72 | info: [debug] Setting IME to 'io.appium.android.ime/.UnicodeIME' 73 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "ime enable io.appium.android.ime/.UnicodeIME" 74 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "ime set io.appium.android.ime/.UnicodeIME" 75 | info: [debug] Pushing settings apk to device... 76 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 install "F:\test_tools\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk" 77 | info: [debug] Pushing unlock helper app to device... 78 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 install "F:\test_tools\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk" 79 | info: Starting App 80 | info: [debug] Attempting to kill all 'uiautomator' processes 81 | info: [debug] Getting all processes with 'uiautomator' 82 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "ps 'uiautomator'" 83 | info: [debug] No matching processes found 84 | info: [debug] Running bootstrap 85 | info: [debug] spawning: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.sixty.nidoneClient -e disableAndroidWatchers false 86 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 87 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= 88 | info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap: 89 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner 90 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer 91 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap 92 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 93 | info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1 94 | info: [debug] [UIAUTOMATOR STDOUT] tcp port:4724 95 | info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724 96 | info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready 97 | info: [debug] [BOOTSTRAP] [debug] Loading json... 98 | info: [debug] Waking up device if it's not alive 99 | info: [debug] Pushing command to appium work queue: ["wake",{}] 100 | info: [debug] [BOOTSTRAP] [debug] json loading complete. 101 | info: [debug] [BOOTSTRAP] [debug] Registered crash watchers. 102 | info: [debug] [BOOTSTRAP] [debug] Client connected 103 | info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}} 104 | info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION 105 | info: [debug] [BOOTSTRAP] [debug] Got command action: wake 106 | info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0} 107 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "dumpsys window" 108 | info: [debug] Screen already unlocked, continuing. 109 | info: [debug] Pushing command to appium work queue: ["getDataDir",{}] 110 | info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}} 111 | info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION 112 | info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir 113 | info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0} 114 | info: [debug] dataDir set to: /data/local/tmp 115 | info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}] 116 | info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}} 117 | info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION 118 | info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy 119 | info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0} 120 | info: [debug] Getting device API level 121 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "getprop ro.build.version.sdk" 122 | info: [debug] Device is at API Level 19 123 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.sixty.nidoneClient/com.sixty.nidoneClient.view.activity.SDK_WebApp" 124 | info: [debug] Waiting for pkg "com.sixty.nidoneClient" and activity "com.sixty.nidoneClient.view.activity.SDK_WebApp" to be focused 125 | info: [debug] Getting focused package and activity 126 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "dumpsys window windows" 127 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "getprop ro.build.version.release" 128 | info: [debug] Device is at release version 4.4.4 129 | info: [debug] Device launched! Ready for commands 130 | info: [debug] Setting command timeout to the default of 600 secs 131 | info: [debug] Appium session started with sessionId c8374ccb-ae86-4c65-ba9c-f21584f58cea 132 | info: <-- POST /wd/hub/session 303 18032.179 ms - 74  133 | info: --> GET /wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea {} 134 | info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.4","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"deviceName":"R7","unicodeKeyboard":true,"app":"H:\\project\\python_appium\\app-client-debug.apk","resetKeyboard":true,"platformVersion":"4.4","platformName":"Android"},"deviceName":"EAROU8VOSKAM99I7","unicodeKeyboard":true,"app":"H:\\project\\python_appium\\app-client-debug.apk","resetKeyboard":true,"platformName":"Android"},"sessionId":"c8374ccb-ae86-4c65-ba9c-f21584f58cea"} 135 | info: <-- GET /wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea 200 2.463 ms - 655 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.4","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"deviceName":"R7","unicodeKeyboard":true,"app":"H:\\project\\python_appium\\app-client-debug.apk","resetKeyboard":true,"platformVersion":"4.4","platformName":"Android"},"deviceName":"EAROU8VOSKAM99I7","unicodeKeyboard":true,"app":"H:\\project\\python_appium\\app-client-debug.apk","resetKeyboard":true,"platformName":"Android"},"sessionId":"c8374ccb-ae86-4c65-ba9c-f21584f58cea"} 136 | info: --> POST /wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea/context {"sessionId":"c8374ccb-ae86-4c65-ba9c-f21584f58cea","name":"WEBVIEW"} 137 | info: [debug] Getting a list of available webviews 138 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "cat /proc/net/unix" 139 | info: [debug] Available contexts: 140 | info: [debug] [] 141 | info: [debug] Available contexts: NATIVE_APP 142 | info: [debug] Responding to client with error: {"status":35,"value":{"message":"No such context found.","origValue":"Context 'WEBVIEW_com.sixty.nidoneClient' does not exist"},"sessionId":"c8374ccb-ae86-4c65-ba9c-f21584f58cea"} 143 | info: <-- POST /wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea/context 500 58.848 ms - 179  144 | info: --> GET /wd/hub/session/c8374ccb-ae86-4c65-ba9c-f21584f58cea/screenshot {} 145 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 shell "/system/bin/rm /data/local/tmp/screenshot.png; /system/bin/screencap -p /data/local/tmp/screenshot.png " 146 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe -s EAROU8VOSKAM99I7 pull /data/local/tmp/screenshot.png "C:\\Users\\SIMO\\AppData\\Local\\Temp\\appium117830-3204-q06qz8.g7a7sw0zfr.png" 147 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_42_09.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nidone测试报告 6 | 7 | 8 |

nidone6测试报告

9 |

测速开始时间: 10 | 2017-09-30 13:42:09.695000 11 |

12 |

测试结束时间: 13 | 2017-09-30 13:42:49.951000 14 |

15 |

测试耗时: 16 | 0 天 0 小时 0 分 40 秒 17 |

18 |

Total: 19 | 2 20 | Fail: 0 21 | Error: 22 | 2

23 |

24 | 25 | 浏览器不支持canvas 26 | 27 |

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | > 59 | > 61 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | > 72 | > 74 | 77 |
测试ID所属模块测试点测试标题重要程度预期结果执行结果错误日志错误截图
1登录模块登录正确登录进入首页error 错误日志 60 | 62 | 截图 63 |
2登录模块登录 正常登录1进入首页error 错误日志 73 | 75 | 截图 76 |
78 | 134 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_42_09_error/test_login12017-09-30_13_42_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_13_42_09_error/test_login12017-09-30_13_42_09.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_42_09_error/test_login2017-09-30_13_42_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_13_42_09_error/test_login2017-09-30_13_42_09.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_42_09_error/正常登录1.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 13:42:41,963 - log.py[line:88] - INFO: run 正常登录1. 3 | 2017-09-30 13:42:41,963 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/3d1130e9-ee60-4036-b52c-1e8922d0bebc/element {"using": "xpath", "sessionId": "3d1130e9-ee60-4036-b52c-1e8922d0bebc", "value": "//*[@id=\"loginForm\"]/div[1]/div[1]/div[2]/input"} 4 | 2017-09-30 13:42:46,049 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 13:42:46,049 - creat_case.py[line:116] - ERROR: Message: An element could not be located on the page using the given search parameters. 6 | 7 | 2017-09-30 13:42:46,049 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/3d1130e9-ee60-4036-b52c-1e8922d0bebc/screenshot {"sessionId": "3d1130e9-ee60-4036-b52c-1e8922d0bebc"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_42_09_error/正确登录.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 13:42:25,780 - log.py[line:88] - INFO: run 正确登录. 3 | 2017-09-30 13:42:25,780 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/ac869d90-9ed4-42a6-b00b-15cfcda8218b/context {"sessionId": "ac869d90-9ed4-42a6-b00b-15cfcda8218b", "name": "WEBVIEW"} 4 | 2017-09-30 13:42:25,865 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 13:42:25,867 - creat_case.py[line:116] - ERROR: Message: No such context found. 6 | 7 | 2017-09-30 13:42:25,868 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/ac869d90-9ed4-42a6-b00b-15cfcda8218b/screenshot {"sessionId": "ac869d90-9ed4-42a6-b00b-15cfcda8218b"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_52_39_error/error.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_52_59_error/error.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_55_12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nidone测试报告 6 | 7 | 8 |

nidone6测试报告

9 |

测速开始时间: 10 | 2017-09-30 13:55:12.869000 11 |

12 |

测试结束时间: 13 | 2017-09-30 13:56:18.087000 14 |

15 |

测试耗时: 16 | 0 天 0 小时 1 分 5 秒 17 |

18 |

Total: 19 | 2 20 | Fail: 0 21 | Error: 22 | 2

23 |

24 | 25 | 浏览器不支持canvas 26 | 27 |

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | > 59 | > 61 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | > 72 | > 74 | 77 |
测试ID所属模块测试点测试标题重要程度预期结果执行结果错误日志错误截图
1登录模块登录正确登录进入首页error 错误日志 60 | 62 | 截图 63 |
2登录模块登录 正常登录1进入首页error 错误日志 73 | 75 | 截图 76 |
78 | 134 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_55_12_error/test_login12017-09-30_13_55_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_13_55_12_error/test_login12017-09-30_13_55_12.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_55_12_error/test_login2017-09-30_13_55_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_13_55_12_error/test_login2017-09-30_13_55_12.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_55_12_error/正常登录1.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 13:56:10,387 - log.py[line:88] - INFO: run 正常登录1. 3 | 2017-09-30 13:56:10,387 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/27150381-4803-42c2-8e1b-1d4de004512e/element {"using": "xpath", "sessionId": "27150381-4803-42c2-8e1b-1d4de004512e", "value": "//*[@id=\"loginForm\"]/div[1]/div[1]/div[2]/input"} 4 | 2017-09-30 13:56:14,227 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 13:56:14,229 - creat_case.py[line:116] - ERROR: Message: An element could not be located on the page using the given search parameters. 6 | 7 | 2017-09-30 13:56:14,229 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/27150381-4803-42c2-8e1b-1d4de004512e/screenshot {"sessionId": "27150381-4803-42c2-8e1b-1d4de004512e"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_13_55_12_error/正确登录.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 13:55:54,275 - log.py[line:88] - INFO: run 正确登录. 3 | 2017-09-30 13:55:54,275 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/ba5564e8-6a75-495d-bbbe-0c510807cbea/context {"sessionId": "ba5564e8-6a75-495d-bbbe-0c510807cbea", "name": "WEBVIEW"} 4 | 2017-09-30 13:55:54,336 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 13:55:54,336 - creat_case.py[line:116] - ERROR: Message: No such context found. 6 | 7 | 2017-09-30 13:55:54,338 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/ba5564e8-6a75-495d-bbbe-0c510807cbea/screenshot {"sessionId": "ba5564e8-6a75-495d-bbbe-0c510807cbea"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_14_00_50.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nidone测试报告 6 | 7 | 8 |

nidone6测试报告

9 |

测速开始时间: 10 | 2017-09-30 14:00:50.888000 11 |

12 |

测试结束时间: 13 | 2017-09-30 14:02:15.899000 14 |

15 |

测试耗时: 16 | 0 天 0 小时 1 分 25 秒 17 |

18 |

Total: 19 | 2 20 | Fail: 0 21 | Error: 22 | 2

23 |

24 | 25 | 浏览器不支持canvas 26 | 27 |

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | > 59 | > 61 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | > 72 | > 74 | 77 |
测试ID所属模块测试点测试标题重要程度预期结果执行结果错误日志错误截图
1登录模块登录正确登录进入首页error 错误日志 60 | 62 | 截图 63 |
2登录模块登录 正常登录1进入首页error 错误日志 73 | 75 | 截图 76 |
78 | 134 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_14_00_50_error/test_login12017-09-30_14_00_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_14_00_50_error/test_login12017-09-30_14_00_50.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_14_00_50_error/test_login2017-09-30_14_00_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_14_00_50_error/test_login2017-09-30_14_00_50.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_14_00_50_error/正常登录1.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 14:02:08,176 - log.py[line:88] - INFO: start 正常登录1. 3 | 2017-09-30 14:02:08,176 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/e8f2ed1c-6c09-44c1-89dc-1f4feb8a88fe/element {"using": "xpath", "sessionId": "e8f2ed1c-6c09-44c1-89dc-1f4feb8a88fe", "value": "//*[@id=\"loginForm\"]/div[1]/div[1]/div[2]/input"} 4 | 2017-09-30 14:02:11,984 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 14:02:11,984 - creat_case.py[line:116] - ERROR: Message: An element could not be located on the page using the given search parameters. 6 | 7 | 2017-09-30 14:02:11,984 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/e8f2ed1c-6c09-44c1-89dc-1f4feb8a88fe/screenshot {"sessionId": "e8f2ed1c-6c09-44c1-89dc-1f4feb8a88fe"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_14_00_50_error/正确登录.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 14:01:52,079 - log.py[line:88] - INFO: start 正确登录. 3 | 2017-09-30 14:01:52,079 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/ec2a7757-b462-4839-99eb-1f2d658d37f3/context {"sessionId": "ec2a7757-b462-4839-99eb-1f2d658d37f3", "name": "WEBVIEW"} 4 | 2017-09-30 14:01:52,144 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 14:01:52,144 - creat_case.py[line:116] - ERROR: Message: No such context found. 6 | 7 | 2017-09-30 14:01:52,144 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/ec2a7757-b462-4839-99eb-1f2d658d37f3/screenshot {"sessionId": "ec2a7757-b462-4839-99eb-1f2d658d37f3"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_15_16_19_error/error.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_15_16_56.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nidone测试报告 6 | 7 | 8 |

nidone6测试报告

9 | 25 |
测试开始时间: 1231 
 26 | 	测试结束时间:                  123213 
 27 | 	测试耗时:  123123 
 28 | 	
29 |

30 | 31 | 浏览器不支持canvas 32 | 33 |

46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | > 65 | > 67 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | > 78 | > 80 | 83 |
测试ID所属模块测试点测试标题重要程度预期结果执行结果错误日志错误截图
1登录模块登录正确登录进入首页error 错误日志 66 | 68 | 截图 69 |
2登录模块登录 正常登录1进入首页error 错误日志 79 | 81 | 截图 82 |
84 | 140 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_15_16_56_error/test_login12017-09-30_15_16_56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_15_16_56_error/test_login12017-09-30_15_16_56.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_15_16_56_error/test_login2017-09-30_15_16_56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/Test_Report/2017-09-30_15_16_56_error/test_login2017-09-30_15_16_56.png -------------------------------------------------------------------------------- /Test_Report/2017-09-30_15_16_56_error/正常登录1.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 15:17:39,026 - log.py[line:88] - INFO: start 正常登录1. 3 | 2017-09-30 15:17:39,026 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc/element {"using": "xpath", "sessionId": "88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc", "value": "//*[@id=\"loginForm\"]/div[1]/div[1]/div[2]/input"} 4 | 2017-09-30 15:17:42,963 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 15:17:42,963 - creat_case.py[line:116] - ERROR: Message: An element could not be located on the page using the given search parameters. 6 | 7 | 2017-09-30 15:17:42,963 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc/screenshot {"sessionId": "88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-09-30_15_16_56_error/正确登录.txt: -------------------------------------------------------------------------------- 1 | 2 | 2017-09-30 15:17:18,055 - log.py[line:88] - INFO: start 正确登录. 3 | 2017-09-30 15:17:18,055 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/f88143b3-e106-40c2-a083-bba26bcc5728/context {"sessionId": "f88143b3-e106-40c2-a083-bba26bcc5728", "name": "WEBVIEW"} 4 | 2017-09-30 15:17:18,130 - remote_connection.py[line:565] - DEBUG: Finished Request 5 | 2017-09-30 15:17:18,130 - creat_case.py[line:116] - ERROR: Message: No such context found. 6 | 7 | 2017-09-30 15:17:18,131 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/f88143b3-e106-40c2-a083-bba26bcc5728/screenshot {"sessionId": "f88143b3-e106-40c2-a083-bba26bcc5728"} 8 | -------------------------------------------------------------------------------- /Test_Report/2017-11-23_16_46_27_error/error.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /case.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case.xls -------------------------------------------------------------------------------- /case/AllCase.py: -------------------------------------------------------------------------------- 1 | # coding:utf-8 2 | import unittest 3 | import os 4 | # 用例路径 5 | case_path = os.path.join(os.getcwd()) 6 | # 报告存放路径 7 | 8 | 9 | # 获取所有py文件中所有test开头的用力 10 | def all_case(): 11 | discover = unittest.defaultTestLoader.discover(case_path, 12 | pattern="test*.py", 13 | top_level_dir=None) 14 | return discover 15 | 16 | 17 | def run_case(): 18 | runner = unittest.TextTestRunner() 19 | runner.run(all_case()) 20 | -------------------------------------------------------------------------------- /case/AllCase.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case/AllCase.pyc -------------------------------------------------------------------------------- /case/Get_Driver.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月21日 5 | 6 | @author: li tao 7 | """ 8 | import os 9 | from appium import webdriver 10 | from common import Get_Phone 11 | from common import Path 12 | from common import log 13 | from common import creat_case 14 | from Exception import Custom_exception 15 | PATH = lambda p: os.path.abspath(os.path.join(os.path.dirname(__file__), p)) 16 | 17 | 18 | class Driver: 19 | """ 20 | 初始化driver 21 | """ 22 | @log.deco(u'初始化driver') 23 | def __init__(self): 24 | try: 25 | desired_caps = {} 26 | desired_caps['platformName'] = 'Android' 27 | desired_caps['platformVersion'] = Get_Phone.get_android_version() # 设备版本 28 | desired_caps['deviceName'] = Get_Phone.get_device_name() # 设备名称 29 | desired_caps['app'] = PATH(Path.scan_files(postfix='.apk')) # 待测应用 30 | # desired_caps['appPackage'] = 'com.sixty.nidoneClient' 31 | # desired_caps['appActivity'] = 'com.sixty.nidoneClient.view.activity.SDK_WebApp' 32 | desired_caps['unicodeKeyboard'] = True 33 | desired_caps['resetKeyboard'] = True 34 | # 如果设置的是app在电脑上的路径,则不需要配appPackage和appActivity,同理反之 35 | self.driver = webdriver.Remote("http://localhost:4723/wd/hub", desired_caps) 36 | except Exception as e: 37 | creat_case.exception_handling(e) 38 | raise Custom_exception.GetDriverError 39 | 40 | def get_driver(self): 41 | return self.driver 42 | 43 | -------------------------------------------------------------------------------- /case/Get_Driver.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case/Get_Driver.pyc -------------------------------------------------------------------------------- /case/Test_Case.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | import unittest 4 | from common import log 5 | from common import operation 6 | from common import creat_case 7 | # 测试用例 8 | 9 | 10 | class ParametrizedTestCase(unittest.TestCase): 11 | """ TestCase classes that want to be parametrized should 12 | inherit from this class. 13 | """ 14 | def __init__(self, method_name="runTest", run_time=None): 15 | super(ParametrizedTestCase, self).__init__(method_name) 16 | self.method_name = method_name 17 | 18 | 19 | class Test(ParametrizedTestCase): 20 | def setUp(self): 21 | self.OP = operation.Opera() 22 | 23 | def tearDown(self): 24 | self.OP.quit() 25 | 26 | @log.deco(u"正确登录") 27 | def test_login(self): 28 | try: 29 | self.OP.sw_h5() 30 | self.OP.send_keys("login", "账号", "18202886913") 31 | self.OP.clicks("login", "密码") 32 | self.OP.send_keys("login", "密码", "123456") 33 | self.OP.clicks("login", "登录") 34 | except Exception as e: 35 | creat_case.exception_handling(e, index=1, test_name="正确登录", method_name=self.method_name, op=self.OP) 36 | 37 | @log.deco(u"正常登录1") 38 | def test_login1(self): 39 | try: 40 | self.OP.sw_app() 41 | self.OP.send_keys("login", "账号", "18202886911") 42 | self.OP.clicks("login", "密码") 43 | self.OP.send_keys("login", "密码", "123") 44 | self.OP.clicks("login", "登录") 45 | except Exception as e: 46 | creat_case.exception_handling(e, index=2, test_name="正常登录1", method_name=self.method_name, op=self.OP) 47 | -------------------------------------------------------------------------------- /case/Test_Case.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case/Test_Case.pyc -------------------------------------------------------------------------------- /case/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case/__init__.py -------------------------------------------------------------------------------- /case/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case/__init__.pyc -------------------------------------------------------------------------------- /case/run.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月23日 5 | 6 | @author: li tao 7 | """ 8 | import logging 9 | 10 | from case import AllCase 11 | from common import creat_case 12 | from common import log 13 | from common import server 14 | from common import del_past_dir 15 | from Report import generate_test_report 16 | 17 | 18 | if __name__ == '__main__': 19 | try: 20 | log.log_config() # 初始化日志配置 21 | server.start_server() # 开启appium服务 22 | creat_case.test_case() # 初始化用例脚本 23 | AllCase.run_case() # 执行用例 24 | server.stop_server() # 关闭appium服务 25 | generate_test_report.ab(creat_case.test_result_list()) # 创建测试报告 26 | del_past_dir.delete_fp() # 删除过期的测试报告和log日志 27 | except Exception as e: 28 | logging.exception("ERROR") 29 | print(e) 30 | -------------------------------------------------------------------------------- /case/run_list.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | 执行测试用例list 5 | """ 6 | 7 | 8 | # case_num 总的测试用例数量 9 | def test_case_list(case_num): 10 | while True: 11 | try: 12 | all_or_part = input('请选择:1.运行全部用例 2.运行部分用例\n''》》') 13 | if int(all_or_part) == 2: 14 | while True: 15 | try: 16 | print('-'*50) 17 | print("请输入您要测试的用例范围 q=返回上一菜单") 18 | fist = input("开始用例编号》》 ") 19 | if fist == 'q': 20 | break 21 | elif int(fist) < 1: 22 | print("输入有误!!\n开始用例序号必须大于等于1") 23 | end = input("结尾用例编号》》") 24 | if end == 'q': 25 | break 26 | elif int(end) >= case_num: 27 | print("输入有误!!\n结束用例序号不能大于用例数量") 28 | elif int(fist) > int(end): 29 | print("输入有误!!\n用例开始序号不能大于结束序号") 30 | else: 31 | return int(fist), int(end)+1 32 | except: 33 | print("输入有误!!1") 34 | elif int(all_or_part) == 1: 35 | print(case_num) 36 | return 1, case_num 37 | except: 38 | print('输入有误') -------------------------------------------------------------------------------- /case/run_list.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/case/run_list.pyc -------------------------------------------------------------------------------- /common/Element.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月22日 5 | 6 | @author: li tao 7 | """ 8 | from selenium.webdriver.common.by import By 9 | from selenium.webdriver.support.ui import WebDriverWait 10 | from selenium.webdriver.support import expected_conditions as EC 11 | from appium.webdriver.common.touch_action import TouchAction 12 | from Exception import Custom_exception 13 | from common import creat_case 14 | 15 | 16 | class Element: 17 | """ 18 | 封装Appium中关于元素对象的方法 19 | """ 20 | 21 | def __init__(self, driver): 22 | self.driver = driver 23 | 24 | def get(self, message): 25 | """ 26 | 获取页面元素 27 | :param message: 单个元素信息列表包含,方式type, 超时时间time, 值value 28 | :return: 29 | """ 30 | way, timeout, value = message 31 | way_list = ['xpath', 'id', 'ids', 'name', 'classes_name', 'accessibility_id'] 32 | for i in way_list: 33 | if i == way and i == 'xpath': 34 | element = self.driver.find_element_by_xpath(value) 35 | return element 36 | elif i == way and i == 'id': 37 | element = self.driver.find_element_by_id(value) 38 | return element 39 | elif i == way and i == 'ids': 40 | elements = self.driver.find_elements_by_id(value) 41 | return elements 42 | elif i == way and i == 'name': 43 | element = self.driver.find_element_by_name(value) 44 | return element 45 | elif i == way and i == 'classes_name': 46 | elements = self.driver.find_elements_by_class_name(value) 47 | return elements 48 | elif i == way and i == 'accessibility_id': 49 | elements = self.driver.find_element_by_accessibility_id(value) 50 | return elements 51 | else: 52 | raise Custom_exception.WrongLocation 53 | 54 | def wait_element(self, message): 55 | """ 56 | 等待页面元素加载 57 | :param message: 单个元素信息列表包含,方式tpye, 超时时间time, 值value 58 | :return: 59 | """ 60 | way, timeout, value = message 61 | timeout = int(timeout) 62 | way_list = ['xpath', 'id', 'name', 'classes_name'] 63 | for i in way_list: 64 | if i == way and i == 'xpath': 65 | element = WebDriverWait(self.driver, timeout).until(EC.presence_of_element_located((By.XPATH, value))) 66 | return element 67 | elif i == way and i == 'id': 68 | element = WebDriverWait(self.driver, timeout).until(EC.presence_of_element_located((By.ID, value))) 69 | return element 70 | elif i == way and i == 'name': 71 | element = WebDriverWait(self.driver, timeout).until(EC.presence_of_element_located((By.NAME, value))) 72 | return element 73 | elif i == way and i == 'classes_name': 74 | element = WebDriverWait(self.driver, timeout).until(EC.presence_of_element_located((By.CLASS_NAME, value))) 75 | return element 76 | else: 77 | raise Custom_exception.WrongLocation 78 | 79 | def over(self): 80 | """ 81 | 关闭driver 82 | :return: 83 | """ 84 | try: 85 | element = self.driver.quit() 86 | return element 87 | except Exception as e: 88 | creat_case.exception_handling(e) 89 | 90 | def get_screen(self, path): 91 | """ 92 | 截图 93 | :param path: 图片存放路径 94 | :return: 95 | """ 96 | self.driver.get_screenshot_as_file(path) 97 | 98 | def get_size(self): 99 | """ 100 | 获取屏幕大小 101 | :return: 102 | """ 103 | size = self.driver.get_window_size() 104 | return size 105 | 106 | def swipe_to_up(self): 107 | """ 108 | 向上移动 109 | :return: 110 | """ 111 | window_size = self.get_size() 112 | width = window_size.get("width") 113 | height = window_size.get("height") 114 | self.driver.swipe(width / 2, height * 3 / 4, width / 2, height / 4, 500) 115 | 116 | def swipe_to_down(self): 117 | """ 118 | 向下移动 119 | :return: 120 | """ 121 | window_size = self.get_size() 122 | width = window_size.get("width") 123 | height = window_size.get("height") 124 | self.driver.swipe(width / 2, height / 4, width / 2, height * 3 / 4, 500) 125 | 126 | def swipe_to_left(self): 127 | """ 128 | 向左移动 129 | :return: 130 | """ 131 | window_size = self.get_size() 132 | width = window_size.get("width") 133 | height = window_size.get("height") 134 | self.driver.swipe(width / 4, height / 2, width * 3 / 4, height / 2, 500) 135 | 136 | def swipe_to_right(self): 137 | """ 138 | 向右移动 139 | :return: 140 | """ 141 | window_size = self.get_size() 142 | width = window_size.get("width") 143 | height = window_size.get("height") 144 | self.driver.swipe(width * 4 / 5, height / 2, width / 5, height / 2, 500) 145 | 146 | def back(self): 147 | """ 148 | 物理键返回 149 | :return: 150 | """ 151 | self.driver.keyevent(4) 152 | 153 | def switch_h5(self): 154 | """ 155 | 切换至webview 156 | :return: 157 | """ 158 | self.driver.switch_to.context("WEBVIEW") 159 | 160 | def switch_app(self): 161 | """ 162 | 切换至app原生页面 163 | :return: 164 | """ 165 | self.driver.switch_to.context("NATIVE_APP") 166 | 167 | def get_page(self, key): 168 | """ 169 | 获取当前页面的树形结构源代码,与uiautomatorviewer截屏所展示出来的结构是相同的,判断是否存在,不存在返回-1 170 | :param key: 171 | :return: 172 | """ 173 | return self.driver.page_source.find(key) 174 | 175 | def friend_shake(self): 176 | """ 177 | 摇一摇手机 178 | :return: 179 | """ 180 | self.driver.shake() 181 | -------------------------------------------------------------------------------- /common/Element.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/Element.pyc -------------------------------------------------------------------------------- /common/Get_Phone.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月21日 5 | 6 | @author: li tao 7 | """ 8 | 9 | import subprocess 10 | import logging 11 | import re 12 | 13 | 14 | def connect_dvs(): 15 | """ 16 | 检查设备是否连接成功,如果成功返回True,否则返回False 17 | """ 18 | try: 19 | """ 20 | 获取设备列表信息,并用"\r\n"拆分 21 | """ 22 | device_info = subprocess.check_output('adb devices').split("\r\n") 23 | """ 24 | 如果没有链接设备或者设备读取失败,第二个元素为空 25 | """ 26 | if device_info[1] == '': 27 | return False 28 | else: 29 | return True 30 | except Exception as e: 31 | logging.error("Device Connect Fail:", e) 32 | 33 | 34 | def get_android_version(): 35 | try: 36 | if connect_dvs(): 37 | # 获取系统设备系统信息 38 | sys_info = subprocess.check_output('adb shell cat /system/build.prop') 39 | # 获取安卓版本号 40 | android_version = re.findall("version.release=(\d\.\d)*", sys_info, re.S)[0] 41 | return android_version 42 | else: 43 | return "Connect Fail,Please reconnect Device..." 44 | except Exception as e: 45 | logging.error("Get Android Version:", e) 46 | 47 | 48 | def get_device_name(): 49 | try: 50 | if connect_dvs(): 51 | # 获取设备名 52 | device_info = subprocess.check_output('adb devices -l') 53 | device_nam = re.findall(r'device product:(.*)\smodel', device_info, re.S)[0] 54 | return device_nam 55 | else: 56 | return "Connect Fail,Please reconnect Device..." 57 | except Exception as e: 58 | logging.error("Get Device Name:", e) 59 | -------------------------------------------------------------------------------- /common/Get_Phone.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/Get_Phone.pyc -------------------------------------------------------------------------------- /common/Global.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月24日 5 | 6 | @author: li tao 7 | """ 8 | from BasePage.ReadXml import BastPage 9 | from common import Path 10 | 11 | 12 | class Locator: 13 | """ 14 | 获取元素的定位方式,超时及定位值 15 | """ 16 | 17 | def __init__(self): 18 | self.page = BastPage(Path.scan_files(prefix='page')) 19 | 20 | def get_type(self, page_name, locator): 21 | l = self.page.run(page_name, locator) 22 | return l['type'], l['timeOut'], l['value'] -------------------------------------------------------------------------------- /common/Global.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/Global.pyc -------------------------------------------------------------------------------- /common/Path.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月21日 5 | 6 | @author: li tao 7 | """ 8 | # 封装配置文件地址 9 | import os 10 | 11 | from common import runtime, mkdir_log_directory 12 | 13 | pwd = os.getcwd() 14 | father_path = os.path.abspath(os.path.dirname(pwd)+os.path.sep+".") 15 | 16 | 17 | def report_path(): 18 | """ 19 | 测试报告 20 | :return: 21 | """ 22 | path = father_path+'\\Test_Report\\' 23 | return path 24 | 25 | 26 | def log_path(): 27 | """ 28 | 日志位置 29 | :return: 30 | """ 31 | path = father_path + '\\log\\'+runtime.test_start_time()+'\\' 32 | mkdir_log_directory.mk_dir(path) 33 | return path 34 | 35 | 36 | def scan_files(prefix=None, postfix=None): 37 | """ 38 | 返回文件绝对路径 39 | :param prefix: 匹配前缀文件 40 | :param postfix: 匹配后缀文件 41 | :return: 42 | """ 43 | files_list = [] 44 | for root, sub_dirs, files in os.walk(father_path): 45 | for special_file in files: 46 | if postfix: 47 | if special_file.endswith(postfix): 48 | files_list.append(os.path.join(root, special_file)) 49 | elif prefix: 50 | if special_file.startswith(prefix): 51 | files_list.append(os.path.join(root, special_file)) 52 | else: 53 | files_list.append(os.path.join(root, special_file)) 54 | return files_list[0] 55 | -------------------------------------------------------------------------------- /common/Path.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/Path.pyc -------------------------------------------------------------------------------- /common/ReadData.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | """ 3 | Created on 2017年5月5日 4 | 5 | @author: lt 6 | """ 7 | # 读取测试用例 8 | import xlrd as xlrd 9 | 10 | from Exception import Custom_exception 11 | from common import Path, creat_case 12 | 13 | case = [] 14 | 15 | 16 | class ReadCaseExcel: 17 | # fp 测试用例路径 18 | def __init__(self): 19 | global case 20 | try: 21 | self.data = xlrd.open_workbook(Path.scan_files(postfix='case.xls')) 22 | case = self.data.sheet_by_name(u'测试用例') 23 | self.case_num = case.nrows # 测试用例行数 24 | except Exception as e: 25 | creat_case.exception_handling(e) 26 | raise Custom_exception.OpenXlsError 27 | 28 | @staticmethod 29 | def result_list(first, end): 30 | """ 31 | 构造测试结果表 32 | :param first: 开始用例编号 33 | :param end: 结束用例编号 34 | :return: 35 | """ 36 | global case 37 | results = [] 38 | for case_id in range(first, end): 39 | single_results = [] 40 | number = int(case.row(case_id)[0].value) 41 | mod_ule = case.row(case_id)[1].value.encode('utf8') 42 | test_point = case.row(case_id)[2].value.encode('utf8') 43 | test_name = case.row(case_id)[4].value.encode('utf8') 44 | degree_of_importance = case.row(case_id)[5].value.encode('utf8') 45 | expected_result = case.row(case_id)[6].value.encode('utf8') 46 | single_results.append(number) 47 | single_results.append(mod_ule) 48 | single_results.append(test_point) 49 | single_results.append(test_name) 50 | single_results.append(degree_of_importance) 51 | single_results.append(expected_result) 52 | results.append(single_results) 53 | return results 54 | 55 | def case_num(self): 56 | """ 57 | 用例条数 58 | :return: 59 | """ 60 | return self.case_num 61 | 62 | 63 | class ReadStepExcel: 64 | """ 65 | fp 测试步骤表路径 66 | case 测试用例数据列表 67 | """ 68 | def __init__(self): 69 | global case 70 | try: 71 | self.data = xlrd.open_workbook(Path.scan_files(postfix='step.xls')) 72 | self.procedure = self.data.sheet_by_name(u'测试步骤') 73 | self.procedure_num = self.procedure.nrows # 测试步骤行数 74 | self.case = case 75 | except Exception as e: 76 | creat_case.exception_handling(e) 77 | raise Custom_exception.OpenXlsError 78 | 79 | def get_case_desc(self, case_id): 80 | """ 81 | 根据传入的测试用例case_id,获得该case的操作步骤 82 | :param case_id: 测试用例编号 83 | :return: 84 | """ 85 | # pattern = re.compile(ur'[1-9]\d*') # 正则用于匹配数字 86 | # pattern1 = re.compile("'(.*?)'") # 正则用于匹配字符串 87 | test_procedure = [] # 用例操作步骤列表 88 | index = int(self.case.row(case_id)[0].value) 89 | # 用例标题 90 | test_title = self.case.row(case_id)[4].value.encode("utf8") 91 | # test_title = pattern1.findall(str(self.case.row(case_id)[4]).decode("unicode_escape").encode("utf8"))[0] 92 | # 用例方法名称 93 | test_name = self.case.row(case_id)[3].value.encode("utf8") 94 | # test_name = pattern1.findall(str(self.case.row(case_id)[3]).decode("unicode_escape").encode("utf8"))[0] 95 | test_procedure.append(index) 96 | test_procedure.append(test_title) 97 | test_procedure.append(test_name) 98 | for i in range(1, self.procedure_num): 99 | case = int(self.procedure.row(i)[0].value) 100 | # case = int(pattern.findall(str(self.procedure.row(i)[0]))[0]) 101 | if case == case_id: # 判断操作步骤表中的用例与传入的用例相同 102 | # 操作步骤序号 103 | procedure = int(self.procedure.row(i)[1].value) 104 | # procedure = int(pattern.findall(str(self.procedure.row(i)[1]))[0]) 105 | # 操作方法 106 | operation = self.procedure.row(i)[3].value.encode('utf8') 107 | # operation = pattern1.findall(str(self.procedure.row(i)[3]).decode("unicode_escape").encode("utf8"))[0] 108 | # 元素pageName 109 | page_name = self.procedure.row(i)[4].value.encode('utf8') 110 | # page_name = pattern1.findall(str(self.procedure.row(i)[4]).decode("unicode_escape").encode("utf8"))[0] 111 | # 定位元素类型 112 | type_element = self.procedure.row(i)[5].value.encode('utf8') 113 | # type_element = pattern1.findall(str(self.procedure.row(i)[5]) 114 | # .decode("unicode_escape").encode("utf8"))[0] 115 | # 定位数值 116 | try: 117 | value = self.procedure.row(i)[6].value.encode('utf8') 118 | # value = pattern1.findall(str(self.procedure.row(i)[6]).decode("unicode_escape").encode("utf8"))[0] 119 | except: 120 | value = int(self.procedure.row(i)[6].value) 121 | # value = int(pattern.findall(str(self.procedure.row(i)[6]))[0]) 122 | case_element = [procedure, operation, 123 | page_name, type_element, value] 124 | test_procedure.append(case_element) 125 | # 根据步骤id排序 126 | count = len(test_procedure) 127 | for index in range(1, count): 128 | key = test_procedure[index][0] 129 | j = index - 1 130 | while j >= 3: 131 | if test_procedure[j][0] >= key: 132 | mobile_list = test_procedure[j + 1] 133 | test_procedure[j + 1] = test_procedure[j] 134 | key = mobile_list[0] 135 | test_procedure[j] = mobile_list 136 | j -= 1 137 | return test_procedure # 单用例执行步骤 138 | -------------------------------------------------------------------------------- /common/ReadData.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/ReadData.pyc -------------------------------------------------------------------------------- /common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/__init__.py -------------------------------------------------------------------------------- /common/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/__init__.pyc -------------------------------------------------------------------------------- /common/creat_case.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月22日 5 | 6 | @author: li tao 7 | """ 8 | import xlwt as xlwt 9 | 10 | from case import run_list 11 | from Exception import Custom_exception 12 | import logging 13 | import logging.config 14 | from common import ReadData, Path, runtime, mkdir_log_directory, log 15 | 16 | l = [] 17 | 18 | 19 | @log.deco('初始化用例') 20 | def test_case(): 21 | global l 22 | case_excel = ReadData.ReadCaseExcel() 23 | ob = ReadData.ReadStepExcel() 24 | fist, end = run_list.test_case_list(case_excel.case_num) 25 | l = ReadData.ReadCaseExcel.result_list(fist, end) 26 | try: 27 | f = open(Path.scan_files(prefix='Test_Case'), 'w') 28 | except Exception as e: 29 | raise Custom_exception.CreatTestCaseError 30 | f.write('#! /usr/bin/python\n') 31 | f.write('# -*- coding:utf-8 -*-\n') 32 | f.write('import unittest\n') 33 | f.write('from common import log\n') 34 | f.write('from common import operation\n') 35 | f.write('from common import creat_case\n') 36 | f.write('# 测试用例\n') 37 | f.write('\n') 38 | f.write('\n') 39 | f.write('class ParametrizedTestCase(unittest.TestCase):\n') 40 | f.write(' """ TestCase classes that want to be parametrized should\n') 41 | f.write(' inherit from this class.\n') 42 | f.write(' """\n') 43 | f.write(' def __init__(self, method_name="runTest", run_time=None):\n') 44 | f.write(' super(ParametrizedTestCase, self).__init__(method_name)\n') 45 | f.write(' self.method_name = method_name\n') 46 | f.write('\n') 47 | f.write('\n') 48 | f.write('class Test(ParametrizedTestCase):\n') 49 | f.write(' def setUp(self):\n') 50 | f.write(' self.OP = operation.Opera()\n') 51 | f.write('\n') 52 | f.write(' def tearDown(self):\n') 53 | f.write(' self.OP.quit()\n') 54 | for i in range(fist, end): 55 | f.write('\n') 56 | f.write(' @log.deco(u"%s")\n' % ob.get_case_desc(i)[1]) 57 | f.write(' def %s(self):\n' % ob.get_case_desc(i)[2]) 58 | f.write(' try:\n') 59 | for j in range(3, len(ob.get_case_desc(i))): 60 | # 等待 61 | if ob.get_case_desc(i)[j][1] == 'sleep': 62 | f.write(' time.sleep(%s)\n' % ob.get_case_desc(i)[j][4]) 63 | # 切换 h5 64 | elif ob.get_case_desc(i)[j][1] == 'sw_h5': 65 | f.write(' self.OP.sw_h5()\n') 66 | # 切换app 67 | elif ob.get_case_desc(i)[j][1] == 'sw_app': 68 | f.write(' self.OP.sw_app()\n') 69 | # 输入 70 | elif ob.get_case_desc(i)[j][1] == 'send_keys': 71 | f.write(' self.OP.send_keys("%s", "%s", "%s")\n' 72 | % (ob.get_case_desc(i)[j][2], ob.get_case_desc(i)[j][3], ob.get_case_desc(i)[j][4])) 73 | # 点击 74 | elif ob.get_case_desc(i)[j][1] == 'clicks': 75 | f.write(' self.OP.clicks("%s", "%s")\n' 76 | % (ob.get_case_desc(i)[j][2], ob.get_case_desc(i)[j][3])) 77 | # 等待 78 | elif ob.get_case_desc(i)[j][1] == 'wait_element': 79 | f.write(' self.OP.wait_element("%s", "%s")\n' 80 | % (ob.get_case_desc(i)[j][2], ob.get_case_desc(i)[j][3])) 81 | # 物理键返回 82 | elif ob.get_case_desc(i)[j][1] == 'go_back': 83 | f.write(' self.OP.go_back()\n') 84 | # 向上滑动 85 | elif ob.get_case_desc(i)[j][1] == 'swipe_up': 86 | f.write(' self.OP.swipe_up()\n') 87 | # 向下滑动 88 | elif ob.get_case_desc(i)[j][1] == 'swipe_to_down': 89 | f.write(' self.OP.swipe_to_down()\n') 90 | # 向左滑动 91 | elif ob.get_case_desc(i)[j][1] == 'swipe_to_left': 92 | f.write(' self.OP.swipe_to_left()\n') 93 | # 向右滑动 94 | elif ob.get_case_desc(i)[j][1] == 'swipe_to_right': 95 | f.write(' self.OP.swipe_to_right()\n') 96 | # 判断页面内容是否存在 97 | elif ob.get_case_desc(i)[j][1] == 'page_element': 98 | f.write(' self.OP.judge_key("%s", "%s", "%s")\n' 99 | % (ob.get_case_desc(i)[j][2], ob.get_case_desc(i)[j][3], ob.get_case_desc(i)[j][4])) 100 | elif ob.get_case_desc(i)[j][1] == 'set_keys': 101 | f.write(' self.OP.set_keys("%s", "%s", "%s")\n' 102 | % (ob.get_case_desc(i)[j][2], ob.get_case_desc(i)[j][3], ob.get_case_desc(i)[j][4])) 103 | elif ob.get_case_desc(i)[j][1] == 'shake': 104 | f.write(' self.OP.shake()\n') 105 | f.write(' except Exception as e:\n') 106 | f.write(' creat_case.exception_handling(e, index=%s, test_name="%s", method_name=self.method_name,' 107 | ' op=self.OP)' % (ob.get_case_desc(i)[0], ob.get_case_desc(i)[1])) 108 | f.write('\n') 109 | try: 110 | f.close() 111 | except Exception as e: 112 | logging.error(e) 113 | raise Custom_exception.CloseFileError 114 | 115 | 116 | def exception_handling(e, index=None, test_name=None, method_name=None, op=None): 117 | """ 118 | 错误处理 119 | :param e: 报错内容 120 | :param index: 用例编号 121 | :param test_name: 测试用例名称 122 | :param method_name: 测试用例对应方法 123 | :param op: 操作驱动 124 | :return: 125 | """ 126 | global l 127 | logging.error(e) 128 | path = Path.report_path() + runtime.test_start_time() + '_error' 129 | mkdir_log_directory.mk_dir(path) # 创建错误日志目录 130 | path1 = Path.log_path() + runtime.test_start_time() + '.log' 131 | if index: 132 | log_error = path + '\\' + test_name.decode('utf8') + '.txt' # 记录错误日志文件 133 | way = path + '\\' + method_name + runtime.test_start_time() + '.png' 134 | op.screen(way, path) # 截图 135 | log.error_log(path1, log_error, test_name) 136 | if 'AssertionError' in e: 137 | for i in range(0, len(l)): 138 | if index == l[i][0]: 139 | l[i].append('fail') 140 | l[i].append(log_error) 141 | l[i].append(way) 142 | else: 143 | for i in range(0, len(l)): 144 | if index == l[i][0]: 145 | l[i].append('error') 146 | l[i].append(log_error) 147 | l[i].append(way) 148 | else: 149 | log_error = path + '\\' + 'error.txt' # 记录错误日志文件 150 | log.error_log(path1, log_error) 151 | 152 | 153 | # 定义表格属性 154 | def set_style(name, height, bold=False): 155 | style = xlwt.XFStyle() # 初始化样式 156 | font = xlwt.Font() # 为样式创建字体 157 | font.name = name 158 | font.bold = bold 159 | font.color_index = 4 160 | font.height = height 161 | style.font = font 162 | return style 163 | 164 | 165 | def write_excel(): 166 | """ 167 | 初始化结果表 168 | :return: 169 | """ 170 | global l 171 | # 创建工作簿 172 | try: 173 | workbook = xlwt.Workbook(encoding='utf-8') 174 | # 创建sheet 175 | data_sheet = workbook.add_sheet('测试结果') 176 | except Exception as e: 177 | exception_handling(e) 178 | raise Custom_exception.InitResultError 179 | title = ['用例ID', '所属模块', '测试点', '用例描述', '重要程度', '预期结果', '实际结果', '错误日志', '错误截图'] 180 | try: 181 | for i in range(len(title)): 182 | data_sheet.write(0, i, title[i]) 183 | for j in range(len(l)): 184 | for index in range(len(l[j])): 185 | if l[j][6] is None and index == 6: 186 | data_sheet.write(j+1, 6, 'success') 187 | continue 188 | data_sheet.write(j+1, index, l[j][index]) 189 | except Exception as e: 190 | exception_handling(e) 191 | raise Custom_exception.WriteResultError 192 | try: 193 | # 保存文件 194 | workbook.save(Path.father_path+u'\\测试结果.xls') 195 | except Exception as e: 196 | exception_handling(e) 197 | raise Custom_exception.SaveReusltError 198 | 199 | 200 | def test_result_list(): 201 | global l 202 | return l 203 | -------------------------------------------------------------------------------- /common/creat_case.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/creat_case.pyc -------------------------------------------------------------------------------- /common/del_past_dir.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年9月30日 5 | 6 | @author: li tao 7 | """ 8 | import shutil 9 | import time 10 | import datetime 11 | import os 12 | import logging 13 | 14 | 15 | # 删除文件 16 | from common import Path 17 | 18 | 19 | def delete_fp(): 20 | try: 21 | lg = [Path.father_path+'\\log', Path.report_path()] 22 | for j in lg: 23 | if os.path.exists(j): 24 | ls = os.listdir(j) 25 | for i in range(0, len(ls)): 26 | path = os.path.join(lg, ls[i]) 27 | if os.path.exists(path): 28 | create_time = time.localtime(os.stat(path).st_ctime) # 文件最后访问时间 29 | y = time.strftime('%Y', create_time) 30 | m = time.strftime('%m', create_time) 31 | d = time.strftime('%d', create_time) 32 | h = time.strftime('%H', create_time) 33 | M = time.strftime('%M', create_time) 34 | d2 = datetime.datetime(int(y), int(m), int(d), int(h), int(M)) # 格式化时间 35 | time_difference = (datetime.datetime.now()-d2).days # 计算时间差 36 | if time_difference >= 2: # 时间差超过10天,则删除 37 | shutil.rmtree(path) 38 | else: 39 | logging.warning('日志或测试报告文件夹不存在') 40 | except Exception as e: 41 | logging.error(e) 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /common/del_past_dir.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/del_past_dir.pyc -------------------------------------------------------------------------------- /common/log.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月24日 5 | 6 | @author: li tao 7 | """ 8 | import logging 9 | import logging.config 10 | from Exception import Custom_exception 11 | 12 | from common import Path, runtime 13 | 14 | 15 | def log_config(): 16 | try: 17 | logger = logging.getLogger() 18 | logger.setLevel(logging.DEBUG) # Log等级总开关 19 | # 第二步,创建一个handler,用于写入日志文件 20 | logfile = Path.log_path()+runtime.test_start_time()+'.log' 21 | fh = logging.FileHandler(logfile, mode='w+') 22 | fh.setLevel(logging.DEBUG) # 输出到file的log等级的开关 23 | # 第三步,再创建一个handler,用于输出到控制台 24 | ch = logging.StreamHandler() 25 | ch.setLevel(logging.DEBUG) # 输出到console的log等级的开关 26 | # 第四步,定义handler的输出格式 27 | formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s") 28 | fh.setFormatter(formatter) 29 | ch.setFormatter(formatter) 30 | # 第五步,将logger添加到handler里面 31 | logger.addHandler(fh) 32 | logger.addHandler(ch) 33 | logging.info('测试开始时间:%s' %runtime. test_start_time()) 34 | # logging.basicConfig(level=logging.DEBUG, 35 | # format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', 36 | # datefmt='%a, %d %b %Y %H:%M:%S', 37 | # filename=Path.log_path()+runtime.test_start_time()+'.log', 38 | # filemode='w') 39 | except Exception as e: 40 | print(e) 41 | raise Custom_exception.LogConfigError 42 | 43 | 44 | # def screen_shot(path, test_name): 45 | # try: 46 | # os.popen("adb wait-for-device") 47 | # os.popen("adb shell screencap -p /data/local/tmp/tmp.png") 48 | # os.popen("adb pull /data/local/tmp/tmp.png " + (path + "/" + test_name + ".jpg")) 49 | # os.popen("adb shell rm /data/local/tmp/tmp.png") 50 | # logging.info('错误截图已保存在 '+path) 51 | # except Exception as e: 52 | # logging.error('截图失败:%s '% e) 53 | 54 | 55 | # file 运行日志存放路径 56 | # path 错误日志存放路径 57 | # test_name 日志记录开始位标志 58 | def error_log(fp, path, test_name=None): 59 | try: 60 | f = open(fp) 61 | data = f.readlines() 62 | num = len(data) 63 | r = open(path, 'w+') 64 | r.writelines('\n') 65 | for i in range(0, len(data) - 1): 66 | if test_name in data[i]: 67 | for j in range(i, num - 2): 68 | r.writelines(data[j]) 69 | if test_name is None: 70 | if num <= 50: 71 | for j in range(0, num-1): 72 | r.writelines(data[j]) 73 | else: 74 | for j in range(num-50, num-1): 75 | r.writelines(data[j]) 76 | r.close() 77 | f.close() 78 | logging.info('记录错误日志') 79 | except Exception as e: 80 | logging.error(e) 81 | 82 | 83 | # 日志打印装饰器 84 | def deco(arg): 85 | def _deco(func): 86 | def __deco(*args, **kwargs): 87 | logging.info(" start %s." % arg) 88 | func(*args, **kwargs) 89 | logging.info(" %s success." % arg) 90 | return __deco 91 | return _deco 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /common/log.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/log.pyc -------------------------------------------------------------------------------- /common/mkdir_log_directory.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月28日 5 | 6 | @author: li tao 7 | """ 8 | import os 9 | 10 | 11 | def mk_dir(path): 12 | # 去除首位空格 13 | path = path.strip() 14 | # 去除尾部 \ 符号 15 | path = path.rstrip("\\") 16 | 17 | # 判断路径是否存在 18 | # 存在 True 19 | # 不存在 False 20 | is_exists = os.path.exists(path) 21 | 22 | # 判断结果 23 | if not is_exists: 24 | try: 25 | # 如果不存在则创建目录 26 | # 创建目录操作函数 27 | os.makedirs(path) 28 | except Exception as e: 29 | print(e) 30 | else: 31 | # 如果目录存在则不创建,并提示目录已存在 32 | pass 33 | -------------------------------------------------------------------------------- /common/mkdir_log_directory.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/mkdir_log_directory.pyc -------------------------------------------------------------------------------- /common/operation.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月24日 5 | 6 | @author: li tao 7 | """ 8 | import logging 9 | from case import Get_Driver 10 | from Exception import Custom_exception 11 | from common import Element, Global 12 | 13 | 14 | class Opera: 15 | """ 16 | 用户操作封装 17 | """ 18 | def __init__(self): 19 | self.dr = Get_Driver.Driver() 20 | self.D = Element.Element(self.dr.get_driver()) 21 | self.p = Global.Locator() 22 | 23 | def clicks(self, page_name, locator): 24 | """ 25 | 点击事件 26 | :param page_name: 页面名称 27 | :param locator: 元素名称 28 | :return: 29 | """ 30 | self.D.get(self.p.get_type(page_name, locator)).click() 31 | 32 | def send_keys(self, page_name, locator, text): 33 | """ 34 | 调用输入法输入 35 | :param page_name: 页面元素 36 | :param locator: 元素名称 37 | :param text: 输入内容 38 | :return: 39 | """ 40 | self.D.get(self.p.get_type(page_name, locator)).send_keys(text) 41 | 42 | def set_keys(self, page_name, locator, text): 43 | """ 44 | 直接对元素输入文本 45 | :param page_name: 页面元素 46 | :param locator: 元素名称 47 | :param text: 输入内容 48 | :return: 49 | """ 50 | self.D.get(self.p.get_type(page_name, locator)).set_text(text) 51 | 52 | def get_text(self, page_name, locator): 53 | """ 54 | 获取元素文本 55 | :param page_name: 页面名称 56 | :param locator: 元素名称 57 | :return: 58 | """ 59 | element_text = self.D.get(self.p.get_type(page_name, locator)).text.encode('utf-8') 60 | return element_text 61 | 62 | def wait_element(self, page_name, locator): 63 | """ 64 | 等待页面元素 65 | :param page_name: 页面名称 66 | :param locator: 元素名称 67 | :return: 68 | """ 69 | self.D.wait_element(self.p.get_type(page_name, locator)) 70 | 71 | def go_back(self): 72 | """ 73 | 物理键返回 74 | :return: 75 | """ 76 | self.D.back() 77 | 78 | def sw_h5(self): 79 | """ 80 | 切换webview 81 | :return: 82 | """ 83 | self.D.switch_h5() 84 | 85 | def sw_app(self): 86 | """ 87 | 切换至原生页面 88 | :return: 89 | """ 90 | self.D.switch_app() 91 | 92 | def quit(self): 93 | """ 94 | 关闭dirver 95 | :return: 96 | """ 97 | self.D.over() 98 | 99 | def getsize(self): 100 | """ 101 | 获取页面大小 102 | :return: 103 | """ 104 | size = self.D.get_size() 105 | return size 106 | 107 | def swipe_up(self): 108 | """ 109 | 向上移动 110 | :return: 111 | """ 112 | self.D.swipe_to_up() 113 | 114 | def swipe_to_down(self): 115 | """ 116 | 向下移动 117 | :return: 118 | """ 119 | self.D.swipe_to_down() 120 | 121 | def swipe_to_left(self): 122 | """ 123 | 向左移动 124 | :return: 125 | """ 126 | self.D.swipe_to_left() 127 | 128 | def swipe_to_right(self): 129 | """ 130 | 向右移动 131 | :return: 132 | """ 133 | self.D.swipe_to_right() 134 | 135 | def screen(self, name, path): 136 | """ 137 | 截图 138 | :param name: 截图名称 139 | :param path: 截图存储路径 140 | :return: 141 | """ 142 | try: 143 | self.D.get_screen(name) 144 | logging.info('错误截图已保存在 ' + path) 145 | except Exception as e: 146 | logging.error('截图失败:%s ' % e) 147 | 148 | def judge_key(self, key): 149 | """ 150 | 判断页面元素是否存在 151 | :param key: 152 | :return: 153 | """ 154 | if self.D.get_page(key) == -1: 155 | raise Custom_exception.ElementNotExist 156 | 157 | def shake(self): 158 | """ 159 | 摇一摇手机 160 | :return: 161 | """ 162 | self.D.friend_shake() 163 | -------------------------------------------------------------------------------- /common/operation.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/operation.pyc -------------------------------------------------------------------------------- /common/runtime.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年8月22日 5 | 6 | @author: li tao 7 | """ 8 | import time 9 | import datetime 10 | 11 | from common import creat_case 12 | 13 | try: 14 | runtime = time.strftime('%Y-%m-%d_%H_%M_%S', time.localtime(time.time())) 15 | start_time = datetime.datetime.now() 16 | except Exception as e: 17 | creat_case.exception_handling(e) 18 | 19 | 20 | def test_start_time(): 21 | return runtime 22 | 23 | 24 | def start_time_test(): 25 | return start_time 26 | -------------------------------------------------------------------------------- /common/runtime.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/runtime.pyc -------------------------------------------------------------------------------- /common/server.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # -*- coding:utf-8 -*- 3 | """ 4 | Created on 2017年9月30日 5 | 6 | @author: li tao 7 | """ 8 | import subprocess 9 | import logging 10 | import os 11 | import requests 12 | import time 13 | 14 | from common import Path, runtime 15 | 16 | 17 | def start_server(): 18 | cmd = 'taskkill /F /IM node.exe' 19 | logging.info(cmd) 20 | os.system(cmd) 21 | logging.info('启动appium服务') 22 | try: 23 | cd = 'start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600' 24 | logging.info(cd) 25 | subprocess.call(cd, shell=True, stdout=open(Path.log_path()+runtime.test_start_time()+'appium.log', 'w'), 26 | stderr=subprocess.STDOUT) 27 | appium_server_url = 'http://localhost:4723/wd/hub/' 28 | logging.info(appium_server_url) 29 | time.sleep(5) 30 | response = requests.get(appium_server_url) 31 | print(response.status_code) 32 | if response.status_code is 404: 33 | logging.info('appium服务启动成!!') 34 | else: 35 | raise Exception 36 | except Exception as a: 37 | logging.error('启动appium服务失败 %s' % a) 38 | 39 | 40 | def stop_server(): 41 | logging.info('关闭appium服务') 42 | try: 43 | cmd = 'taskkill /F /IM node.exe' 44 | logging.info(cmd) 45 | os.system(cmd) 46 | logging.info('关闭appium服务成功!!!') 47 | except Exception as e: 48 | logging.error('关闭appium服务失败!!!\n%s' % e) -------------------------------------------------------------------------------- /common/server.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/common/server.pyc -------------------------------------------------------------------------------- /log/2017-09-30_15_16_19/2017-09-30_15_16_19.log: -------------------------------------------------------------------------------- 1 | 2017-09-30 15:16:20,052 - log.py[line:34] - INFO: 测试开始时间:2017-09-30_15_16_19 2 | 2017-09-30 15:16:20,052 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-09-30 15:16:20,142 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-09-30 15:16:20,142 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-09-30 15:16:20,173 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-09-30 15:16:20,178 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-09-30 15:16:22,186 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-09-30 15:16:22,187 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-09-30 15:16:22,187 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | 2017-09-30 15:16:38,071 - log.py[line:90] - INFO: 初始化用例脚本 success. 11 | 2017-09-30 15:16:38,117 - log.py[line:88] - INFO: start 初始化driver. 12 | 2017-09-30 15:16:40,272 - remote_connection.py[line:222] - INFO: Could not get IP address for host: localhost 13 | 2017-09-30 15:16:40,272 - remote_connection.py[line:478] - DEBUG: POST http://localhost:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "R7", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": "4.4", "platformName": "Android"}} 14 | 2017-09-30 15:16:42,279 - remote_connection.py[line:565] - DEBUG: Finished Request 15 | 2017-09-30 15:16:42,279 - creat_case.py[line:116] - ERROR: Message: [Fiddler] The connection to 'localhost' failed.
Error: ConnectionRefused (0x274d).
System.Net.Sockets.SocketException 由于目标计算机积极拒绝,无法连接。 127.0.0.1:4723 16 | 17 | 2017-09-30 15:16:42,280 - log.py[line:81] - ERROR: 'in ' requires string as left operand, not NoneType 18 | 2017-09-30 15:16:42,282 - log.py[line:88] - INFO: start 初始化driver. 19 | 2017-09-30 15:16:44,434 - remote_connection.py[line:222] - INFO: Could not get IP address for host: localhost 20 | 2017-09-30 15:16:44,434 - remote_connection.py[line:478] - DEBUG: POST http://localhost:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "R7", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": "4.4", "platformName": "Android"}} 21 | 2017-09-30 15:16:46,444 - remote_connection.py[line:565] - DEBUG: Finished Request 22 | 2017-09-30 15:16:46,446 - creat_case.py[line:116] - ERROR: Message: [Fiddler] The connection to 'localhost' failed.
Error: ConnectionRefused (0x274d).
System.Net.Sockets.SocketException 由于目标计算机积极拒绝,无法连接。 127.0.0.1:4723 23 | 24 | 2017-09-30 15:16:46,451 - log.py[line:81] - ERROR: 'in ' requires string as left operand, not NoneType 25 | 2017-09-30 15:16:46,453 - server.py[line:37] - INFO: 关闭appium服务 26 | 2017-09-30 15:16:46,453 - server.py[line:40] - INFO: start /b taskkill /F /IM node.exe 27 | 2017-09-30 15:16:46,480 - server.py[line:42] - INFO: 关闭appium服务成功!!! 28 | -------------------------------------------------------------------------------- /log/2017-09-30_15_16_19/2017-09-30_15_16_19appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-09-30_15_16_19/2017-09-30_15_16_19appium.log -------------------------------------------------------------------------------- /log/2017-09-30_15_16_56/2017-09-30_15_16_56.log: -------------------------------------------------------------------------------- 1 | 2017-09-30 15:16:56,161 - log.py[line:34] - INFO: 测试开始时间:2017-09-30_15_16_56 2 | 2017-09-30 15:16:56,161 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-09-30 15:16:56,187 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-09-30 15:16:56,187 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-09-30 15:16:56,219 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-09-30 15:16:56,223 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-09-30 15:16:58,233 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-09-30 15:16:58,234 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-09-30 15:16:58,234 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | 2017-09-30 15:17:01,937 - log.py[line:90] - INFO: 初始化用例脚本 success. 11 | 2017-09-30 15:17:01,982 - log.py[line:88] - INFO: start 初始化driver. 12 | 2017-09-30 15:17:03,145 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "R7", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": "4.4", "platformName": "Android"}} 13 | 2017-09-30 15:17:18,052 - remote_connection.py[line:565] - DEBUG: Finished Request 14 | 2017-09-30 15:17:18,052 - log.py[line:90] - INFO: 初始化driver success. 15 | 2017-09-30 15:17:18,055 - log.py[line:88] - INFO: start 正确登录. 16 | 2017-09-30 15:17:18,055 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/f88143b3-e106-40c2-a083-bba26bcc5728/context {"sessionId": "f88143b3-e106-40c2-a083-bba26bcc5728", "name": "WEBVIEW"} 17 | 2017-09-30 15:17:18,130 - remote_connection.py[line:565] - DEBUG: Finished Request 18 | 2017-09-30 15:17:18,130 - creat_case.py[line:116] - ERROR: Message: No such context found. 19 | 20 | 2017-09-30 15:17:18,131 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/f88143b3-e106-40c2-a083-bba26bcc5728/screenshot {"sessionId": "f88143b3-e106-40c2-a083-bba26bcc5728"} 21 | 2017-09-30 15:17:19,299 - remote_connection.py[line:565] - DEBUG: Finished Request 22 | 2017-09-30 15:17:19,299 - operation.py[line:81] - INFO: 错误截图已保存在 H:\project\python_appium\Test_Report\2017-09-30_15_16_56_error 23 | 2017-09-30 15:17:19,302 - log.py[line:79] - INFO: 记录错误日志 24 | 2017-09-30 15:17:19,302 - log.py[line:90] - INFO: 正确登录 success. 25 | 2017-09-30 15:17:19,302 - remote_connection.py[line:478] - DEBUG: DELETE http://127.0.0.1:4723/wd/hub/session/f88143b3-e106-40c2-a083-bba26bcc5728 {"sessionId": "f88143b3-e106-40c2-a083-bba26bcc5728"} 26 | 2017-09-30 15:17:20,894 - remote_connection.py[line:565] - DEBUG: Finished Request 27 | 2017-09-30 15:17:20,895 - log.py[line:88] - INFO: start 初始化driver. 28 | 2017-09-30 15:17:22,020 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "R7", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": "4.4", "platformName": "Android"}} 29 | 2017-09-30 15:17:39,023 - remote_connection.py[line:565] - DEBUG: Finished Request 30 | 2017-09-30 15:17:39,023 - log.py[line:90] - INFO: 初始化driver success. 31 | 2017-09-30 15:17:39,026 - log.py[line:88] - INFO: start 正常登录1. 32 | 2017-09-30 15:17:39,026 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session/88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc/element {"using": "xpath", "sessionId": "88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc", "value": "//*[@id=\"loginForm\"]/div[1]/div[1]/div[2]/input"} 33 | 2017-09-30 15:17:42,963 - remote_connection.py[line:565] - DEBUG: Finished Request 34 | 2017-09-30 15:17:42,963 - creat_case.py[line:116] - ERROR: Message: An element could not be located on the page using the given search parameters. 35 | 36 | 2017-09-30 15:17:42,963 - remote_connection.py[line:478] - DEBUG: GET http://127.0.0.1:4723/wd/hub/session/88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc/screenshot {"sessionId": "88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc"} 37 | 2017-09-30 15:17:45,207 - remote_connection.py[line:565] - DEBUG: Finished Request 38 | 2017-09-30 15:17:45,213 - operation.py[line:81] - INFO: 错误截图已保存在 H:\project\python_appium\Test_Report\2017-09-30_15_16_56_error 39 | 2017-09-30 15:17:45,213 - log.py[line:79] - INFO: 记录错误日志 40 | 2017-09-30 15:17:45,213 - log.py[line:90] - INFO: 正常登录1 success. 41 | 2017-09-30 15:17:45,213 - remote_connection.py[line:478] - DEBUG: DELETE http://127.0.0.1:4723/wd/hub/session/88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc {"sessionId": "88f6a4ee-59b2-4a34-b3ec-ead1316ba6cc"} 42 | 2017-09-30 15:17:46,819 - remote_connection.py[line:565] - DEBUG: Finished Request 43 | 2017-09-30 15:17:46,819 - server.py[line:37] - INFO: 关闭appium服务 44 | 2017-09-30 15:17:46,819 - server.py[line:40] - INFO: start /b taskkill /F /IM node.exe 45 | 2017-09-30 15:17:46,846 - server.py[line:42] - INFO: 关闭appium服务成功!!! 46 | 2017-09-30 15:17:46,848 - del_past_dir.py[line:39] - ERROR: coercing to Unicode: need string or buffer, list found 47 | -------------------------------------------------------------------------------- /log/2017-11-23_16_17_27/2017-11-23_16_17_27.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:17:27,878 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_17_27 2 | 2017-11-23 16:17:27,878 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:17:28,075 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:17:28,075 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:17:28,095 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:17:28,095 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:17:30,125 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:17:30,128 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:17:30,128 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_17_27/2017-11-23_16_17_27appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case>More? -------------------------------------------------------------------------------- /log/2017-11-23_16_18_53/2017-11-23_16_18_53.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:18:53,732 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_18_53 2 | 2017-11-23 16:18:53,732 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:18:53,752 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:18:53,752 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:18:53,773 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:18:53,773 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:18:55,815 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:18:55,815 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:18:55,815 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_18_53/2017-11-23_16_18_53appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_18_53/2017-11-23_16_18_53appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_19_22/2017-11-23_16_19_22.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:19:22,661 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_19_22 2 | 2017-11-23 16:19:22,661 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:19:22,680 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:19:22,680 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:19:22,700 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:19:22,710 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:19:24,732 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:19:24,732 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:19:24,732 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_19_22/2017-11-23_16_19_22appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_19_22/2017-11-23_16_19_22appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_22_01/2017-11-23_16_22_01.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:22:01,505 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_22_01 2 | 2017-11-23 16:22:01,505 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:22:01,525 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:22:01,525 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:22:01,545 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:22:01,555 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:22:03,595 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:22:03,595 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:22:03,595 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_22_01/2017-11-23_16_22_01appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_22_01/2017-11-23_16_22_01appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_23_58/2017-11-23_16_23_58.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:23:58,210 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_23_58 2 | 2017-11-23 16:23:58,210 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:23:58,230 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:23:58,230 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:23:58,250 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:23:58,250 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:24:00,295 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:24:00,295 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:24:00,295 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_23_58/2017-11-23_16_23_58appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_23_58/2017-11-23_16_23_58appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_25_18/2017-11-23_16_25_18.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:25:18,776 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_25_18 2 | 2017-11-23 16:25:18,776 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:25:18,788 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:25:18,788 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:25:18,808 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:25:18,818 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:25:20,846 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:25:20,846 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:25:20,846 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_25_18/2017-11-23_16_25_18appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case>More? -------------------------------------------------------------------------------- /log/2017-11-23_16_25_52/2017-11-23_16_25_52.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:25:53,076 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_25_52 2 | 2017-11-23 16:25:53,076 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:25:53,096 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:25:53,096 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:25:53,117 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:25:53,117 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:25:55,157 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:25:55,157 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:25:55,157 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_25_52/2017-11-23_16_25_52appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_25_52/2017-11-23_16_25_52appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_26_15/2017-11-23_16_26_15.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:26:15,960 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_26_15 2 | 2017-11-23 16:26:15,960 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:26:15,980 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:26:15,980 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:26:15,990 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:26:16,000 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:26:18,026 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:26:18,026 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:26:18,026 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_26_15/2017-11-23_16_26_15appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_26_15/2017-11-23_16_26_15appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_26_45/2017-11-23_16_26_45.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:26:45,668 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_26_45 2 | 2017-11-23 16:26:45,678 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:26:45,688 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:26:45,688 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:26:45,709 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:26:45,719 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:26:47,746 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:26:47,746 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:26:47,746 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_26_45/2017-11-23_16_26_45appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_26_45/2017-11-23_16_26_45appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_28_09/2017-11-23_16_28_09.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:28:09,342 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_28_09 2 | 2017-11-23 16:28:09,342 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:28:09,352 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:28:09,352 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:28:09,382 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:28:09,382 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:28:11,417 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:28:11,417 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:28:11,417 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_28_09/2017-11-23_16_28_09appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case>More? -------------------------------------------------------------------------------- /log/2017-11-23_16_28_41/2017-11-23_16_28_41.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:28:41,625 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_28_41 2 | 2017-11-23 16:28:41,625 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:28:41,644 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:28:41,644 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:28:41,664 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:28:41,674 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:28:43,703 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:28:43,703 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:28:43,703 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_28_41/2017-11-23_16_28_41appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_28_41/2017-11-23_16_28_41appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_29_23/2017-11-23_16_29_23.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:29:23,421 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_29_23 2 | 2017-11-23 16:29:23,421 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:29:23,441 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:29:23,441 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:29:23,461 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:29:23,461 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:29:25,497 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:29:25,497 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:29:25,497 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_29_23/2017-11-23_16_29_23appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_16_29_34/2017-11-23_16_29_34.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:29:34,914 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_29_34 2 | 2017-11-23 16:29:34,914 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:29:34,934 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:29:34,934 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:29:34,953 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:29:34,963 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:29:36,997 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:29:37,000 - server.py[line:31] - INFO: appium服务启动成!! 9 | 2017-11-23 16:29:37,000 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_29_34/2017-11-23_16_29_34appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_16_33_36/2017-11-23_16_33_36.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:33:36,246 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_33_36 2 | 2017-11-23 16:33:36,246 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | -------------------------------------------------------------------------------- /log/2017-11-23_16_34_28/2017-11-23_16_34_28.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:34:28,648 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_34_28 2 | 2017-11-23 16:34:28,648 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | -------------------------------------------------------------------------------- /log/2017-11-23_16_35_46/2017-11-23_16_35_46.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:35:46,289 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_35_46 2 | 2017-11-23 16:35:46,289 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | -------------------------------------------------------------------------------- /log/2017-11-23_16_37_03/2017-11-23_16_37_03.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:37:03,371 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_37_03 2 | 2017-11-23 16:37:03,371 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | -------------------------------------------------------------------------------- /log/2017-11-23_16_37_31/2017-11-23_16_37_31.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:37:31,862 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_37_31 2 | 2017-11-23 16:37:31,862 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | -------------------------------------------------------------------------------- /log/2017-11-23_16_37_48/2017-11-23_16_37_48.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:37:48,776 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_37_48 2 | 2017-11-23 16:37:48,776 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | -------------------------------------------------------------------------------- /log/2017-11-23_16_38_19/2017-11-23_16_38_19.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:38:19,546 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_38_19 2 | 2017-11-23 16:38:19,546 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | 2017-11-23 16:38:20,851 - log.py[line:90] - INFO: 初始化用例脚本 success. 4 | 2017-11-23 16:38:21,201 - log.py[line:88] - INFO: start 初始化driver. 5 | 2017-11-23 16:38:22,578 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": null, "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": null, "platformName": "Android"}} 6 | -------------------------------------------------------------------------------- /log/2017-11-23_16_40_08/2017-11-23_16_40_08.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:40:08,279 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_40_08 2 | 2017-11-23 16:40:08,279 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:40:08,299 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:40:08,299 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:40:08,319 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:40:08,319 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:40:10,351 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:40:10,351 - server.py[line:30] - INFO: appium服务启动成!! 9 | 2017-11-23 16:40:10,351 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_40_08/2017-11-23_16_40_08appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case>More? -------------------------------------------------------------------------------- /log/2017-11-23_16_40_42/2017-11-23_16_40_42.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:40:42,469 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_40_42 2 | 2017-11-23 16:40:42,469 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:40:42,479 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:40:42,479 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:40:42,499 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:40:42,509 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:40:44,548 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:40:44,548 - server.py[line:30] - INFO: appium服务启动成!! 9 | 2017-11-23 16:40:44,548 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_40_42/2017-11-23_16_40_42appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case>More? -------------------------------------------------------------------------------- /log/2017-11-23_16_41_06/2017-11-23_16_41_06.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:41:06,299 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_41_06 2 | 2017-11-23 16:41:06,299 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:41:06,319 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:41:06,319 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:41:06,339 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:41:06,339 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:41:08,371 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:41:08,371 - server.py[line:30] - INFO: appium服务启动成!! 9 | 2017-11-23 16:41:08,371 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_41_06/2017-11-23_16_41_06appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_41_06/2017-11-23_16_41_06appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_41_29/2017-11-23_16_41_29.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:41:29,936 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_41_29 2 | 2017-11-23 16:41:29,936 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:41:29,956 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:41:29,956 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:41:29,976 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:41:29,986 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:41:32,013 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:41:32,013 - server.py[line:30] - INFO: appium服务启动成!! 9 | 2017-11-23 16:41:32,013 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_41_29/2017-11-23_16_41_29appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case>More? -------------------------------------------------------------------------------- /log/2017-11-23_16_42_47/2017-11-23_16_42_47.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:42:47,160 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_42_47 2 | 2017-11-23 16:42:47,160 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:42:47,180 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:42:47,180 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:42:47,200 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:42:47,200 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:42:49,240 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:42:49,240 - server.py[line:30] - INFO: appium服务启动成!! 9 | 2017-11-23 16:42:49,240 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_42_47/2017-11-23_16_42_47appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_42_47/2017-11-23_16_42_47appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_43_30/2017-11-23_16_43_30.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:43:30,174 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_43_30 2 | 2017-11-23 16:43:30,174 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:43:30,194 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:43:30,194 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:43:30,214 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:43:30,214 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:43:32,250 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:43:32,250 - server.py[line:30] - INFO: appium服务启动成!! 9 | 2017-11-23 16:43:32,250 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_43_30/2017-11-23_16_43_30appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_43_30/2017-11-23_16_43_30appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_44_51/2017-11-23_16_44_51.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:44:51,851 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_44_51 2 | 2017-11-23 16:44:51,851 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:44:51,871 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:44:51,871 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:44:51,891 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:44:51,891 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:44:51,901 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 16:44:51,901 - log.py[line:88] - INFO: start 初始化用例脚本. 9 | -------------------------------------------------------------------------------- /log/2017-11-23_16_44_51/2017-11-23_16_44_51appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_44_51/2017-11-23_16_44_51appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_45_13/2017-11-23_16_45_13.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:45:13,658 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_45_13 2 | 2017-11-23 16:45:13,658 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:45:13,678 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:45:13,678 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:45:13,707 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:45:13,713 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:45:15,730 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:45:15,732 - log.py[line:88] - INFO: start 初始化用例脚本. 9 | -------------------------------------------------------------------------------- /log/2017-11-23_16_45_13/2017-11-23_16_45_13appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_16_45_49/2017-11-23_16_45_49.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:45:49,194 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_45_49 2 | 2017-11-23 16:45:49,194 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 16:45:49,213 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 16:45:49,213 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 16:45:49,233 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 16:45:49,243 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 16:45:51,279 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 16:45:51,279 - server.py[line:34] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 16:45:51,279 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_16_45_49/2017-11-23_16_45_49appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_16_45_49/2017-11-23_16_45_49appium.log -------------------------------------------------------------------------------- /log/2017-11-23_16_46_27/2017-11-23_16_46_27.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 16:46:27,644 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_16_46_27 2 | 2017-11-23 16:46:27,644 - log.py[line:88] - INFO: start 初始化用例脚本. 3 | 2017-11-23 16:46:29,792 - log.py[line:90] - INFO: 初始化用例脚本 success. 4 | 2017-11-23 16:46:29,842 - log.py[line:88] - INFO: start 初始化driver. 5 | 2017-11-23 16:46:30,898 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "Connect Fail,Please reconnect Device...", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": "Connect Fail,Please reconnect Device...", "platformName": "Android"}} 6 | 2017-11-23 16:46:59,066 - remote_connection.py[line:565] - DEBUG: Finished Request 7 | 2017-11-23 16:46:59,066 - creat_case.py[line:124] - ERROR: Message: A new session could not be created. (Original error: Could not find a connected Android device.) 8 | 9 | 2017-11-23 16:46:59,066 - log.py[line:81] - ERROR: 'in ' requires string as left operand, not NoneType 10 | 2017-11-23 16:46:59,076 - log.py[line:88] - INFO: start 初始化driver. 11 | 2017-11-23 16:47:00,138 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "Connect Fail,Please reconnect Device...", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": "Connect Fail,Please reconnect Device...", "platformName": "Android"}} 12 | 2017-11-23 16:47:27,801 - remote_connection.py[line:565] - DEBUG: Finished Request 13 | 2017-11-23 16:47:27,801 - creat_case.py[line:124] - ERROR: Message: A new session could not be created. (Original error: Could not find a connected Android device.) 14 | 15 | 2017-11-23 16:47:27,803 - log.py[line:81] - ERROR: 'in ' requires string as left operand, not NoneType 16 | 2017-11-23 16:47:27,805 - server.py[line:38] - INFO: 关闭appium服务 17 | 2017-11-23 16:47:27,805 - server.py[line:41] - INFO: start /b taskkill /F /IM node.exe 18 | 2017-11-23 16:47:27,823 - server.py[line:43] - INFO: 关闭appium服务成功!!! 19 | -------------------------------------------------------------------------------- /log/2017-11-23_17_12_12/2017-11-23_17_12_12.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:12:13,266 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_12_12 2 | 2017-11-23 17:12:13,266 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:12:13,357 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:12:13,357 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:12:13,367 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:12:13,397 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): localhost 7 | 2017-11-23 17:12:15,408 - server.py[line:34] - ERROR: 启动appium服务失败 HTTPConnectionPool(host='localhost', port=4723): Max retries exceeded with url: /wd/hub/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 10061] ',)) 8 | 2017-11-23 17:12:15,408 - log.py[line:88] - INFO: start 初始化用例脚本. 9 | -------------------------------------------------------------------------------- /log/2017-11-23_17_12_12/2017-11-23_17_12_12appium.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/log/2017-11-23_17_12_12/2017-11-23_17_12_12appium.log -------------------------------------------------------------------------------- /log/2017-11-23_17_20_17/2017-11-23_17_20_17.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:20:17,492 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_20_17 2 | 2017-11-23 17:20:17,492 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:20:17,512 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:20:17,512 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:20:17,532 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:20:17,532 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): localhost 7 | 2017-11-23 17:20:19,556 - server.py[line:34] - ERROR: 启动appium服务失败 HTTPConnectionPool(host='localhost', port=4723): Max retries exceeded with url: /wd/hub/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 10061] ',)) 8 | 2017-11-23 17:20:19,556 - log.py[line:88] - INFO: start 初始化用例脚本. 9 | -------------------------------------------------------------------------------- /log/2017-11-23_17_20_17/2017-11-23_17_20_17appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_20_37/2017-11-23_17_20_37.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:20:37,891 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_20_37 2 | 2017-11-23 17:20:37,891 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:20:37,901 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:20:37,901 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:20:37,943 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:20:37,943 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:20:40,002 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 17:20:40,002 - server.py[line:34] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:20:40,002 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_20_37/2017-11-23_17_20_37appium.log: -------------------------------------------------------------------------------- 1 | (node:6904) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | info: --> GET /wd/hub/ {} 7 | info: [debug] Responding to client that we did not find a valid resource 8 | info: <-- GET /wd/hub/ 404 6.195 ms - 47  9 | 10 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_20_48/2017-11-23_17_20_48.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:20:48,325 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_20_48 2 | 2017-11-23 17:20:48,325 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:20:48,335 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:20:48,335 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:20:48,355 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:20:48,355 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:20:50,415 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:20:50,415 - server.py[line:34] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:20:50,415 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_20_48/2017-11-23_17_20_48appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_21_04/2017-11-23_17_21_04.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:21:04,186 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_21_04 2 | 2017-11-23 17:21:04,186 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:21:04,196 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:21:04,196 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:21:04,216 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:21:04,226 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:21:06,256 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:21:06,256 - server.py[line:35] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:21:06,256 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_21_04/2017-11-23_17_21_04appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_21_14/2017-11-23_17_21_14.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:21:14,335 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_21_14 2 | 2017-11-23 17:21:14,335 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:21:14,345 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:21:14,345 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:21:14,365 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:21:14,365 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:21:16,407 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:21:16,407 - server.py[line:35] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:21:16,407 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_21_14/2017-11-23_17_21_14appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_21_38/2017-11-23_17_21_38.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:21:38,582 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_21_38 2 | 2017-11-23 17:21:38,582 - server.py[line:40] - INFO: 关闭appium服务 3 | 2017-11-23 17:21:38,582 - server.py[line:43] - INFO: start /b taskkill /F /IM node.exe 4 | 2017-11-23 17:21:38,601 - server.py[line:45] - INFO: 关闭appium服务成功!!! 5 | 2017-11-23 17:21:38,601 - server.py[line:19] - INFO: start /b taskkill /F /IM node.exe 6 | 2017-11-23 17:21:38,621 - server.py[line:21] - INFO: 启动appium服务 7 | 2017-11-23 17:21:38,621 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 8 | 2017-11-23 17:21:38,631 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 9 | 2017-11-23 17:21:38,641 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 10 | 2017-11-23 17:21:40,665 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 11 | 2017-11-23 17:21:40,665 - server.py[line:36] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 12 | 2017-11-23 17:21:40,665 - log.py[line:88] - INFO: start 初始化用例脚本. 13 | -------------------------------------------------------------------------------- /log/2017-11-23_17_21_38/2017-11-23_17_21_38appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_22_09/2017-11-23_17_22_09.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:22:09,628 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_22_09 2 | 2017-11-23 17:22:09,628 - server.py[line:40] - INFO: 关闭appium服务 3 | 2017-11-23 17:22:09,628 - server.py[line:43] - INFO: start /b taskkill /F /IM node.exe 4 | 2017-11-23 17:22:09,648 - server.py[line:45] - INFO: 关闭appium服务成功!!! 5 | 2017-11-23 17:22:09,648 - server.py[line:19] - INFO: start /b taskkill /F /IM node.exe 6 | 2017-11-23 17:22:09,658 - server.py[line:21] - INFO: 启动appium服务 7 | 2017-11-23 17:22:09,658 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 8 | 2017-11-23 17:22:09,678 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 9 | 2017-11-23 17:22:09,678 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 10 | 2017-11-23 17:22:11,701 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 11 | 2017-11-23 17:22:11,701 - server.py[line:36] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 12 | 2017-11-23 17:22:11,701 - log.py[line:88] - INFO: start 初始化用例脚本. 13 | -------------------------------------------------------------------------------- /log/2017-11-23_17_22_09/2017-11-23_17_22_09appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_23_17/2017-11-23_17_23_17.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:23:17,270 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_23_17 2 | 2017-11-23 17:23:17,270 - server.py[line:40] - INFO: 关闭appium服务 3 | 2017-11-23 17:23:17,270 - server.py[line:43] - INFO: start /b taskkill /F /IM node.exe 4 | 2017-11-23 17:23:17,280 - server.py[line:45] - INFO: 关闭appium服务成功!!! 5 | 2017-11-23 17:23:17,280 - server.py[line:19] - INFO: start /b taskkill /F /IM node.exe 6 | 2017-11-23 17:23:17,301 - server.py[line:21] - INFO: 启动appium服务 7 | 2017-11-23 17:23:17,301 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 8 | 2017-11-23 17:23:17,321 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 9 | 2017-11-23 17:23:17,321 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 10 | 2017-11-23 17:23:19,362 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 11 | 2017-11-23 17:23:19,362 - server.py[line:36] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 12 | 2017-11-23 17:23:19,362 - log.py[line:88] - INFO: start 初始化用例脚本. 13 | -------------------------------------------------------------------------------- /log/2017-11-23_17_23_17/2017-11-23_17_23_17appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_25_51/2017-11-23_17_25_51.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:25:51,993 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_25_51 2 | 2017-11-23 17:25:51,993 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:25:52,013 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:25:52,013 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:25:52,043 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:25:52,043 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:25:54,086 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 17:25:54,086 - server.py[line:35] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:25:54,086 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_25_51/2017-11-23_17_25_51appium.log: -------------------------------------------------------------------------------- 1 | (node:16936) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | info: --> GET /wd/hub/ {} 7 | info: [debug] Responding to client that we did not find a valid resource 8 | info: <-- GET /wd/hub/ 404 6.462 ms - 47  9 | 10 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_26_06/2017-11-23_17_26_06.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:26:07,009 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_26_06 2 | 2017-11-23 17:26:07,009 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:26:07,029 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:26:07,029 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:26:07,049 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:26:07,049 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:26:09,086 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:26:09,086 - server.py[line:35] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:26:09,086 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_26_06/2017-11-23_17_26_06appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_26_37/2017-11-23_17_26_37.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:26:37,721 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_26_37 2 | 2017-11-23 17:26:37,721 - server.py[line:18] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:26:37,733 - server.py[line:20] - INFO: 启动appium服务 4 | 2017-11-23 17:26:37,733 - server.py[line:23] - INFO: start /b appium -a 127.0.0.1 -p 4723 5 | 2017-11-23 17:26:37,753 - server.py[line:27] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:26:37,753 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:26:39,786 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:26:39,786 - server.py[line:35] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:26:39,786 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_26_37/2017-11-23_17_26_37appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_31_40/2017-11-23_17_31_40.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:31:41,111 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_31_40 2 | 2017-11-23 17:31:41,111 - server.py[line:19] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:31:41,131 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:31:41,131 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 5 | 2017-11-23 17:31:41,141 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:31:46,151 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:31:48,184 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:31:48,184 - server.py[line:37] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:31:48,184 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_31_40/2017-11-23_17_31_40appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_32_15/2017-11-23_17_32_15.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:32:15,480 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_32_15 2 | 2017-11-23 17:32:15,490 - server.py[line:19] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:32:15,500 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:32:15,500 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:32:15,520 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:32:20,529 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:32:22,542 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 502 None 8 | 2017-11-23 17:32:22,542 - server.py[line:37] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:32:22,542 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_32_15/2017-11-23_17_32_15appium.log: -------------------------------------------------------------------------------- 1 | 2 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_33_20/2017-11-23_17_33_20.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:33:20,549 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_33_20 2 | 2017-11-23 17:33:20,549 - server.py[line:19] - INFO: start /b taskkill /F /IM node.exe 3 | 2017-11-23 17:33:20,569 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:33:20,569 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:33:20,599 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:33:25,601 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:33:26,634 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 17:33:26,634 - server.py[line:37] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:33:26,634 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_33_20/2017-11-23_17_33_20appium.log: -------------------------------------------------------------------------------- 1 | (node:17336) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | info: --> GET /wd/hub/ {} 7 | info: [debug] Responding to client that we did not find a valid resource 8 | info: <-- GET /wd/hub/ 404 6.491 ms - 47  9 | 10 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_35_53/2017-11-23_17_35_53.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:35:54,109 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_35_53 2 | 2017-11-23 17:35:54,111 - server.py[line:19] - INFO: taskkill /F /IM node.exe 3 | 2017-11-23 17:35:54,197 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:35:54,197 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:35:54,207 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:35:59,220 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:36:00,250 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 17:36:00,260 - server.py[line:37] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:36:00,260 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_35_53/2017-11-23_17_35_53appium.log: -------------------------------------------------------------------------------- 1 | (node:9684) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | info: --> GET /wd/hub/ {} 7 | info: [debug] Responding to client that we did not find a valid resource 8 | info: <-- GET /wd/hub/ 404 7.890 ms - 47  9 | 10 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_36_02/2017-11-23_17_36_02.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:36:02,822 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_36_02 2 | 2017-11-23 17:36:02,822 - server.py[line:19] - INFO: taskkill /F /IM node.exe 3 | 2017-11-23 17:36:03,408 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:36:03,408 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:36:03,911 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:36:08,913 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:36:09,943 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 17:36:09,943 - server.py[line:37] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:36:09,943 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | -------------------------------------------------------------------------------- /log/2017-11-23_17_36_02/2017-11-23_17_36_02appium.log: -------------------------------------------------------------------------------- 1 | (node:17116) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | info: --> GET /wd/hub/ {} 7 | info: [debug] Responding to client that we did not find a valid resource 8 | info: <-- GET /wd/hub/ 404 6.552 ms - 47  9 | 10 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_36_11/2017-11-23_17_36_11.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:36:11,663 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_36_11 2 | 2017-11-23 17:36:11,663 - server.py[line:19] - INFO: taskkill /F /IM node.exe 3 | 2017-11-23 17:36:11,723 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:36:11,723 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:36:11,763 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | 2017-11-23 17:36:16,769 - connectionpool.py[line:208] - DEBUG: Starting new HTTP connection (1): 127.0.0.1 7 | 2017-11-23 17:36:17,798 - connectionpool.py[line:396] - DEBUG: http://127.0.0.1:8888 "GET http://localhost:4723/wd/hub/ HTTP/1.1" 404 47 8 | 2017-11-23 17:36:17,798 - server.py[line:37] - ERROR: 启动appium服务失败 exceptions must be old-style classes or derived from BaseException, not NoneType 9 | 2017-11-23 17:36:17,798 - log.py[line:88] - INFO: start 初始化用例脚本. 10 | 2017-11-23 17:36:20,357 - log.py[line:90] - INFO: 初始化用例脚本 success. 11 | 2017-11-23 17:36:20,665 - log.py[line:88] - INFO: start 初始化driver. 12 | 2017-11-23 17:36:25,855 - remote_connection.py[line:478] - DEBUG: POST http://127.0.0.1:4723/wd/hub/session {"capabilities": {"alwaysMatch": {"platformName": "Android"}, "firstMatch": [{}]}, "desiredCapabilities": {"deviceName": "Connect Fail,Please reconnect Device...", "unicodeKeyboard": true, "app": "H:\\project\\python_appium\\app-client-debug.apk", "resetKeyboard": true, "platformVersion": null, "platformName": "Android"}} 13 | -------------------------------------------------------------------------------- /log/2017-11-23_17_36_11/2017-11-23_17_36_11appium.log: -------------------------------------------------------------------------------- 1 | (node:9444) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | info: --> GET /wd/hub/ {} 7 | info: [debug] Responding to client that we did not find a valid resource 8 | info: <-- GET /wd/hub/ 404 6.446 ms - 47  9 | info: --> POST /wd/hub/session {"capabilities":{"alwaysMatch":{"platformName":"Android"},"firstMatch":[{}]},"desiredCapabilities":{"deviceName":"Connect Fail,Please reconnect Device...","unicodeKeyboard":true,"app":"H:\\project\\python_appium\\app-client-debug.apk","resetKeyboard":true,"platformVersion":null,"platformName":"Android"}} 10 | info: Client User-Agent string: Python http auth 11 | info: [debug] No appActivity desired capability or server param. Parsing from apk. 12 | info: [debug] No appPackage desired capability or server param. Parsing from apk. 13 | info: [debug] Using local app from desired caps: H:\project\python_appium\app-client-debug.apk 14 | info: [debug] Creating new appium session d7c2ef37-a25c-4aad-8571-2dc057a3a7fb 15 | info: Starting android appium 16 | info: [debug] Getting Java version 17 | info: Java version is: 1.8.0_101 18 | info: [debug] Checking whether adb is present 19 | info: [debug] Using adb from F:\测试工具安装包\sdk\platform-tools\adb.exe 20 | info: [debug] Parsing package and activity from app manifest 21 | info: [debug] Checking whether aapt is present 22 | info: [debug] Using aapt from F:\测试工具安装包\sdk\build-tools\android-4.4W\aapt.exe 23 | info: [debug] Extracting package and launch activity from manifest. 24 | info: [debug] executing cmd: F:\测试工具安装包\sdk\build-tools\android-4.4W\aapt.exe dump badging H:\project\python_appium\app-client-debug.apk 25 | info: [debug] badging package: com.sixty.nidoneClient 26 | info: [debug] badging act: com.sixty.nidoneClient.view.activity.SDK_WebApp 27 | info: [debug] Parsed package and activity are: com.sixty.nidoneClient/com.sixty.nidoneClient.view.activity.SDK_WebApp 28 | info: [debug] Using fast reset? true 29 | info: [debug] Preparing device for session 30 | info: [debug] Checking whether app is actually present 31 | info: Retrieving device 32 | info: [debug] Trying to find a connected android device 33 | info: [debug] Getting connected devices... 34 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe devices 35 | info: [debug] 0 device(s) connected 36 | info: [debug] Could not find devices, restarting adb server... 37 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe kill-server 38 | info: [debug] Getting connected devices... 39 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe devices 40 | info: [debug] 0 device(s) connected 41 | info: [debug] Could not find devices, restarting adb server... 42 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe kill-server 43 | info: [debug] Getting connected devices... 44 | info: [debug] executing cmd: F:\测试工具安装包\sdk\platform-tools\adb.exe devices 45 | 46 | H:\project\python_appium\case> -------------------------------------------------------------------------------- /log/2017-11-23_17_36_34/2017-11-23_17_36_34.log: -------------------------------------------------------------------------------- 1 | 2017-11-23 17:36:34,236 - log.py[line:34] - INFO: 测试开始时间:2017-11-23_17_36_34 2 | 2017-11-23 17:36:34,236 - server.py[line:19] - INFO: taskkill /F /IM node.exe 3 | 2017-11-23 17:36:34,298 - server.py[line:21] - INFO: 启动appium服务 4 | 2017-11-23 17:36:34,299 - server.py[line:24] - INFO: start /b appium -a 127.0.0.1 -p 4723 --bootstrap-port 9517 --session-override --command-timeout 600 5 | 2017-11-23 17:36:34,306 - server.py[line:28] - INFO: http://localhost:4723/wd/hub/ 6 | -------------------------------------------------------------------------------- /log/2017-11-23_17_36_34/2017-11-23_17_36_34appium.log: -------------------------------------------------------------------------------- 1 | (node:10488) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 2 | info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) 3 | info: Appium REST http interface listener started on 127.0.0.1:4723 4 | info: [debug] Non-default server args: {"address":"127.0.0.1","bootstrapPort":9517,"sessionOverride":true,"defaultCommandTimeout":600} 5 | info: Console LogLevel: debug 6 | -------------------------------------------------------------------------------- /page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 账号 9 | 密码 10 | 登录 11 | 账户或密码错误 12 | 13 | 14 | 15 | 生活 16 | 密码 17 | 登录 18 | 19 | -------------------------------------------------------------------------------- /step.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/step.xls -------------------------------------------------------------------------------- /test_data/Cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githublitao/python-appium/d3959a457d8e93572c1e64525a994a7bf74216e8/test_data/Cover.jpg --------------------------------------------------------------------------------