CN104572431A - Test method and test device - Google Patents
Test method and test device Download PDFInfo
- Publication number
- CN104572431A CN104572431A CN201310507864.8A CN201310507864A CN104572431A CN 104572431 A CN104572431 A CN 104572431A CN 201310507864 A CN201310507864 A CN 201310507864A CN 104572431 A CN104572431 A CN 104572431A
- Authority
- CN
- China
- Prior art keywords
- control
- attribute information
- test
- script
- proxy class
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a test method and a test device, which are used for solving the problems that in the prior art, a test script needs to be frequently maintained, and the test efficiency is lower. The test method comprises the steps of calling a control proxy class corresponding to a mark by the test device according to the mark of a control contained in the test script, obtaining the attribute information of the control corresponding to the mark in a tested application through the called control proxy class, and testing the tested application according to the obtained attribute information of the control. Through the test method disclosed by the invention, the test script has no need to be compiled according to the attribute information of the control in the tested application, the attribute information of the control can be obtained just by writing in the mark of a tested control through the corresponding control proxy class, the changed attribute information also can be directly obtained through the control proxy class even if the follow-up attribute information of the control is changed, the test script has no need to be changed or rewritten, thus the test script has no need to be maintained, and the test efficiency can be effectively increased.
Description
Technical field
The application relates to field of computer technology, particularly relates to a kind of method of testing and device.
Background technology
Along with the development of computer technology, the application of various service can be provided also to emerge in an endless stream for user, and in order to ensure the availability applied, just need test application.
In the prior art, when testing an application, usual needs write corresponding test script according to the attribute information (e.g., the positional information etc. at control place on the interface of this application) of the control in this application, are tested this application by this test script.
When adopting test script to test application, test script, according to the attribute information of control in this application, performs the test operation preset, realizes the test to this application to this control.
Such as, suppose that the control in applying is button, then can write test script for the attribute information of this button, when testing, test script, according to the attribute information of the button obtained, performs clicking operation to button, to realize the test to this button in application.
But, in prior art, test script needs to write according to the attribute information of control in tested application, once the attribute information of control changes in tested application, change is just needed even again to write test script, therefore, method of testing of the prior art needs to safeguard test script frequently, and testing efficiency is lower.
Summary of the invention
The embodiment of the present application provides a kind of method of testing and device, needs maintenance test script frequently, the problem that testing efficiency is lower in order to solve in prior art.
A kind of method of testing that the embodiment of the present application provides, comprising:
Proving installation testing results script, determines the mark of the control comprised in described test script; And
In each control proxy class of preserving in advance, call the control proxy class of the described mark correspondence determined, wherein, the control proxy class of described mark correspondence is for obtaining the attribute information of control corresponding to described mark; And
The attribute information identifying corresponding control described in tested application is obtained by the control proxy class called;
Described proving installation is tested described tested application according to the attribute information of the described control obtained.
A kind of proving installation that the embodiment of the present application provides, comprising:
Determination module, for testing results script, determines the mark of the control comprised in described test script;
Calling module, in each control proxy class of preserving in advance, calls the control agency of the described mark correspondence determined, wherein, the control proxy class of described mark correspondence is for obtaining the attribute information of the control of described mark correspondence;
Acquisition module, obtains the attribute information identifying corresponding control described in tested application for the control proxy class by calling;
Test module, for testing described tested application according to the attribute information of the described control obtained.
The embodiment of the present application provides a kind of method of testing and device, the method proving installation is according to the mark of the control comprised in test script, call the control proxy class of this mark correspondence, and the attribute information of the control of this mark correspondence in tested application is obtained by this control proxy class called, the attribute information according to the control obtained is tested this tested application.Pass through said method, test script is without the need to writing according to the attribute information of control in tested application, only need write the mark of the control that will test, namely the attribute information of this control is obtained by corresponding control proxy class, even if the attribute information of this control follow-up changes, also directly get the attribute information after change by control proxy class, and without the need to changing or again writing test script, therefore without the need to safeguarding test script, the efficiency of test can effectively be improved.
Accompanying drawing explanation
The test process that Fig. 1 provides for the embodiment of the present application;
The structural representation comprising the application of proving installation that Fig. 2 provides for the embodiment of the present application;
The proving installation structural representation that Fig. 3 provides for the embodiment of the present application.
Embodiment
Even rewrite in order to avoid test script is changed frequently because of the change of the attribute information of control in tested application, to improve testing efficiency, the mark of the control that will test only is write in test script in the embodiment of the present application, the control proxy class of proving installation namely by calling this mark correspondence obtains the attribute information of this control, and tests detected space according to the attribute information of the control obtained.
Below in conjunction with Figure of description, the embodiment of the present application is described in detail.
The test process that Fig. 1 provides for the embodiment of the present application, specifically comprises the following steps:
S101: proving installation testing results script, determines the mark of the control comprised in this test script.
In the embodiment of the present application, test script does not need to write according to the attribute information of control in tested application, as long as write in tested application the mark and test operation information that need to carry out the control tested.Proving installation then can run the test script write, and determines the mark of the control comprised in this test script.
Concrete, when writing test script, javascript can be adopted to write, also namely this test script can be javascript script.Accordingly, when test script is javascript script, need built-in browser kernel in proving installation, as autoplatform.dll, proving installation when testing results script, then runs this test script by browser kernel.
S102: in each control proxy class of preserving in advance, call the control proxy class of this mark correspondence determined.
S103: the attribute information being obtained the control of this mark correspondence in tested application by the control proxy class called.
In the embodiment of the present application, control proxy class is the acquisition methods of the attribute information obtaining control.The control proxy class of a mark correspondence is equivalent to the pointer of the attribute information of the control pointing to this mark correspondence, for obtaining the attribute information of the control of this mark correspondence.Can arrange corresponding control proxy class for each control in tested application in advance, wherein, the mark for the control proxy class of a control setting is identical with the mark of this control, and each control proxy class arranged is kept in proving installation.
It should be noted that, the control proxy class arranged in the embodiment of the present application is the addressable proxy class of proving installation, and e.g., when adopting javascript to write test script, the control proxy class of setting is then the addressable proxy class of javascript.
Proving installation is by above-mentioned steps S101 testing results script, and after determining the mark of the control comprised in test script, then can call the control proxy class of this mark correspondence in each control proxy class of preserving in advance, and be obtained the attribute information of the control of this mark correspondence in tested application by the control proxy class called.
S104: proving installation is tested this tested application according to the attribute information of the control obtained.
After proving installation gets the attribute information of control in tested application, then can test tested application according to the attribute information of the control got.Concrete, proving installation can determine the test operation information comprised in test script, and according to the attribute information of the control obtained, performs operation corresponding to this test operation information to this control.Wherein, the test operation described in the embodiment of the present application includes but not limited to clicking operation, mobile operation, setting operation.
Such as, following test script is write by javascript:
The function of above-mentioned test script is tested the button control being designated " SYSTEMSETTING " in tested application, test operation information is " click ", also namely test operation information corresponding be operating as clicking operation, then proving installation runs above-mentioned test script by browser kernel (as autoplatform.dll), determine being designated " SYSTEMSETTING " of the control wherein comprised, therefore the control proxy class that mark is similarly " SYSTEMSETTING " is called, and obtain by this control proxy class being designated " SYSTEMSETTING " attribute information being designated the button control of " SYSTEMSETTING ", and according to the attribute information got, clicking operation is performed to the button being designated " SYSTEMSETTING ".
Visible, pass through said method, test script does not need to write according to the attribute information of control, as long as write the mark of the control that will test, namely the attribute information of this control is obtained by corresponding control proxy class, due to the acquisition methods that control proxy class is the attribute information obtaining corresponding control, be equivalent to the pointer pointing to corresponding control, therefore, even if the attribute information of follow-up control changes, also the attribute information after change is directly got by control proxy class, and without the need to changing or again writing test script, therefore without the need to safeguarding test script, effectively can improve the efficiency of test.
Further, in the embodiment of the present application, this proving installation can be built in tested application, and the structure comprising the tested application of this proving installation can be as shown in Figure 2.
The structural representation comprising the application of proving installation that Fig. 2 provides for the embodiment of the present application, in fig. 2, application comprises proving installation, business application module and data supporting module.
Proving installation is used for testing results script, tests, preserve each control proxy class, preserve and output test result according to this test script to this application.
Business application module is used for providing business service to user.
Data supporting module is for preserving the attribute information of control, and wherein, this data supporting module can be graphic user interface (Graphicl User Interface) storehouse, saves the attribute information of all controls in application in this GUI storehouse.
When test script is javascript script, proving installation runs this test script by browser kernel, and obtains the attribute information of the control preserved in data supporting module by the control proxy class called.
In addition, when adopting javascript to write test script, proving installation also provides the page writing javascript script to user by browser kernel, as, load autoplatform.html by browser kernel, user can write test script in this page.
Be the method for testing that the embodiment of the present application provides above, based on same thinking, the embodiment of the present application also provides a kind of proving installation, as shown in Figure 3.
The proving installation structural representation that Fig. 3 provides for the embodiment of the present application, specifically comprises:
Determination module 301, for testing results script, determines the mark of the control comprised in described test script;
Calling module 302, in each control proxy class of preserving in advance, calls the control agency of the described mark correspondence determined, wherein, the control proxy class of described mark correspondence is for obtaining the attribute information of the control of described mark correspondence;
Acquisition module 303, obtains the attribute information identifying corresponding control described in tested application for the control proxy class by calling;
Test module 304, for testing described tested application according to the attribute information of the described control obtained.
Described test script is javascript script;
Described determination module 301 specifically for, run described test script by browser kernel, determine the mark of the control comprised in described test script.
Described test module 304 specifically for, determine the test operation information comprised in described test script, according to the attribute information of described control obtained, operation corresponding to the described test operation information determined performed to described control.
Described device also comprises:
Preserve output module 305, for preserving and exporting the test result of testing described tested application.
The embodiment of the present application provides a kind of method of testing and device, the method proving installation is according to the mark of the control comprised in test script, call the control proxy class of this mark correspondence, and the attribute information of the control of this mark correspondence in tested application is obtained by this control proxy class called, the attribute information according to the control obtained is tested this tested application.Pass through said method, test script is without the need to writing according to the attribute information of control in tested application, only need write the mark of the control that will test, namely the attribute information of this control is obtained by corresponding control proxy class, even if the attribute information of this control follow-up changes, also directly get the attribute information after change by control proxy class, and without the need to changing or again writing test script, therefore without the need to safeguarding test script, the efficiency of test can effectively be improved.
Those skilled in the art should understand, the embodiment of the application can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
In one typically configuration, computing equipment comprises one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory may comprise the volatile memory in computer-readable medium, and the forms such as random access memory (RAM) and/or Nonvolatile memory, as ROM (read-only memory) (ROM) or flash memory (flash RAM).Internal memory is the example of computer-readable medium.
Computer-readable medium comprises permanent and impermanency, removable and non-removable media can be stored to realize information by any method or technology.Information can be computer-readable instruction, data structure, the module of program or other data.The example of the storage medium of computing machine comprises, but be not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic RAM (DRAM), the random access memory (RAM) of other types, ROM (read-only memory) (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc ROM (read-only memory) (CD-ROM), digital versatile disc (DVD) or other optical memory, magnetic magnetic tape cassette, tape magnetic rigid disk stores or other magnetic storage apparatus or any other non-transmitting medium, can be used for storing the information can accessed by computing equipment.According to defining herein, computer-readable medium does not comprise non-temporary computer readable media (transitory media), as data-signal and the carrier wave of modulation.
The application describes with reference to according to the process flow diagram of the method for the embodiment of the present application, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although described the preferred embodiment of the application, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the application's scope.
Obviously, those skilled in the art can carry out various change and modification to the embodiment of the present application and not depart from the spirit and scope of the embodiment of the present application.Like this, if these amendments of the embodiment of the present application and modification belong within the scope of the application's claim and equivalent technologies thereof, then the application is also intended to comprise these change and modification.
Claims (9)
1. a method of testing, is characterized in that, comprising:
Proving installation testing results script, determines the mark of the control comprised in described test script; And
In each control proxy class of preserving in advance, call the control proxy class of the described mark correspondence determined, wherein, the control proxy class of described mark correspondence is for obtaining the attribute information of control corresponding to described mark; And
The attribute information identifying corresponding control described in tested application is obtained by the control proxy class called;
Described proving installation is tested described tested application according to the attribute information of the described control obtained.
2. the method for claim 1, is characterized in that, described test script is javascript script;
Proving installation testing results script, specifically comprises:
Described proving installation runs described test script by browser kernel.
3. the method for claim 1, is characterized in that, described proving installation is tested described tested application according to the attribute information of the described control obtained, and specifically comprises:
The test operation information comprised in described test script determined by described proving installation; And
According to the attribute information of described control obtained, operation corresponding to the described test operation information determined is performed to described control.
4. the method for claim 1, is characterized in that, described method also comprises:
Described proving installation is preserved and is exported the test result of testing described tested application.
5. the method for claim 1, is characterized in that, described proving installation is built in described tested application.
6. a proving installation, is characterized in that, comprising:
Determination module, for testing results script, determines the mark of the control comprised in described test script;
Calling module, in each control proxy class of preserving in advance, calls the control agency of the described mark correspondence determined, wherein, the control proxy class of described mark correspondence is for obtaining the attribute information of the control of described mark correspondence;
Acquisition module, obtains the attribute information identifying corresponding control described in tested application for the control proxy class by calling;
Test module, for testing described tested application according to the attribute information of the described control obtained.
7. device as claimed in claim 6, it is characterized in that, described test script is javascript script;
Described determination module specifically for, run described test script by browser kernel, determine the mark of the control comprised in described test script.
8. device as claimed in claim 6, it is characterized in that, described test module specifically for, determine the test operation information comprised in described test script, according to the attribute information of described control obtained, operation corresponding to the described test operation information determined is performed to described control.
9. device as claimed in claim 6, it is characterized in that, described device also comprises:
Preserve output module, for preserving and exporting the test result of testing described tested application.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310507864.8A CN104572431B (en) | 2013-10-24 | 2013-10-24 | A kind of method of testing and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310507864.8A CN104572431B (en) | 2013-10-24 | 2013-10-24 | A kind of method of testing and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104572431A true CN104572431A (en) | 2015-04-29 |
CN104572431B CN104572431B (en) | 2017-07-21 |
Family
ID=53088565
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310507864.8A Active CN104572431B (en) | 2013-10-24 | 2013-10-24 | A kind of method of testing and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104572431B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106383780A (en) * | 2016-09-05 | 2017-02-08 | 努比亚技术有限公司 | Monkey test method and device |
CN107102938A (en) * | 2016-02-19 | 2017-08-29 | 阿里巴巴集团控股有限公司 | The update method and device of test script |
CN108255722A (en) * | 2018-01-15 | 2018-07-06 | 厦门美图移动科技有限公司 | script generation method, script generation device and server |
CN108415826A (en) * | 2018-01-12 | 2018-08-17 | 深圳壹账通智能科技有限公司 | Test method, terminal device and the computer readable storage medium of application |
CN110413502A (en) * | 2018-04-28 | 2019-11-05 | 北京京东尚科信息技术有限公司 | Program testing method and system, computer system and computer readable storage medium storing program for executing |
CN110554967A (en) * | 2019-09-10 | 2019-12-10 | 浙江中控技术股份有限公司 | method and device for testing nonstandard control |
CN112148588A (en) * | 2020-08-21 | 2020-12-29 | 烽火通信科技股份有限公司 | Automatic analysis method and test tool for object resources of automatic test |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101630286A (en) * | 2009-08-07 | 2010-01-20 | 金蝶软件(中国)有限公司 | Automatic testing method and automatic testing device |
CN102541728A (en) * | 2010-12-14 | 2012-07-04 | 北京新媒传信科技有限公司 | Method for expanding identifiable control of automatic test tool |
CN103186460A (en) * | 2011-12-30 | 2013-07-03 | 金蝶软件(中国)有限公司 | Method, device and system for generating script of test case |
CN103309797A (en) * | 2012-03-09 | 2013-09-18 | 阿里巴巴集团控股有限公司 | Automatic testing method and device of user interface |
-
2013
- 2013-10-24 CN CN201310507864.8A patent/CN104572431B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101630286A (en) * | 2009-08-07 | 2010-01-20 | 金蝶软件(中国)有限公司 | Automatic testing method and automatic testing device |
CN102541728A (en) * | 2010-12-14 | 2012-07-04 | 北京新媒传信科技有限公司 | Method for expanding identifiable control of automatic test tool |
CN103186460A (en) * | 2011-12-30 | 2013-07-03 | 金蝶软件(中国)有限公司 | Method, device and system for generating script of test case |
CN103309797A (en) * | 2012-03-09 | 2013-09-18 | 阿里巴巴集团控股有限公司 | Automatic testing method and device of user interface |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107102938A (en) * | 2016-02-19 | 2017-08-29 | 阿里巴巴集团控股有限公司 | The update method and device of test script |
CN107102938B (en) * | 2016-02-19 | 2020-11-17 | 创新先进技术有限公司 | Test script updating method and device |
CN106383780A (en) * | 2016-09-05 | 2017-02-08 | 努比亚技术有限公司 | Monkey test method and device |
CN108415826A (en) * | 2018-01-12 | 2018-08-17 | 深圳壹账通智能科技有限公司 | Test method, terminal device and the computer readable storage medium of application |
CN108415826B (en) * | 2018-01-12 | 2021-10-29 | 深圳壹账通智能科技有限公司 | Application testing method, terminal device and computer readable storage medium |
CN108255722A (en) * | 2018-01-15 | 2018-07-06 | 厦门美图移动科技有限公司 | script generation method, script generation device and server |
CN108255722B (en) * | 2018-01-15 | 2021-01-29 | 厦门美图移动科技有限公司 | Script generation method, script generation device and server |
CN110413502A (en) * | 2018-04-28 | 2019-11-05 | 北京京东尚科信息技术有限公司 | Program testing method and system, computer system and computer readable storage medium storing program for executing |
CN110554967A (en) * | 2019-09-10 | 2019-12-10 | 浙江中控技术股份有限公司 | method and device for testing nonstandard control |
CN110554967B (en) * | 2019-09-10 | 2023-09-08 | 浙江中控技术股份有限公司 | Testing method and device for nonstandard control |
CN112148588A (en) * | 2020-08-21 | 2020-12-29 | 烽火通信科技股份有限公司 | Automatic analysis method and test tool for object resources of automatic test |
CN112148588B (en) * | 2020-08-21 | 2022-04-19 | 烽火通信科技股份有限公司 | Automatic analysis method and test tool for object resources of automatic test |
Also Published As
Publication number | Publication date |
---|---|
CN104572431B (en) | 2017-07-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104572431A (en) | Test method and test device | |
US9307342B2 (en) | Dynamic rendering for software applications | |
EP3435225B1 (en) | Mixed view display method and device | |
CN106294113B (en) | creation method and device based on programmable test service | |
CN107786630B (en) | Web application package processing method, device and equipment | |
KR20180116423A (en) | Method and apparatus for reusing ListCell in a hybrid application | |
CN108268609B (en) | File path establishing and accessing method and device | |
CN104731622B (en) | The loading method of a kind of application program, device and mobile terminal | |
CN108874379B (en) | Page processing method and device | |
CN109343793B (en) | Data migration method and device | |
US10803166B1 (en) | Automated determination of application privileges | |
CN105094878A (en) | System library file integration method and apparatus | |
CN109284115A (en) | A kind of method and device generating tracker script | |
CN106648567B (en) | Data acquisition method and device | |
US8769498B2 (en) | Warning of register and storage area assignment errors | |
CN108874491A (en) | information loading method and device | |
WO2020135129A1 (en) | Method and device for loading plug-in of application, and terminal | |
US10606612B2 (en) | Context check bypass to enable opening shared-object libraries | |
CN104461310A (en) | Page comparison method and system | |
CN110968333A (en) | Configuration information replacement method and device, machine-readable storage medium and processor | |
CN107239270B (en) | Code processing method and device | |
CN107402749A (en) | Realize the method and device in picture loading storehouse | |
CN112541327A (en) | Data reading method and device, electronic equipment and storage medium | |
CN110659105A (en) | Virtualized resource processing method, device, equipment and storage medium | |
CN110955854A (en) | Thermodynamic diagram generation method and device |
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 |