CN104320793A - Mobile phone short message automated test method and system - Google Patents

Mobile phone short message automated test method and system Download PDF

Info

Publication number
CN104320793A
CN104320793A CN201410512435.4A CN201410512435A CN104320793A CN 104320793 A CN104320793 A CN 104320793A CN 201410512435 A CN201410512435 A CN 201410512435A CN 104320793 A CN104320793 A CN 104320793A
Authority
CN
China
Prior art keywords
test
tested
item
sms
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410512435.4A
Other languages
Chinese (zh)
Other versions
CN104320793B (en
Inventor
陈潇潞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shaanxi Chengtuo Network Co ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410512435.4A priority Critical patent/CN104320793B/en
Publication of CN104320793A publication Critical patent/CN104320793A/en
Application granted granted Critical
Publication of CN104320793B publication Critical patent/CN104320793B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/24Arrangements for testing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a mobile phone short message automated test method and system. The mobile phone short message automated test method includes the following steps which are realized in a first script: information of a preset test requirement file is read, and items to be tested in a mobile phone short message test are determined according to the preset test requirement file, wherein the test requirement file contains a plurality of pieces of test item information which is set with preset formats, and the items to be tested are test items requiring execution; test scripts corresponding to the items to be tested are executed according to each item to be tested, and test result information of the test scripts is obtained, wherein the test result information includes test results, and the test scripts corresponding to the items to be tested are Robotium scripts; and the test result information of the items to be tested is outputted to a test result file. With the mobile phone short message automated test method and system of the technical scheme of the invention adopted, the reusability of testing can be improved, and the automation degree of the testing can be greatly improved.

Description

A kind of Automated testing method of cell phone short messages and system
Technical field
The present invention relates to a kind of mobile phone test, particularly relate to a kind of Automated testing method of cell phone short messages and system.
Background technology
At present, the SMS of mobile phone one of necessary functions becoming mobile phone.SMS is divided into two kinds: a kind of note word that to be user directly sent or received by mobile phone or other telecommunication terminals or digital information, user can receive and send at every turn the number of characters of note, is 160 English or numerical character, or 70 Chinese characters.One is multimedia message, and its maximum characteristic supports multimedia function exactly, can the comprehensive content of propagation function and information, and these information comprise the information of the various multimedia forms such as word, image, sound, data.In the development and testing of mobile phone, short message function test is usually needed to manpower and the time of at substantial, this is because short message function is various, and be not easy to carry out automatic test.The common function of SMS comprises transmission note, answer short message, deleting short message, retrieval note, and note forwards, and note copies, and sends expression, sends the functions such as common phrases.Although the automatic test of more existing technology to short message function has done certain trial, but still there is a large amount of problems.Such as, need the corresponding STE of human configuration before test, really can not realize test automation; Test script depends on mobile phone software and hardware setting to be tested, causes script recycling rate of waterused low; Test script is not easy amendment, is difficult to carry out specific aim and selects test, need artificially to judge test result etc.
Given this, how to find a kind of method that can be good at realizing short message function being carried out to automatic test, become the problem that those skilled in the art expect to solve.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of Automated testing method of cell phone short messages and system, for solve in prior art, the test existed in automatic test is carried out to short message function before need the corresponding STE of human configuration, test script depends on mobile phone software and hardware setting to be tested, test script is not easy amendment, needs artificially judge the problems such as test result.
For achieving the above object and other relevant objects, the invention provides a kind of SMS test automation method, described SMS test automation method realizes following steps in the first script: the information reading the test request file preset, and determines the item to be tested that described SMS is tested accordingly; Multiple test item information arranged with preset format is included in described test request file; Described item to be tested is the test item needing to perform; For item to be tested described in each, perform the test script of described item correspondence to be tested, and obtain the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script; The test result information of described item to be tested is outputted in test result file.
Alternatively, the content of the test script of described item correspondence to be tested comprises: the test operation performing described item to be tested, and judge described test operation complete after result whether be consistent with the default result of described item to be tested, if be consistent, then described test result is for passing through; If do not met, then described test result is unsuccessfully.
Alternatively, the test operation of described item to be tested comprises: perform the operation entering the test interface of described item to be tested, if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is not for pass through.
Alternatively, the test operation of described item to be tested comprises acquisition test sectional drawing, to record the test process of described item to be tested.
Alternatively, do not need the test item of execution for each, generating test result is do not test the test result information of mark, is that the test result information not testing mark outputs in test result file by described test result.
Alternatively, described SMS test automation method is also included in the second script and realizes: carry out signature verification to described first script, and is installed on mobile phone to be tested by described first script.
Alternatively, described SMS test automation method is also included in the 3rd script and realizes: in described mobile phone to be tested, start described first script test, obtain described test result file after test completes.
The present invention also provides a kind of SMS automation system for testing, and described system comprises: SMS test module, and described SMS test module comprises detecting information acquiring unit, test execution unit, test result generation unit; Described detecting information acquiring unit for reading the information of default test request file, and determines the item to be tested that described SMS is tested accordingly; Multiple test item information arranged with preset format is included in described test request file; Described item to be tested is the test item needing to perform; Described test execution unit, is connected with described detecting information acquiring unit, for for item to be tested described in each, performs the test script of described item correspondence to be tested, and obtains the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script; Described test result generation unit, is connected with described test item performance element, for receiving described test result information and exporting described test result information in test result file.
Alternatively, the content of the test script of described item correspondence to be tested comprises: the test operation performing described item to be tested, and judge described test operation complete after result whether be consistent with the default result of described item to be tested, if be consistent, then described test result is successfully; If do not met, then described test result is unsuccessfully.
Alternatively, the test operation of described item to be tested comprises: perform the operation entering the test interface of described item to be tested, if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is unsuccessfully.
Alternatively, the test operation of described item to be tested comprises acquisition test sectional drawing, to record the test process of described item to be tested.
Alternatively, described SMS test module is for the test item not needing in SMS detecting information acquiring unit described in each to perform, generating corresponding test result is do not test the test result information of mark, is that the test result information not testing mark sends to described test result generation unit by described test result.
Alternatively, described SMS automation system for testing also comprises SMS test installation module, for carrying out signature verification to described SMS test module, and in mobile phone to be tested, installs described SMS test module.
Alternatively, described SMS automation system for testing also comprises SMS test starting module, for starting described SMS test module, and obtains described test result file.
As mentioned above, SMS test automation method and system of the present invention, there is following beneficial effect: develop based on Robotium script, operating handset can be carried out based on control ID, avoid as the problem that the needs caused distinguish mobile phone hardware difference and UI variation in script developed by employing MonkeyRunner script, simultaneously, utilize Robotium script can realize judging described test operation complete after result whether be consistent with the default result of described item to be tested, improve automaticity and recycling rate of waterused, reduce maintenance cost.Meanwhile, technical scheme of the present invention have employed the mode of test request file read test information from the multiple test item information arranged with preset format of including of presetting, and is convenient to very much modify to test request.Technical scheme of the present invention additionally provides to be verified and installation the automatic signature of test program, and automatic acquisition test result, greatly simplify the work of SMS test.
Accompanying drawing explanation
Fig. 1 is shown as the schematic flow sheet of SMS test automation method of the present invention.
Fig. 2 is shown as the module diagram of SMS automation system for testing of the present invention.
Fig. 3 is shown as the workflow schematic diagram of SMS automation system for testing of the present invention.
Element numbers explanation
1 SMS automation system for testing
11 SMS test modules
111 detecting information acquiring units
112 test execution unit
113 test result generation units
12 SMS test installation modules
13 SMS test starting modules
S1 ~ S3 step
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.
It should be noted that, the diagram provided in the present embodiment only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
The invention provides a kind of SMS test automation method.As shown in Figure 1, in one embodiment, described SMS test automation method realizes following steps in the first script:
Step S1, reads the information of the test request file preset, and determines the item to be tested that described SMS is tested accordingly; Multiple test item information arranged with preset format is included in described test request file; Described item to be tested is the test item needing to perform.In one embodiment, described test request file is XML file (Setting.xml), and described XML file arranges test item information with preset format.Under described XML file is positioned over default file directory, its form is as follows:
Described first script reads the content of described XML file by CaseControl class, and read content is corresponded to Name and the Execute field of CaseInfo class.Described first script comprises the application that Java language realizes.In described XML with <Case Id=" " > starts the corresponding test item information of content of </Case> ending, the corresponding test case information of each test item information; The value of <Name></NameGrea tT.GreaT.GT wherein corresponds to the Name field of CaseInfo class, and the value of <Execute></Execu te> corresponds to the Execute field of CaseInfo class.The value of <Execute></Execu te> is this test item of 1 expression is the test item needing to perform, i.e. described item to be tested; The value of <Execute></Execu te> is this test item of 0 expression is the test item not needing to perform.Need to import CaseControl jar bag during described first script of editor to the use of described CaseControl class and CaseInfo class.CaseControl jar comprises CaseControl class, XmlHandle class and CaseInfo class in wrapping.Wherein, CaseControl class can be used for: the value reading Setting.xml; Judge whether Case needs to perform; Result is write XML file; Export debugging log information; Sectional drawing is copied to assigned catalogue etc.XmlHandle class can be used for: read XML file; Write (newly-built write) XML file; Analyzing XML file; Export XML file and arrive assigned address etc.CaseInfo class is for storing the various information of Case (test case), and a CaseInfo records the information of a Case (test case), mainly contains: Name field (the execution function name of Test); Execute field (represent whether respective function performs 0 for not perform, 1 for performing).Described CaseInfo class can also comprise: CaseNo field (representing the sequence number of this Case); CaseName field (representing the title of Case); CaseRes field (representing the result of Case); Comment field (representing the remarks after Case execution); MmsToman field (in note test contact phone); MmsText; Field (information of other people will be issued in note test).Described test request file also can be the file of other types, it also can be other preset format that described preset format is arranged, described reading and recording method and form are neither limited to above illustrated form, can set as required in practice, as long as can meet for described first script reads and determines the item to be tested that described SMS is tested accordingly.In one embodiment, described test item can comprise following test item: send a note; Retrieve the note existed; Newly-built common phrases; Amendment common phrases; Delete common phrases; Delete all dialogues; Reception note is tested; Transmission note is expressed one's feelings; Long by rear deletion note; Long by after copy a note; Long by rear forwarding short message content; Long by rear locking note; Long by being stored into SIM card.
Step S2, for item to be tested described in each, performs the test script of described item correspondence to be tested, and obtains the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script.In one embodiment, described item to be tested is Execute field value in CaseInfo record is the test item of 1.The test script of described item correspondence to be tested is the test script corresponding with the value of described Xiang Zhongyu Name field to be tested adopting Robotium script edit.As being the example to be tested of testCase01 for Name, can be set in script corresponding to it in the first test script is method testCase01 or function testCase01.Robotium is a external Android automatic test script, black box automatic test is carried out in application mainly for Android platform, it provide the various gesture operation of simulation (click, long by, slip etc.), search and assert and the API of mechanism can operate to various control.Robotium reaches in conjunction with the test frame that Android official provides the test that application programs carries out automation.Robotium script creates test case (or being called test case) mainly through using the example of Solo object, and the main action statement of Solo has: solo.clickOnView (click view); Solo.sendKey (clicking secondary or physical bond Menu, Home, Back); Solo.enterText (input characters); Solo.clickOnButton (click specific button); Solo.clickOnImageButton (clicking particular pictorial button); Solo.waitForActivity (confirming that specific Activity is not activated); Solo.searchText (whether search occurs specifying word); Solo.takeScreenshot (current page sectional drawing) etc.
In one embodiment, the content of the test script of described item correspondence to be tested comprises: the test operation performing described item to be tested, and judge described test operation complete after result whether be consistent with the default result of described item to be tested, if be consistent, then described test result is for passing through; If do not met, then described test result is unsuccessfully.In one embodiment, different default results is had for different test cases, such as, the default result sending a note (can adopt statement if (solo.waitForText (testPhoneNo1+ " message received " for the receipt obtaining message received, 1, WAITTIME*50)) judge).For different test cases, contrast short message content can be adopted whether to meet preset content, send successful icon whether to show, prompting whether is had to send successful POP frame message, whether message list has increases or reduces, and concrete Activity has the methods such as not correct startup to judge whether test result.These judgements are provided with different default results, and can adopt solo statement to realize.By judge described test operation complete after result whether be consistent with the default result of described item to be tested, determine that whether described example to be tested is by this test; If be consistent, then described test result is for passing through; If do not met, then described test result is unsuccessfully (or not passing through).
In one embodiment, the test operation that described test script also comprises described item to be tested comprises: perform the operation entering the test interface of described item to be tested, if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is unsuccessfully (or not passing through).Such as, when testing test case " note that retrieval has existed ", after completing the note sent for retrieval, need to enter information list interface, at this moment, can detect and whether enter described test interface (now for " information list interface "), can adopt Solo statement judge (if (! Solo.waitForActivity (" ConversationList ", WAITTIME*4))), if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is unsuccessfully (or not passing through).If judge to enter described test interface, then proceed test.
In one embodiment, the test operation of described item to be tested comprises acquisition test sectional drawing, to record the test process of described item to be tested.Such as, for the test of test case " newly-built note ", respectively when the operation of newly-built note starts, when writing note number content, when sending note, obtaining when sending result and obtaining test sectional drawing, and described test sectional drawing is kept in default catalogue.The process saving test that these test sectional drawings are complete, may be used for manually determining test result for user.
Step S3, outputs to the test result information of described item to be tested in test result file.Particularly, output in test result file by the test result information of the item to be tested obtained, described test result information is kept in described test result file with preset format.In one embodiment, described test result file is XML file (as: CaseRes.xml), and its content is as follows:
<ResInfo>
<Res?Id=”Music_01”>
<CaseName> sends note (newly-built) </CaseName>
<CaseRes>Pass</CaseRes>
<Comment> decision method: occur sending receipt </Comment>
</Res>
<ResInfo>
<Res?Id=”Music_02”>
<CaseName> retrieves the note </CaseName> existed
<CaseRes>Pass</CaseRes>
<Comment> decision method: the number of the number retrieved and title display meets, and retrieval of content please check sectional drawing </Comment>
</Res>
Wherein, Pass represent test result be by or success; If test result is do not pass through or failure, then can represent with Fail.
In one embodiment, described first script also comprises the operation for not needing the test item performed: the test item not needing execution for each, generating test result is do not test the test result information of mark, is that the test result information not testing mark outputs in test result file by described test result.Described mark of not testing can be defined by user, if definition " NT " is not for test mark, then to not needing the test result of the test item performed to be set to " NT ".The corresponding contents of its test result file (CaseRes.xml) is as follows:
<ResInfo>
<Res?Id=”Music_03”>
<CaseName> retrieves the note </CaseName> existed
<CaseRes>NT</CaseRes>
<Comment> decision method: create self-defined phrase success </Comment>
</Res>
In one embodiment, described SMS test automation method is also included in the second script and realizes: carry out signature verification to described first script, and is installed on mobile phone to be tested by described first script.Described second script comprises the installation order after to the signature verification order of described first script and signature verification.Described second script can also comprise to again signature after automatic test script be optimized.An example of described second script realize comprising of content:
@echo?off
set?apkname=Mms_Test.apk
:: apkname automatized script apk title
set?apkname=Mms_Test_new.apk
:: the automatized script title after apknewname signs again
java–jar?signapk.jar?testkey.x509.pem?testkey.pk8%apkname%%apknewname%
:: optimize apk
adb?install–r%apknewname%
:: the automatized script after again signing is mounted to mobile phone
pause
Wherein:: represent annotation.User { can find the signature files such as platform.pk8 platform.x509.pem from Android source code position platform/build/target/product/security/}.Signapk.jar file { can find/out/host/linux-x86/framework/} from Android source code position.Under the execution of described second script needs first automatic test script file (Mms_Test.apk) and signature file (platform.pk8 platform.x509.pem) and signapk.jar file to be put the file at the second script place in a tester, and adb is adopted to be connected in test machine mobile phone to be tested.
In one embodiment, described SMS test automation method is also included in the 3rd script and realizes: in described mobile phone to be tested, start described first script test, obtain described test result file after test completes.Described 3rd script is included in firm first script that starts in mobile phone to be tested and carries out the order tested and the order obtaining described test result file after having tested.In one embodiment, described 3rd script can also comprise the order of the test sectional drawing file obtained in test.An example of described 3rd script realize comprising of content:
@echo?off
set?TestPackageName=com.example.ad.test
:: the PackageName of TestPackageName test script
set?TestedPackageName=com.android.music
:: the PackageName of the tested apk of TestedPackageName
adb?shell?am?instrument-w%TestPackageName%/com.neenbedankt.android.test.InstrumentationTestRunner
:: adb shell am instrument starts the supervision to instrument example
:: the AndroidManifest.xml searching testing engineering under this environment of com.neenbedankt.android.test.InstrumentationTestRunner, therefrom obtain the PackageName of tested APK, for keeping adb shell until tested
Echo completes
adb?pull/data/data/%TestedPackageName%/files/TEST-all.xml?d:\TestResult
adb?pull/mnt/sdcard/CaseRes.xml?d:\TestResult
Echo completes
pause
Wherein, com.example.ad.test is the bag name of the test script including the first script, and com.android.music is the bag name of tested apk.Adb shell-command is tested for the first script started in mobile phone to be tested; Adopt adb pull order from mobile phone to be tested, obtain test result file (CaseRes.xml).
The present invention also provides a kind of SMS automation system for testing.In one embodiment, as shown in Figure 2, described SMS automation system for testing 1 comprises:
SMS test module 11, described SMS test module 11 comprises detecting information acquiring unit 111, test execution unit 112, test result generation unit 113.Wherein:
Described detecting information acquiring unit 111 for reading the information of default test request file, and determines the item to be tested that described SMS is tested accordingly; Multiple test item information arranged with preset format is included in described test request file; Described item to be tested is the test item needing to perform.In one embodiment, described test request file is XML file (Setting.xml), and described XML file arranges test item information with preset format.Under described XML file is positioned over default file directory, its form is as follows:
Detecting information acquiring unit 111 reads the content of described XML file by CaseControl class, and read content is corresponded to Name and the Execute field of CaseInfo class.In described XML with <Case Id=" " > starts the corresponding test item information of content of </Case> ending, the corresponding test case information of each test item information; The value of <Name></NameGrea tT.GreaT.GT wherein corresponds to the Name field of CaseInfo class, and the value of <Execute></Execu te> corresponds to the Execute field of CaseInfo class.The value of <Execute></Execu te> is this test item of 1 expression is the test item needing to perform, i.e. described item to be tested; The value of <Execute></Execu te> is this test item of 0 expression is the test item not needing to perform.Need to import CaseControl jar bag to the use of described CaseControl class and CaseInfo class.CaseControl jar comprises CaseControl class, XmlHandle class and CaseInfo class in wrapping.Wherein, CaseControl class can be used for: the value reading Setting.xml; Judge whether Case needs to perform; Result is write XML file; Export debugging log information; Sectional drawing is copied to assigned catalogue etc.XmlHandle class can be used for: read XML file; Write (newly-built write) XML file; Analyzing XML file; Export XML file and arrive assigned address etc.CaseInfo class is for storing the various information of Case (test case), and a CaseInfo records the information of a Case (test case), mainly contains: Name field (the execution function name of Test); Execute field (represent whether respective function performs 0 for not perform, 1 for performing).Described CaseInfo class can also comprise: CaseNo field (representing the sequence number of this Case); CaseName field (representing the title of Case); CaseRes field (representing the result of Case); Comment field (representing the remarks after Case execution); MmsToman field (in note test contact phone); MmsText; Field (information of other people will be issued in note test).Described test request file also can be the file of other types, it also can be other preset format that described preset format is arranged, described reading and recording method and form are neither limited to above illustrated form, can set as required in practice, also determine the item to be tested that described SMS is tested accordingly as long as can meet for detecting information acquiring unit 111 reads.In one embodiment, described test item can comprise following test item: send a note; Retrieve the note existed; Newly-built common phrases; Amendment common phrases; Delete common phrases; Delete all dialogues; Reception note is tested; Transmission note is expressed one's feelings; Long by rear deletion note; Long by after copy a note; Long by rear forwarding short message content; Long by rear locking note; Long by being stored into SIM card.
Described test execution unit 112 is connected with described detecting information acquiring unit 111, for for item to be tested described in each, performs the test script of described item correspondence to be tested, and obtains the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script.Particularly, test execution unit 112 for obtain from described detecting information acquiring unit 111 each described in item to be tested, perform the test script of described item correspondence to be tested, and obtain the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script.In one embodiment, described item to be tested is Execute field value in CaseInfo record is the test item of 1.The test script of described item correspondence to be tested is the test script corresponding with the value of described Xiang Zhongyu Name field to be tested adopting Robotium script edit.As being the example to be tested of testCase01 for Name, can be set in script corresponding to it in the first test script is method testCase01 or function testCase01.Robotium is a external Android automated test frame, black box automatic test is carried out in application mainly for Android platform, it provide the various gesture operation of simulation (click, long by, slip etc.), search and assert and the API of mechanism can operate to various control.Robotium reaches in conjunction with the test frame that Android official provides the test that application programs carries out automation.Robotium script creates test case (or being called test case) mainly through using the example of Solo object, and the main action statement of Solo has: solo.clickOnView (click view); Solo.sendKey (clicking secondary or physical bond Menu, Home, Back); Solo.enterText (input characters); Solo.clickOnButton (click specific button); Solo.clickOnImageButton (clicking particular pictorial button); Solo.waitForActivity (confirming that specific Activity is not activated); Solo.searchText (whether search occurs specifying word); Solo.takeScreenshot (current page sectional drawing).
In one embodiment, the content of the test script of described item correspondence to be tested comprises: the test operation performing described item to be tested, and judge described test operation complete after result whether be consistent with the default result of described item to be tested, if be consistent, then described test result is for passing through; If do not met, then described test result is unsuccessfully.In one embodiment, different default results is had for different test cases, such as, the default result sending a note (can adopt statement if (solo.waitForText (testPhoneNo1+ " message received " for the receipt obtaining message received, 1, WAITTIME*50)) judge).For different test cases, contrast short message content can be adopted whether to meet preset content, send successful icon whether to show, prompting whether is had to send successful POP frame message, whether message list has increases or reduces, and concrete Activity has the methods such as not correct startup to judge whether test result.These judgements are provided with different default results, and can adopt solo statement to realize.By judge described test operation complete after result whether be consistent with the default result of described item to be tested, determine that whether described example to be tested is by this test; If be consistent, then described test result is for passing through; If do not met, then described test result is unsuccessfully (or not passing through).
In one embodiment, the test operation that described test script also comprises described item to be tested comprises: perform the operation entering the test interface of described item to be tested, if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is unsuccessfully (or not passing through).Such as, when testing test case " note that retrieval has existed ", after completing the note sent for retrieval, need to enter information list interface, at this moment, can detect and whether enter described test interface (now for " information list interface "), can adopt Solo statement judge (if (! Solo.waitForActivity (" ConversationList ", WAITTIME*4))), if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is unsuccessfully (or not passing through).If judge to enter described test interface, then proceed test.
In one embodiment, the test operation of described item to be tested comprises acquisition test sectional drawing, to record the test process of described item to be tested.Such as, for the test of test case " newly-built note ", respectively when the operation of newly-built note starts, when writing note number content, when sending note, obtaining when sending result and obtaining test sectional drawing, and described test sectional drawing is kept in default catalogue.The process saving test that these test sectional drawings are complete, may be used for manually determining test result for user.
Test result generation unit 113 is connected with described test item performance element 112, for receiving described test result information and exporting described test result information in test result file.Particularly, the test result information of the item to be tested obtained from described test item performance element 112 outputs in test result file by test result generation unit 113, and described test result information is kept in described test result file with preset format.In one embodiment, described test result file is XML file (as: CaseRes.xml), and its content is as follows:
<ResInfo>
<Res?Id=”Music_01”>
<CaseName> sends note (newly-built) </CaseName>
<CaseRes>Pass</CaseRes>
<Comment> decision method: occur sending receipt </Comment>
</Res>
<ResInfo>
<Res?Id=”Music_02”>
<CaseName> retrieves the note </CaseName> existed
<CaseRes>Pass</CaseRes>
<Comment> decision method: the number of the number retrieved and title display meets, and retrieval of content please check sectional drawing </Comment>
</Res>
Wherein, Pass represent test result be by or success; If test result is do not pass through or failure, then can represent with Fail.
In one embodiment, described test execution unit 112 also comprises the operation for not needing the test item performed: the test item not needing execution for each, generating test result is do not test the test result information of mark, is that the test result information not testing mark outputs in test result file by described test result.Described mark of not testing can be defined by user, if definition " NT " is not for test mark, then to not needing the test result of the test item performed to be set to " NT ".The test result information of the test item that the needs obtained from described test item performance element 112 will perform outputs in test result file by test result generation unit 113, described test result information is kept in described test result file with preset format, and the corresponding contents of its test result file (CaseRes.xml) is as follows:
<ResInfo>
<Res?Id=”Music_03”>
<CaseName> retrieves the note </CaseName> existed
<CaseRes>NT</CaseRes>
<Comment> decision method: create self-defined phrase success </Comment>
</Res>
In one embodiment, described SMS automation system for testing 1 also comprises SMS test installation module 12, SMS test installation module 12 for carrying out signature verification to described SMS test module 11, and installs described SMS test module 11 in mobile phone to be tested.Particularly, signature verification is carried out to described SMS test module 11, and described SMS test module 11 is installed on mobile phone to be tested.Described SMS test installation module 12 comprises the installation order after to the signature verification order of described SMS test module 11 and signature verification.Described SMS test installation module 12 can also comprise and being optimized the automatic test script after signature again.An example of described SMS test installation module 12 realize comprising of content:
@echo?off
set?apkname=Mms_Test.apk
:: apkname automatized script apk title
set?apkname=Mms_Test_new.apk
:: the automatized script title after apknewname signs again
java–jar?signapk.jar?testkey.x509.pem?testkey.pk8%apkname%%apknewname%
:: optimize apk
adb?install–r%apknewname%
:: the automatized script after again signing is mounted to mobile phone
pause
Wherein:: represent annotation.User { can find the signature files such as platform.pk8 platform.x509.pem from Android source code position platform/build/target/product/security/}.Signapk.jar file { can find/out/host/linux-x86/framework/} from Android source code position.The execution of described SMS test installation module 12 needs first automatic test script file (Mms_Test.apk) and signature file (platform.pk8 platform.x509.pem) and signapk.jar file to be put under the file at installation module 12 place test by SMS in a tester, and is connected in test machine by mobile phone employing adb to be tested.
In one embodiment, described SMS automation system for testing also comprises SMS test starting module 13, and SMS test starting module 13 for starting described SMS test module, and obtains described test result file.Particularly, SMS test starting module 13 to be included in mobile phone to be tested and just to start SMS test module 11 and carry out the order tested and the order obtaining described test result file after having tested.In one embodiment, described SMS test starting module 13 can also comprise the order of the test sectional drawing file obtained in test.An example of described SMS test starting module 13 realize comprising of content:
@echo?off
set?TestPackageName=com.example.ad.test
:: the PackageName of TestPackageName test script
set?TestedPackageName=com.android.music
:: the PackageName of the tested apk of TestedPackageName
adb?shell?am?instrument-w%TestPackageName%/com.neenbedankt.android.test.InstrumentationTestRunner
:: adb shell am instrument starts the supervision to instrument example
:: the AndroidManifest.xml searching testing engineering under this environment of com.neenbedankt.android.test.InstrumentationTestRunner, therefrom obtain the PackageName of tested APK, for keeping adb shell until tested
Echo completes
adb?pull/data/data/%TestedPackageName%/files/TEST-all.xml?d:\TestResult
adb?pull/mnt/sdcard/CaseRes.xml?d:\TestResult
Echo completes
pause
Wherein, com.example.ad.test is the bag name of the test script including SMS test module 11, and com.android.music is the bag name of tested apk.Adb shell-command is tested for the SMS test module 11 started in mobile phone to be tested; Adopt adb pull order from mobile phone to be tested, obtain test result file (CaseRes.xml).D: TestResult be the deposit position of test result.
In one embodiment, as shown in Figure 3, describe SMS test module 11 and SMS test starting module 13 in SMS automation system for testing and perform flow process.SMS test starting module 13 starts SMS test module 11 and starts to perform.SMS test module 11 reads Setting.xml file, corresponds in CaseInfo by the value of reading, for each test case, judges whether this test case performs, and namely whether this test case is use-case to be tested.Test case is according to the test case (example to be tested or item to be tested) whether performing test case and the needs execution being divided into and not needing to perform.If do not need to perform, by NT (not performing mark) information write CaseRes.xml (test result file), terminate the test of this test case.If need to perform (this test case is example to be tested), then perform corresponding test script (performing Solo operation).Judge whether to enter required interface.If do not enter required interface, by Fail (test crash or do not pass through) information write CaseRes.xml (test result file), terminate the test of this test case.If enter required interface, then continue solo operation, know that operation part completes, intercept current interface picture.Now, judge whether test result meets anticipated conditions, if met, by Pass (test crash or do not pass through) information write CaseRes.xml (test result file), terminate the test of this test case.If do not met, by Fail (test crash or do not pass through) information write CaseRes.xml (test result file), terminate the test of this test case.After the test of this test case terminates, judge whether that all wall scroll Case (test case) are all performed.If not, then the test of next test case is continued.If so, then all terminate, test result file (CaseRes.xml) copies in test machine by SMS test starting module 13, and notifies that user test terminates.
In sum, SMS test automation method and system of the present invention, there is following beneficial effect: develop based on Robotium script, operating handset can be carried out based on control ID, avoid as the problem that the needs caused distinguish mobile phone hardware difference and UI variation in script developed by employing MonkeyRunner script, simultaneously, utilize Robotium script can realize judging described test operation complete after result whether be consistent with the default result of described item to be tested, improve automaticity and recycling rate of waterused, reduce maintenance cost.Meanwhile, technical scheme of the present invention have employed the mode of test request file read test information from the multiple test item information arranged with preset format of including of presetting, and is convenient to very much modify to test request.Technical scheme of the present invention additionally provides to be verified and installation the automatic signature of test program, and automatic acquisition test result, greatly simplify the work of SMS test.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.

Claims (14)

1. a SMS test automation method, is characterized in that, described SMS test automation method realizes following steps in the first script:
Read the information of the test request file preset, and determine the item to be tested that described SMS is tested accordingly; Multiple test item information arranged with preset format is included in described test request file; Described item to be tested is the test item needing to perform;
For item to be tested described in each, perform the test script of described item correspondence to be tested, and obtain the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script;
The test result information of described item to be tested is outputted in test result file.
2. SMS test automation method according to claim 1, it is characterized in that: the content of the test script of described item correspondence to be tested comprises: the test operation performing described item to be tested, and judge described test operation complete after result whether be consistent with the default result of described item to be tested, if be consistent, then described test result is for passing through; If do not met, then described test result is unsuccessfully.
3. SMS test automation method according to claim 2, it is characterized in that: the test operation of described item to be tested comprises: perform the operation entering the test interface of described item to be tested, if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is not for pass through.
4. SMS test automation method according to claim 2, is characterized in that: the test operation of described item to be tested comprises obtaining tests sectional drawing, to record the test process of described item to be tested.
5. SMS test automation method according to claim 1, it is characterized in that: the test item not needing execution for each, generating test result is do not test the test result information of mark, is that the test result information not testing mark outputs in test result file by described test result.
6. SMS test automation method according to claim 1, it is characterized in that: described SMS test automation method is also included in the second script and realizes: carry out signature verification to described first script, and is installed on mobile phone to be tested by described first script.
7. SMS test automation method according to claim 1, it is characterized in that: described SMS test automation method is also included in the 3rd script and realizes: in described mobile phone to be tested, start described first script test, after test completes, obtain described test result file.
8. a SMS automation system for testing, is characterized in that: described system comprises: SMS test module, and described SMS test module comprises detecting information acquiring unit, test execution unit, test result generation unit; Wherein:
Described detecting information acquiring unit for reading the information of default test request file, and determines the item to be tested that described SMS is tested accordingly; Multiple test item information arranged with preset format is included in described test request file; Described item to be tested is the test item needing to perform;
Described test execution unit, is connected with described detecting information acquiring unit, for for item to be tested described in each, performs the test script of described item correspondence to be tested, and obtains the test result information of described test script; Described test result information comprises test result; The test script of described item correspondence to be tested is Robotium script;
Described test result generation unit, is connected with described test item performance element, for receiving described test result information and exporting described test result information in test result file.
9. SMS automation system for testing according to claim 8, it is characterized in that: the content of the test script of described item correspondence to be tested comprises: the test operation performing described item to be tested, and judge described test operation complete after result whether be consistent with the default result of described item to be tested, if be consistent, then described test result is successfully; If do not met, then described test result is unsuccessfully.
10. SMS automation system for testing according to claim 9, it is characterized in that: the test operation of described item to be tested comprises: perform the operation entering the test interface of described item to be tested, if judge not enter described test interface, then the test of described item to be tested terminates, and described test result is unsuccessfully.
11. SMS automation system for testing according to claim 9, is characterized in that: the test operation of described item to be tested comprises obtaining tests sectional drawing, to record the test process of described item to be tested.
12. SMS automation system for testing according to claim 8, it is characterized in that: described SMS test module is for the test item not needing in SMS detecting information acquiring unit described in each to perform, generating corresponding test result is do not test the test result information of mark, is that the test result information not testing mark sends to described test result generation unit by described test result.
13. SMS automation system for testing according to claim 8, it is characterized in that: described SMS automation system for testing also comprises SMS test installation module, for carrying out signature verification to described SMS test module, and described SMS test module is installed in mobile phone to be tested.
14. SMS automation system for testing according to claim 8, it is characterized in that: described SMS automation system for testing also comprises SMS test starting module, for starting described SMS test module, and obtain described test result file.
CN201410512435.4A 2014-09-29 2014-09-29 A kind of Automated testing method of cell phone short messages and system Active CN104320793B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410512435.4A CN104320793B (en) 2014-09-29 2014-09-29 A kind of Automated testing method of cell phone short messages and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410512435.4A CN104320793B (en) 2014-09-29 2014-09-29 A kind of Automated testing method of cell phone short messages and system

Publications (2)

Publication Number Publication Date
CN104320793A true CN104320793A (en) 2015-01-28
CN104320793B CN104320793B (en) 2018-10-12

Family

ID=52375945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410512435.4A Active CN104320793B (en) 2014-09-29 2014-09-29 A kind of Automated testing method of cell phone short messages and system

Country Status (1)

Country Link
CN (1) CN104320793B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294172A (en) * 2016-08-17 2017-01-04 刘华英 App self-testing method based on terminal unit and device
CN107948942A (en) * 2017-11-23 2018-04-20 北京百悟科技有限公司 A kind of short message service automated testing method and device
CN108376115A (en) * 2018-01-29 2018-08-07 数据通信科学技术研究所 Across the Android platform automated testing method of one kind and system
CN109597728A (en) * 2018-11-15 2019-04-09 Oppo(重庆)智能科技有限公司 The control method and device of test equipment, computer readable storage medium
CN110290486A (en) * 2019-07-04 2019-09-27 深圳壹账通智能科技有限公司 Short message sends test method, device, computer equipment and storage medium
CN111999707A (en) * 2020-08-19 2020-11-27 无锡威孚高科技集团股份有限公司 Automatic testing method, device and system for millimeter wave radar

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156672A (en) * 2011-04-19 2011-08-17 广东欧珀移动通信有限公司 Method for realizing automated test on mobile phone calculator
WO2013000439A1 (en) * 2011-06-30 2013-01-03 华为数字技术(成都)有限公司 Method, device and security policy system for executing security policy script
CN103400063A (en) * 2013-08-06 2013-11-20 深信服网络科技(深圳)有限公司 Method and device for executing script file
CN103744784A (en) * 2014-01-06 2014-04-23 ***(深圳)有限公司 Method and system for automatically testing mobile phone applications
CN104156305A (en) * 2013-05-15 2014-11-19 腾讯科技(深圳)有限公司 Application program testing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156672A (en) * 2011-04-19 2011-08-17 广东欧珀移动通信有限公司 Method for realizing automated test on mobile phone calculator
WO2013000439A1 (en) * 2011-06-30 2013-01-03 华为数字技术(成都)有限公司 Method, device and security policy system for executing security policy script
CN104156305A (en) * 2013-05-15 2014-11-19 腾讯科技(深圳)有限公司 Application program testing method and device
CN103400063A (en) * 2013-08-06 2013-11-20 深信服网络科技(深圳)有限公司 Method and device for executing script file
CN103744784A (en) * 2014-01-06 2014-04-23 ***(深圳)有限公司 Method and system for automatically testing mobile phone applications

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294172A (en) * 2016-08-17 2017-01-04 刘华英 App self-testing method based on terminal unit and device
CN106294172B (en) * 2016-08-17 2018-10-30 刘华英 App self-testing methods based on terminal device and device
CN107948942A (en) * 2017-11-23 2018-04-20 北京百悟科技有限公司 A kind of short message service automated testing method and device
CN108376115A (en) * 2018-01-29 2018-08-07 数据通信科学技术研究所 Across the Android platform automated testing method of one kind and system
CN109597728A (en) * 2018-11-15 2019-04-09 Oppo(重庆)智能科技有限公司 The control method and device of test equipment, computer readable storage medium
CN109597728B (en) * 2018-11-15 2022-09-06 Oppo(重庆)智能科技有限公司 Control method and device of test equipment and computer readable storage medium
CN110290486A (en) * 2019-07-04 2019-09-27 深圳壹账通智能科技有限公司 Short message sends test method, device, computer equipment and storage medium
CN111999707A (en) * 2020-08-19 2020-11-27 无锡威孚高科技集团股份有限公司 Automatic testing method, device and system for millimeter wave radar

Also Published As

Publication number Publication date
CN104320793B (en) 2018-10-12

Similar Documents

Publication Publication Date Title
US10853232B2 (en) Adaptive system for mobile device testing
CN104320793A (en) Mobile phone short message automated test method and system
CN107423048B (en) Data collection method, device, medium and computing equipment
US20130074051A1 (en) Tracking and analysis of usage of a software product
CN104407980A (en) Mobile application automated testing device and method
CN105608012A (en) Automatic test method and automatic test system
CN103164300A (en) Mobile terminal touch screen automatic testing method and device
CN110716853A (en) Test script recording method, application program testing method and related device
CN102467442A (en) Software testing method, system and equipment
WO2017165247A1 (en) Graphical data presented in code editor along with code
CN111190825A (en) Automatic test method, system and robot
US8984487B2 (en) Resource tracker
CN109522010B (en) Initialization code adding method and device, storage medium and electronic equipment
CN115080398A (en) Automatic interface test system and method
CN111767226A (en) Method, system and equipment for testing cloud computing platform resources
CN110688145A (en) Android MVP code automatic generation method, device, medium and electronic equipment
KR20140046121A (en) System and method for testing application
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
CN108932199B (en) Automatic taint analysis system based on user interface analysis
CN115080114B (en) Application program transplanting processing method, device and medium
CN109144841B (en) Method and device for identifying advertisement application, computer equipment and storage medium
CN107622013B (en) Distributed system testing method and device
CN114676436A (en) Android application multimedia analysis library vulnerability mining system and method based on structural variation
CN114328180A (en) Interface automation test method, system, electronic equipment and storage medium
CN112685306A (en) Test method, test device, user terminal and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201125

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right

Effective date of registration: 20201216

Address after: 233000 3rd floor, Dong'an Market, Fengyang West Road, Longzihu District, Bengbu City, Anhui Province

Patentee after: Bengbu 309 Technology Consulting Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210203

Address after: 313001 room 1019, Xintiandi office building, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 233000 3rd floor, Dong'an Market, Fengyang West Road, Longzihu District, Bengbu City, Anhui Province

Patentee before: Bengbu 309 Technology Consulting Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Method and System for Automatic Test of Mobile Short Message

Effective date of registration: 20230111

Granted publication date: 20181012

Pledgee: Huzhou Wuxing Rural Commercial Bank Co.,Ltd. high tech Zone Green sub branch

Pledgor: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Registration number: Y2023330000072

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20231205

Granted publication date: 20181012

Pledgee: Huzhou Wuxing Rural Commercial Bank Co.,Ltd. high tech Zone Green sub branch

Pledgor: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Registration number: Y2023330000072

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240205

Address after: 710000, Building B, Huihao Tree Center, Keji 3rd Road, High tech Zone, Xi'an City, Shaanxi Province, China 1508

Patentee after: Shaanxi Chengtuo Network Co.,Ltd.

Country or region after: China

Address before: 313001 room 1019, Xintiandi office building, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee before: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Country or region before: China