def report(info): workbook = xlsxwriter.Workbook('report.xlsx') bo = BaseReport.OperateReport(workbook) bo.monitor(info) bo.crash() bo.analysis(info) bo.close()
def report1(info): #dic={'192.168.179.101:5555':{'battery': 'C:\\Users\\yuhui\\Documents\\GitHub\\monkeyTest\\info\\192.168.179.101:5555_battery.pickle','men': 'C:\\Users\\yuhui\\Documents\\GitHub\\monkeyTest\\info\\192.168.179.101:5555_men.pickle','flow': 'C:\\Users\\yuhui\\Documents\\GitHub\\monkeyTest\\info\\192.168.179.101:5555_flow.pickle', 'header': {'monkey_log': 'C:\\Users\\yuhui\\Documents\\GitHub\\monkeyTest\\log\\725748ae-127f-4386-b7eb-f95d851b5806monkey.log', 'kel': '4\xe6\xa0\xb8', 'rom': 2051740, 'beforeBattery': 99, 'afterBattery': 99, 'pix': u'768x1280', 'time': '26\xe7\xa7\x92', 'net': u'wifi', 'phone_name': u'.geny-def]:_.geny-def]:_]:'}, 'fps': 'C:\\Users\\yuhui\\Documents\\GitHub\\monkeyTest\\info\\192.168.179.101:5555_fps.pickle', 'cpu': 'C:\\Users\\yuhui\\Documents\\GitHub\\monkeyTest\\info\\192.168.179.101:5555_cpu.pickle'}} print "info:", info workbook = xlsxwriter.Workbook('report.xlsx') bo = BaseReport.OperateReport(workbook) bo.monitor(info) bo.crash() bo.analysis(info) bo.close()
def report(info): #run_time = time.strftime("%Y%m%d%H%M%S", time.localtime(time.time())) #workbook = xlsxwriter.Workbook('report.' + run_time + '.xlsx') workbook = xlsxwriter.Workbook('performance_report.xlsx') bo = BaseReport.OperateReport(workbook) bo.monitor(info) bo.crash() bo.analysis(info) bo.close()
import xlsxwriter __author__ = 'shikun' import os from Base import AdbCommon from Base import OperateFile from Base import BaseMonkeyConfig import re from Base import BaseCashEmnu as go from Base import BasePhoneMsg from Base import BaseReport from Base import BaseMonitor from Base import BaseAnalysis PATH = lambda p: os.path.abspath(os.path.join(os.path.dirname(__file__), p)) workbook = xlsxwriter.Workbook('report.xlsx') bo = BaseReport.OperateReport(workbook) def get_error(log): crash = [] with open(log, encoding="utf-8") as monkey_log: lines = monkey_log.readlines() for line in lines: if re.findall(go.ANR, line): print("存在anr错误:" + line) crash.append(line) if re.findall(go.CRASH, line): print("存在crash错误:" + line) crash.append(line) if re.findall(go.EXCEPTION, line): print("存在crash错误:" + line)