CN104133764B - The response test method and apparatus of Application Program Interface - Google Patents

The response test method and apparatus of Application Program Interface Download PDF

Info

Publication number
CN104133764B
CN104133764B CN201310162574.4A CN201310162574A CN104133764B CN 104133764 B CN104133764 B CN 104133764B CN 201310162574 A CN201310162574 A CN 201310162574A CN 104133764 B CN104133764 B CN 104133764B
Authority
CN
China
Prior art keywords
application program
test
response
triggering
response events
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.)
Active
Application number
CN201310162574.4A
Other languages
Chinese (zh)
Other versions
CN104133764A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310162574.4A priority Critical patent/CN104133764B/en
Publication of CN104133764A publication Critical patent/CN104133764A/en
Application granted granted Critical
Publication of CN104133764B publication Critical patent/CN104133764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of response test method and apparatus of Application Program Interface.Methods described includes:Triggering operation application program;Triggering performs the test case of the application program in the application program of the operation;The response events encapsulated in the test case are run by the execution of the test case, is simulated with the input operation to application interface and user's operation is responded by the operation of the response events;The response events are that Application Program Interface listens to the event triggered during input operation.Described device includes:Program trigger module, testing execution module and event operation module.Can response of the test application program to the input operation progress in interface in Windows Phone operating system platforms using the present invention.

Description

