Use Python to determine if the channel pack for Android Automation is complete

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.