Android Client Test Online There will always be a lot of channel packages, channel packaging but use automation, but each play is good dozens of or hundreds of apk, very south to determine whether all the channels have been hit, so there is the following section of code, The main purpose is to check whether all the channel packages are packaged:
#Coding=utf-8ImportOSImportxlrd#get all channel numbers in a given Excel listdefadd_qudao_name (): Data=Xlrd.open_workbook (excel_path) Table=data.sheets () [0]#get to the corresponding sheet via the sheet indexNrows=table.nrows#get all the line numbers given by the obtained indexA=[]#Get the data for the second column of each row obtained to the Shett, that is, the channel number forIinchXrange (1, nrows): s=table.cell_value (i,1). Encode ('Utf-8'). Strip () A.append (s)returna#intercepts the channel number from the specified packaged apk file namedefFind_package_name (start_str,end_str,name): Start=Name.find (START_STR)ifstart>=0:end=name.find (END_STR)-1ifend>=0:returnName[start:end]#Filter Whether existing channel numbers are all packaged and completeddefcheck_package_name (): Channels=Add_qudao_name () a=[] forIinchOs.listdir (All_apk_path): s=find_package_name ('A','R', i)ifs!=None:a.append (s) b=[] forMinchChannels:ifM not inch(a): B.append (m)returnbif __name__=='__main__': PrintCheck_package_name ()
Use Python to determine if the channel pack for Android Automation is complete