The response test method and apparatus of Application Program Interface
Technical field
The present invention relates to computer testing technology, more particularly to the response test method and dress of a kind of Application Program Interface Put.
Background technology
The test of application program is realized in the operating system platform of electronic equipment operation often through analog subscriber operation.Example Such as, operation or user clicking operation on Application Program Interface of the analog subscriber to control in Application Program Interface corresponds to Tested with the response of program.
The instrument for the input operation simulation for being used to realize user in operating system platform is typically black box automatic test work Tool.However, Windows Phone operating system platforms do not support any black box automated test tool, and supported white Box testing tool can not also realize user's operation simulation, and then cause Windows Phone operating system platforms can not test should The response carried out with input operation of the program to user in interface.
The content of the invention
Based on this, it is necessary to for Windows Phone operating system platforms can not test application program to being used in interface The technical problem for the response that the input operation at family is carried out, there is provided one kind can be surveyed in Windows Phone operating system platforms Try the response test method of the Application Program Interface for the response that application program is carried out to the input operation in interface.
In addition, there is a need to provide one kind can in Windows Phone operating system platforms test application program to boundary The response test device of the Application Program Interface for the response that input operation in face is carried out.
A kind of response test method of Application Program Interface, comprises the following steps:
Triggering operation application program;
Triggering performs the test case of the application program in the application program of the operation;
The response events encapsulated in the test case are run by the execution of the test case, with to application interface Input operation is simulated and responds user's operation by the operation of the response events;
The response events are that Application Program Interface listens to the event triggered during input operation.
A kind of response test device of Application Program Interface, including:
Program trigger module, application program is run for triggering;
Testing execution module, the test for the triggering execution application program in the application program of the operation are used Example;
Event runs module, for the response events encapsulated in the execution testing results use-case by test case, with right User's operation of application interface input is simulated and responds user's operation by the operation of the response events;
The response events are that Application Program Interface listens to the event triggered during input operation.
The response test method and apparatus of above-mentioned Application Program Interface, triggering operation application program, in answering for this operation The test case of the application program is performed with triggering in program, and then is encapsulated in the execution testing results use-case for passing through test case Response events, simulated with the input operation to application interface and user responded by the operations of response events and operated, by It is the event triggered when Application Program Interface listens to input operation in the response events of operation, therefore, passes through response events Operation realizes the simulation of the input operation of user and the response test to input operation in Application Program Interface, and then causes Windows Phone operating system platforms also being capable of response of the test application program to the input operation progress in interface.
Brief description of the drawings
Fig. 1 is the flow chart of the response test method of Application Program Interface in one embodiment;
Fig. 2 is the flow chart of the response test method of Application Program Interface in another embodiment;
Fig. 3 is the structural representation of the response test device of Application Program Interface in one embodiment;
Fig. 4 is the structural representation of the response test device of Application Program Interface in another embodiment.
Embodiment
As shown in figure 1, in one embodiment, a kind of response test method of Application Program Interface, comprise the following steps:
Step S110, triggering operation application program.
In the present embodiment, the application program for triggering operation is mounted to appointing in Windows Phone operating system platforms Meaning application program.For example, the application program of triggering operation can be browser, JICQ etc..
Step S130, the test case of triggering execution application program in the application program of operation.
In the present embodiment, the test case of application program is the document set according to the testing requirement of application program, is used for Some functions, stability to application program etc. are tested.The test carried out required for application program is typically a variety of Various, therefore, the test case of application program can be multiple.
Step S150, by the response events encapsulated in the execution testing results use-case of test case, with to application interface Input operation simulated and the user responded by the operations of response events and operated.
In the present embodiment, response events are that Application Program Interface listens to the event triggered during input operation.Application program The input operation that interface is listened to refers to the operation that user triggers in Application Program Interface, for example, in the browser of operation Operation, clicking operation and slide of the new Bookmark of middle triggering etc..
In the application program of operation, the operation interface provided the user is Application Program Interface, and Application Program Interface is made For UI(UserInterface, user interface)Layer receives the various operations of user's input, and then causes application program to pass through triggering Corresponding response events respond come the input operation to user.
But due to Windows Phone operating system platforms can not analog subscriber various input operations, therefore, will Cast aside UI layers, and the response events directly triggered by input operation realize the simulation of input operation, due to input operation One-to-one with certain response events, thus can also be reached by response events in test application program interface to The purpose of the response of the input operation at family.
Each test case encapsulates at least one response events, that is to say, that each test case may each be one Individual response events encapsulate forming or combine what encapsulation formed by multiple response events, and this will be according to test Demand neatly set.
The triggering of one response events is grasped equivalent to one or more input of user in Application Program Interface is simulated Make, for example, a response events can equivalent to have input in Application Program Interface click on some button operation or phase Click on button 1 when be have input in user in Application Program Interface and then click on the operation of button 2 again.
In the response test method of above-mentioned Application Program Interface, by being rung corresponding to the input operation in Application Program Interface Answer event to realize simulation and the response test of input operation, avoid the limitation of operating system platform so that no matter which kind of type Operating system platform can be achieved input operation simulation and response test, greatly increase the flexibility of test.
In one embodiment, after above-mentioned steps S130, the response test method of the Application Program Interface also includes:
The test page of application program is loaded into, it is related by the response events triggered during input operation are listened to application program Test case and/or test set be shown in test page.
In the present embodiment, test page is loaded into the application program of operation, all tests of this application program are used Example and/or test set are shown in test page, the test that can currently carry out can be checked by test page, in order to pass through Test page carries out various input operation simulations and response test to Application Program Interface.
Wherein, test set encapsulates multiple test cases, to adapt to the various testing requirements not passed through, and then can test mould The events such as different scene changes are realized in the input operation for intending user.
In one embodiment, above-mentioned steps S130 includes:
The test case selected in test page is obtained, and the selected test of triggering execution is used in the application program of operation Example.
In the present embodiment, the tester of application program can be to the selected behaviour of any test case triggering in test page Make, now, the test case that acquisition user is selected, the test case is performed to be triggered in the application program of operation.
In another embodiment, above-mentioned steps S130 also includes:
The test set selected in test page is obtained, and triggering performs selected test set in the application program of operation, The test case encapsulated in test set is performed with triggering.
In the present embodiment, the tester of application program can also be to the selected behaviour of any test set triggering in test page Make, now, the test set that acquisition user is selected, the test set is performed to be triggered in the application program of operation, and then perform The test case that this test set is included.
As shown in Fig. 2 in one embodiment, before above-mentioned steps S130, the response test side of the Application Program Interface Method also comprises the following steps:
Step S210, the response events collection of application program is obtained, the response events collection listens to including Application Program Interface The response events that user triggers when operating.
In the present embodiment, any input operation occurred in Application Program Interface has necessarily uniquely corresponded to one or more sound Event is answered, for example, the new Bookmark operation that Application Program Interface is occurred also necessarily has corresponded to the response events of new Bookmark, because This, can obtain the response events collection of application program, and it is right that the response events collection includes the user's operation institute occurred in application interface The response events answered.
Further, response events set is substantially the set that multiple event functions are formed, i.e., each response events are equal A certain event functions are corresponded to.
Step S230, the response events concentrated to response events are packaged the test case for the program that is applied.
In the present embodiment, the testing requirement in application program, one or more of response events collection is responded into thing Part is packaged a test case of the program that can be applied, and can be wrapped according to demand between packaged obtained test case Containing the response events repeated.
The response test method of above-mentioned Application Program Interface is elaborated with reference to a specific embodiment.The reality Apply in example, application program is by taking browser as an example, that is to say, that browser is application program to be tested, in browser interface The response of various input operations is tested.
The response events collection of browser is obtained in advance, and the response events collection will include all input behaviour in browser interface Make to response events, the response events included to response events collection are packaged to be used with obtaining one or more tests Example, in addition, also multiple test cases can be encapsulated as into test set according to demand.
After triggering operation browser, test page will be loaded in a browser, now, the people tested browser Member can check all test cases and/or test set from test page.
The selected operation of test case and/or test set in test page is obtained, and triggers and performs selected test case And/or test set, for example, the test case that current triggering performs contains the thing for opening all websites in browser navigation page Part.
With the execution of test case, institute in the unlatching browser navigation page that correspondingly testing results use-case is included There is the event of website, and then automatically open website all in navigation page, and generate corresponding daily record data, the people of test Member is by checking that browser and export daily record data can complete automatic test, it is no longer necessary to spends manpower to go to click on each station Point, testing cost is saved, and improve testing efficiency.
As shown in figure 3, in one embodiment, a kind of response test device of Application Program Interface, including program triggering Module 110, testing execution module 130 and event operation module 150.
Program trigger module 110, application program is run for triggering.
In the present embodiment, the application program of the triggering operation of program trigger module 110 is mounted to Windows Phone operations Any application in system platform.For example, the application program of triggering operation can be browser, JICQ etc..
Testing execution module 130, the test case for the triggering execution application program in the application program of operation.
In the present embodiment, the test case of application program is the document set according to the testing requirement of application program, is used for Some functions, stability to application program etc. are tested.The test carried out required for application program is typically a variety of Various, therefore, the test case of application program can be multiple.
Event runs module 150, for the response events encapsulated in the execution testing results use-case by test case, with User's operation to Application Program Interface input is simulated and responds user's operation by the operation of response events.
In the present embodiment, response events are that Application Program Interface listens to the event triggered during input operation.Application program The input operation that interface is listened to refers to the operation that user triggers in Application Program Interface, for example, in the browser of operation Operation, clicking operation and slide of the new Bookmark of middle triggering etc..
In the application program of operation, the operation interface provided the user is Application Program Interface, and Application Program Interface is made For UI(UserInterface, user interface)Layer receives the various operations of user's input, and then causes application program to pass through triggering Corresponding response events respond come the input operation to user.
But due to Windows Phone operating system platforms can not analog subscriber various input operations, therefore, will Cast aside UI layers, and the response events directly triggered by input operation realize the simulation of input operation, due to input operation It is one-to-one with certain response events, thus event operation module 150 can also reach test by response events and answer With the purpose of the response of the input operation in program interface to user.
Each test case encapsulates at least one response events, that is to say, that each test case may each be one Individual response events encapsulate forming or combine what encapsulation formed by multiple response events, and this will be according to test Demand neatly set.
The triggering of one response events is grasped equivalent to one or more input of user in Application Program Interface is simulated Make, for example, a response events can equivalent to have input in Application Program Interface click on some button operation or phase Click on button 1 when be have input in user in Application Program Interface and then click on the operation of button 2 again.
In the response test device of above-mentioned Application Program Interface, by being rung corresponding to the input operation in Application Program Interface Answer event to realize simulation and the response test of input operation, avoid the limitation of operating system platform so that no matter which kind of type Operating system platform can be achieved input operation simulation and response test, greatly increase the flexibility of test.
In one embodiment, the response test device of above-mentioned Application Program Interface also includes insmoding.
Insmod for the test page for being loaded into application program, touched when input operation will be listened to Application Program Interface The related test case of the response events of hair and/or test set are shown in test page.
In the present embodiment, insmod and be loaded into test page in the application program of operation, by the institute of this application program There are test case and/or test set to be shown in test page, the test that can currently carry out can be checked by test page, with It is easy to carry out various input operation simulations and response test to Application Program Interface by test page.
Wherein, test set encapsulates multiple test cases, to adapt to the various testing requirements not passed through, and then can test mould The events such as different scene changes are realized in the input operation for intending user.
In one embodiment, above-mentioned testing execution module 130 is additionally operable to obtain the test case selected in test page, And triggering performs selected test case in the application program of operation.
In the present embodiment, the tester of application program can be to the selected behaviour of any test case triggering in test page Make, now, the test case that testing execution module 130 selectes acquisition user, performed with being triggered in the application program of operation The test case.
In another embodiment, above-mentioned testing execution module 130 is additionally operable to obtain the test set selected in test page, And triggering performs selected test set in the application program of operation, the test case encapsulated in test set is performed with triggering.
In the present embodiment, the tester of application program can also be to the selected behaviour of any test set triggering in test page Make, now, the test set that testing execution module 130 selectes acquisition user, be somebody's turn to do with triggering to perform in the application program of operation Test set, and then perform the test case that this test set is included.
As shown in figure 4, in another embodiment, the response test device of above-mentioned Application Program Interface also includes event set Acquisition module 210 and package module 230.
Event set acquisition module 210, for obtaining the response events collection of application program, the response events collection includes applying journey Sequence interface listens to the response events triggered during user's operation.
In the present embodiment, any input operation occurred in Application Program Interface has necessarily uniquely corresponded to one or more sound Event is answered, for example, the new Bookmark operation that Application Program Interface is occurred also necessarily has corresponded to the response events of new Bookmark, because This, event set acquisition module 210 can obtain the response events collection of application program, and the response events collection, which includes in application interface, to be sent out The corresponding response events of raw user's operation.
Further, response events set is substantially the set that multiple event functions are formed, i.e., each response events are equal A certain event functions are corresponded to.
Package module 230, the test for the response events that response events are concentrated to be packaged with the program that is applied are used Example.
In the present embodiment, the testing requirement in application program, concentrate response events one of package module 230 or Multiple response events are packaged a test case of the program that can be applied, root between packaged obtained test case The response events repeated can be included according to demand.
The response test method and apparatus of above-mentioned Application Program Interface, triggering operation application program, in answering for this operation The test case of the application program is performed with triggering in program, and then is encapsulated in the execution testing results use-case for passing through test case Response events, simulated with the input operation to application interface and user responded by the operations of response events and operated, by It is the event triggered when Application Program Interface listens to input operation in the response events of operation, therefore, passes through response events Operation realizes the simulation of the input operation of user and the response test to input operation in Application Program Interface, and then causes Windows Phone operating system platforms also being capable of response of the test application program to the input operation progress in interface.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only memory(Read-Only Memory, ROM)Or random access memory(Random Access Memory, RAM)Deng.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

1. a kind of response test method of Application Program Interface, applied to Windows Phone operating system platforms, including it is as follows Step:
Triggering operation application program;
Triggering performs the test case of the application program in the application program of the operation;
Application Program Interface is cast aside, the response thing encapsulated in the test case is directly run by the execution of the test case Part, simulated with the input operation to the Application Program Interface and pass through the response events operation response simulation it is defeated Enter operation;
The response events are that the Application Program Interface listens to the event triggered during input operation.
2. according to the method for claim 1, it is characterised in that the triggering in the application program of the operation performs institute Before the step of stating the test case of application program, methods described also includes:
The test page of the application program is loaded into, the response events triggered during input operation will be listened to Application Program Interface Related test case and/or test set is shown in test page.
3. according to the method for claim 2, it is characterised in that the triggering in the application program of the operation performs institute The step of test case for stating application program, includes:
The test case selected in test page is obtained, and triggering performs the selected survey in the application program of the operation Example on probation.
4. according to the method for claim 2, it is characterised in that the triggering in the application program of the operation performs institute The step of test case for stating application program, also includes:
The test set selected in the test page is obtained, and triggering execution is described selected in the application program of the operation Test set, the test case encapsulated in the test set is performed with triggering.
5. according to the method for claim 1, it is characterised in that the triggering in the application program of the operation performs institute Before the step of stating the test case of application program, methods described also includes:
The response events collection of the application program is obtained, the response events collection listens to user including the Application Program Interface The response events triggered during operation;
The response events concentrated to the response events are packaged to obtain the test case of the application program.
6. a kind of response test device of Application Program Interface, applied to Windows Phone operating system platforms, its feature exists In, including:
Program trigger module, application program is run for triggering;
Testing execution module, the test case for the triggering execution application program in the application program of the operation;
Event runs module, for casting aside Application Program Interface, directly runs the test by the execution of the test case The response events encapsulated in use-case, simulated with the input operation to the Application Program Interface and by the response events Operation response simulation input operation;
The response events are that the Application Program Interface listens to the event triggered during input operation.
7. device according to claim 6, it is characterised in that described device also includes:
Insmod, for being loaded into the test page of the application program, when will listen to input operation with Application Program Interface The related test case of the response events of triggering and/or test set are shown in test page.
8. device according to claim 7, it is characterised in that the testing execution module is additionally operable to obtain in test page Selected test case, and triggering performs the selected test case in the application program of the operation.
9. device according to claim 7, it is characterised in that the testing execution module is additionally operable to obtain the test sheets The test set selected in face, and triggering performs the selected test set in the application program of the operation, is performed with triggering The test case encapsulated in the test set.
10. device according to claim 6, it is characterised in that described device also includes:
Event set acquisition module, for obtaining the response events collection of the application program, the response events collection includes described answer The response events triggered when user operates are listened to program interface;
Package module, the test that the response events for being concentrated to the response events are packaged to obtain the application program are used Example.
CN201310162574.4A 2013-05-03 2013-05-03 The response test method and apparatus of Application Program Interface Active CN104133764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310162574.4A CN104133764B (en) 2013-05-03 2013-05-03 The response test method and apparatus of Application Program Interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310162574.4A CN104133764B (en) 2013-05-03 2013-05-03 The response test method and apparatus of Application Program Interface

Publications (2)

Publication Number Publication Date
CN104133764A CN104133764A (en) 2014-11-05
CN104133764B true CN104133764B (en) 2018-01-23

Family

ID=51806447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310162574.4A Active CN104133764B (en) 2013-05-03 2013-05-03 The response test method and apparatus of Application Program Interface

Country Status (1)

Country Link
CN (1) CN104133764B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104820638A (en) * 2015-04-17 2015-08-05 中国电子科技集团公司第四十一研究所 Embedded whole machine automatic testing method
CN105138462B (en) * 2015-09-24 2017-11-21 武汉泰世达科技有限公司 A kind of processing method of test software integrated framework and test data
CN105718353B (en) * 2016-01-18 2019-01-29 深圳市紫光同创电子有限公司 It is a kind of for graphical interfaces application test method, apparatus and system
CN107085553B (en) * 2017-03-07 2020-05-19 深圳国泰安教育技术有限公司 Input box testing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025686A (en) * 2007-03-22 2007-08-29 中兴通讯股份有限公司 Automation test system and test script generating and operating method
CN101339534A (en) * 2008-06-17 2009-01-07 金蝶软件(中国)有限公司 Software test apparatus and test method
CN101526919A (en) * 2009-04-29 2009-09-09 福建星网锐捷网络有限公司 Method for generating script files to test Web application software and device thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9141518B2 (en) * 2008-12-10 2015-09-22 Microsoft Technology Licensing, Llc GUI testing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025686A (en) * 2007-03-22 2007-08-29 中兴通讯股份有限公司 Automation test system and test script generating and operating method
CN101339534A (en) * 2008-06-17 2009-01-07 金蝶软件(中国)有限公司 Software test apparatus and test method
CN101526919A (en) * 2009-04-29 2009-09-09 福建星网锐捷网络有限公司 Method for generating script files to test Web application software and device thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
使用Windows Mobile Test Framework进行Windows Mobile程序的自动化测试;未知;《http://www.51testing.com/html/80/n-17180.html》;20070731;第3-8页 *

Also Published As

Publication number Publication date
CN104133764A (en) 2014-11-05

Similar Documents

Publication Publication Date Title
CN104407980B (en) Mobile solution automatic test device and method
CN104317709B (en) software performance testing method and system
CN104133764B (en) The response test method and apparatus of Application Program Interface
CN104572446B (en) A kind of automated testing method and system
CN103559222B (en) Method and device for displaying page loading time in browsers
CN106897216A (en) The method and apparatus of test software
CN105515883A (en) Test method and system
CN102707712B (en) Electronic equipment fault diagnosis method and system
CN107659455A (en) A kind of method, storage medium, equipment and the system of iOS ends Mock data
CN102662840A (en) Automatic detecting system and method for extension behavior of Firefox browser
CN105095753B (en) Broadcast safe detection method, device
CN107832177A (en) A kind of EDP method of testings, system, equipment and the storage medium of more GPU systems
CN109684571A (en) A kind of collecting method and device, storage medium
CN108415826A (en) Test method, terminal device and the computer readable storage medium of application
CN104901981A (en) Method, device and system for analyzing user behavior
CN105224457B (en) A kind of test frame implementation method and device
CN102375103B (en) Electronic product test device and method
CN103049374B (en) Automatic testing method and device
CN113849156B (en) Codeless intelligent development system applied to OpenHarmony operating system and application method thereof
JP2010160788A (en) Method, system, and computer program for dynamically improving performance of interactive voice response system using complex event processor
CN105447072A (en) Configurable interface framework as well as searching method and system utilizing framework
CN105760300B (en) A kind of automated testing method and test macro of STK/UTK business
CN117370203A (en) Automatic test method, system, electronic equipment and storage medium
CN104699600B (en) The test system and method for installation kit application
CN107222332A (en) Method of testing, device, system and machinable medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant