CN109002389A - The method and apparatus of page automatic test - Google Patents

The method and apparatus of page automatic test Download PDF

Info

Publication number
CN109002389A
CN109002389A CN201710422503.1A CN201710422503A CN109002389A CN 109002389 A CN109002389 A CN 109002389A CN 201710422503 A CN201710422503 A CN 201710422503A CN 109002389 A CN109002389 A CN 109002389A
Authority
CN
China
Prior art keywords
page
correcting
application program
response
application server
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
CN201710422503.1A
Other languages
Chinese (zh)
Other versions
CN109002389B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710422503.1A priority Critical patent/CN109002389B/en
Publication of CN109002389A publication Critical patent/CN109002389A/en
Application granted granted Critical
Publication of CN109002389B publication Critical patent/CN109002389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Abstract

The present invention provides a kind of method and apparatus of page automatic test, page automatic test can be made to be no longer dependent on page elements to assert, after page change, automatic test cases originally do not need all to safeguard again, need to modify configuration file only to shield the page structure part of change, it can still be returned for old structure, to realize page automatic test efficient, applied widely and low maintenance cost.This method comprises: configuring the specified network request of the page to be measured;The application server of application program sends the specified network request respectively after the application server of application program and correcting before to correcting;What the application server of application program returned after the application server of application program returns before reception correcting benchmark response and correcting responds wait compare, and compares, if responding consistent, test case success, if non_uniform response, test case failure.

Description

The method and apparatus of page automatic test
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus of page automatic test.
Background technique
Selenium is the open source automation tools that current page automatic test longest uses, and Selenium is The page automated test tool of ThoughtWorks company exploitation.It can be in WINDOWS, the kinds of platform such as LINUX, MAC Upper operation, and Java, C#, PERL can be used, a variety of programming languages such as PHP are constructed, and support the test of multiple browsers.
In the technical solution of the page automatic test of the prior art, mostly using Selenium+Python or The frame that Selenium+Java automates as the page.Element is searched by the path of page elements or attribute, by matching The desired value of test case is set to assert the existence and correctness of page elements.In general, a test case is used to Assert a kind of element of the page.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
1. current Selenium+Python Selenium+Java frame is looked by the path or attribute of page elements The mode for looking for element, it is more demanding to the building of the page, if slightly adjusting or reconstructing occur in the page, utilize original configuration Path and attribute just can not find specified element.Therefore, the frequency of maintenance of test case is higher, and maintenance cost is larger, flexibly Property is lower;
If needing to configure multiple test cases 2. verifying for the multiple elements of the page, what test case was write Higher cost;
3. the page automation framework is not suitable for the test of Web application correcting, this project is encountered, all use-cases need It reforms, but the request and server end not transformation of its real page, therefore, will cause the waste of human resources.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus of page automatic test, the page can be made certainly Dynamicization test is no longer dependent on page elements to assert, after page change, automatic test cases originally are not needed entirely Again it safeguards in portion, it is only necessary to modify configuration file to shield the page structure part of change, can still be returned for old structure Return, to realize page automatic test efficient, applied widely and low maintenance cost.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of page automatic test is provided Method.
A kind of method of page automatic test of the embodiment of the present invention includes: to configure the specified network of the page to be measured to ask It asks;The application server of application program sends the specified net respectively after the application server of application program and correcting before to correcting Network request;The application clothes of application program after the application server of application program returns before reception correcting benchmark response and correcting What business device returned responds wait compare, and compares, if response is consistent, test case success, and if non_uniform response, test case Failure.
Optionally, which comprises the specified network request of the page to be measured is configured using Java code;And it calls Application service of the httpclient tool-class of Java to application program after the application server of application program before correcting and correcting Device sends the specified network request respectively.
Optionally, the page to be measured includes following one or more: the interface upgrade class page, the structural adjustment class page, The what's new class page.
Optionally, journey is applied after the application server of application program returns before receiving correcting benchmark response and correcting The application server of sequence return wait compare response after, the method also includes: will change wait compare correspondence involved in response It is increased newly in the page of application program after version and/or the part of change is shielded.
Optionally, the method also includes: by the matched mode of canonical will wait compare response involved in correspondence correcting The part for increasing newly and/or changing in the page of application program afterwards is shielded.
To achieve the above object, according to another aspect of an embodiment of the present invention, a kind of page automatic test is provided Device.
A kind of device of page automatic test of the embodiment of the present invention includes: configuration module, for configuring the page to be measured Specified network request;Sending module, for answering for the application server to application program before correcting and application program after correcting Send the specified network request respectively with server;Contrast module, for receiving the application server of application program before correcting What the application server of application program returned after the benchmark response and correcting of return responds wait compare, and compares, if response one It causes, then test case success, if non_uniform response, test case failure.
Optionally, in described device: the configuration module is also used to configure the specified net of the page to be measured using Java code Network request;And the sending module is also used to call application of the httpclient tool-class of Java to application program before correcting The application server of application program sends the specified network request respectively after server and correcting.
Optionally, the page to be measured includes following one or more: the interface upgrade class page, the structural adjustment class page, The what's new class page.
Optionally, described device further include: shroud module, the application server for the application program before receiving correcting return Return benchmark response and correcting after application program application server return wait compare response after, will be wait compare in response The part for increasing newly and/or changing in the page of application program after the correspondence correcting being related to is shielded.
Optionally, the shroud module is also used to: will be wait compare correspondence involved in response by the matched mode of canonical The part for increasing newly and/or changing in the page of application program after correcting is shielded.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention includes: one or more processors;Storage device, for storing one Or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more of The method that processor realizes the page automatic test of the embodiment of the present invention.
To achieve the above object, another aspect according to an embodiment of the present invention, provides a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed The method of the page automatic test of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because uses by configuring specified net The response of application page is directly as benchmark test use-case before network request correcting, compares the response of the page to be measured after correcting Technological means, if slightly adjusting or reconstructing occur in the page, utilizes so overcoming the stationarity for being limited to page structure Originally the technical issues of path configured and attribute just can not find specified element, so reach page automatic test no longer according to Rely and asserted in page elements, even if page elements are changed, it is only necessary to modify configuration file to shield the page changed Structure division can still be returned for old structure, without the technical effect of waste plenty of time maintenance;In addition, utilizing this The technical solution of inventive embodiments, to be verified for multiple elements of a page, even all members of full page The verification of element and structure, writes a test case without each element, to improve the flexibility of test case, reduces and surveys It tries out the maintenance of example and writes cost, discharge human resources;By grabbing specified network request using Java code, so as to Facilitate test of the subsequent realization to the page to be measured;By having adjustment to structure or having the page to be measured of what's new, get After comparing response, the corresponding response in place of page new function or change is shielded, after accurately determining correcting The old funtion part of the page whether be successfully tested;Carrying out corresponding response contents in the way of regular expression matching Shielding completes regression test to accurately realize response ratio pair.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of the method for page automatic test according to an embodiment of the present invention;
Fig. 2 is the idiographic flow schematic diagram of the method for page automatic test according to an embodiment of the present invention;
Fig. 3 is the schematic diagram of the main modular of the device of page automatic test according to an embodiment of the present invention;
Fig. 4 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 5 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
The embodiment of the present invention proposes that a kind of page automation low for the efficient of web application, maintenance cost is surveyed The technical solution of examination can make page automatic test be no longer dependent on page elements to assert.After the change of the page, (test case, i.e. Test Case are that one group of test working out for some special objective is defeated to automatic test cases originally Enter, execution condition and expected results, to test some Program path or to verify whether meet some particular demands) it does not need All safeguard again, it is only necessary to modify configuration file to shield the page structure part of change, it still can be with for old structure Realize regression test;And the technical solution of the embodiment of the present invention could be applicable to multiple elements verification for a page, The even verification of full page all elements and structure reduces test case so as to improve the flexibility of test case Maintenance and write cost, discharge human resources.
Fig. 1 is the schematic diagram of the key step of the method for page automatic test according to an embodiment of the present invention.
As shown in Figure 1, a kind of method of page automatic test of the embodiment of the present invention mainly includes the following steps:
Step S101: the specified network request of the page to be measured is configured.In the embodiment of the present invention, the page to be measured may include with Lower one or more: the interface upgrade class page, the structural adjustment class page, the what's new class page.It is asked by configuring specified network It asks, so as to carry out the automatic test of the page after correcting according to page testing requirement.In the embodiment of the present invention, configuration is specified Network request can be the specified network request that the page to be measured is configured using Java code.
After the configuration that step S101 completes specified network request, tested since step S102.
Step S102: before to correcting after the application server of application program and correcting application program application server difference Send the specified network request.As previously mentioned, can be in the embodiment of the present invention and configure the page to be measured using Java code Specified network request, then sending specified network request can be by calling the httpclient tool-class of Java to answering before correcting It is sent respectively with the application server of application program after the application server of program and correcting.
Step S103: journey is applied after the application server of application program returns before reception correcting benchmark response and correcting What the application server of sequence returned responds wait compare, and compares, if response is consistent, test case success, and if non_uniform response, Then test case fails.
In the embodiment of the present invention, journey is applied by configuring the specified request of the page to be tested, and to before correcting and after correcting The application server of sequence sends the specified network request (test input) respectively, receives the application service of application program before correcting What the application server of application program returned after benchmark response and correcting that device returns responds wait compare and (executes condition), and right Than, if response to be compared and benchmark response (expected results) are unanimously, test case success, if if response to be compared and benchmark are rung Answer (expected results) inconsistent, then test case fails.
It should be noted that after the application server of application program returns before receiving correcting benchmark response and correcting The application server of application program return wait compare response after, the method for the page automatic test of the embodiment of the present invention is also May include: will wait compare response involved in correspondence correcting after application program the page in increase newly and/or change part into Row shielding.The purpose of this step is that there may be the ground for newly increasing or changing for the page of the web application after correcting Side can shield the place of change when asserting Response response, and only assert pervious old function and the page, It so can accurately just realize regression test.
In the embodiment of the present invention, modified place is shielded when asserting Response response, can be by just The then part that matched mode will be increased newly and/or be changed in the page of application program after comparing correspondence correcting involved in response It is shielded.
Fig. 2 is the idiographic flow schematic diagram of the method for page automatic test according to an embodiment of the present invention.
As shown in Fig. 2, the detailed process of the method for the page automatic test of the embodiment of the present invention is as follows:
(in the embodiment of the present invention, can be, but not limited to be the program write using Java code) is configured first in program The specified network request for needing to grab in the page to be measured, such as get and/or post request is (in general, can have many access The request of the web application page in the embodiment of the present invention, determines needs according to the demand for the web application tested Which request is grabbed, here it is the specified network requests said above, then configure in configuration file, if web application Needing all to grab all to grab, if you do not need to needs are just grabbed, can be with flexible configuration).The embodiment of the present invention In, the division of general test use-case is a request with a page for a test case, each page is a base Class, circulation execute all test cases under such.
Then by can be, but not limited to call the httpclient tool-class of Java, respectively to the Web application before correcting Two application servers where web application after program and correcting send configured get and/or post request, so The Response response that two application servers return is grabbed afterwards.
The Response response for the request that two application servers return is compared, finally with the request that returns before correcting On the basis of Response response, assert whether the Response response of the request returned after correcting is correct.
If only page interface upgrades class testing, page structure variation it is not related to, that two application servers return Request Response response should be completely the same, this test case is just counted as function, otherwise this test case failure;Such as Fruit belongs to page structure adjustment class testing or page what's new class testing, because page structure is there may be adjustment, The Response response that certain requests for obtaining page structure return can not just may compare unanimously completely, but this may not It is mistake, just needs to mask some inconsistent situations in Response response at this time, so that it is not involved in comparison (is here It is no to need to mask some as a result, it is made to be not involved in comparison in Response response, can be realized by configuring), pass through Configure shield certain test cases for new function change part and/or structural modification sector of breakdown, only do with before correcting The corresponding original function of application program regression test.In the embodiment of the present invention, it can be shielded by regular expression matching The part newly changed in Response is covered, remaining original can partially compare corresponding with application program before correcting must be completely Test case success is unanimously just calculated, otherwise this test case executes failure.
The method of page automatic test according to an embodiment of the present invention can be seen that because using specified by configuring Network request obtains the response of application page before correcting directly as benchmark test use-case, compares the response of the page to be measured after correcting Technological means, so overcome the stationarity for being limited to page structure, if slightly adjusting or reconstructing occur in the page, benefit The technical issues of just can not find specified element with the path and attribute configured originally, and then reach page automatic test no longer It is asserted dependent on page elements, even if page elements are changed, it is only necessary to modify configuration file to shield the page changed Face structure division can still be returned for old structure, without the technical effect of waste plenty of time maintenance;In addition, utilizing The technical solution of the embodiment of the present invention, so that multiple elements for a page are verified, even full page is all The verification of element and structure writes a test case without each element, to improve the flexibility of test case, reduces The maintenance of test case and cost is write, discharges human resources;By grabbing specified network request using Java code, so as to To facilitate test of the subsequent realization to the page to be measured;By having adjustment to structure or having the page to be measured of what's new, obtain To the corresponding response in place for after comparing response, shielding page new function or change, so as to accurately determine correcting Whether the old funtion part of the page afterwards is successfully tested;Carrying out corresponding response contents in the way of regular expression matching Shielding, thus accurately realize response ratio pair, complete regression test.
Fig. 3 is the schematic diagram of the main modular of the device of page automatic test according to an embodiment of the present invention.
As shown in figure 3, the device 300 of the page automatic test of the embodiment of the present invention mainly includes following module: configuration Module 301, sending module 302 and contrast module 303.
Wherein, configuration module 301 is used to configure the specified network request of the page to be measured;Sending module 302 is used for correcting The application server of application program sends the specified network request respectively after the application server of preceding application program and correcting;It is right Application program after the benchmark response and correcting that are returned than the application server that module 303 is used to receive application program before correcting What application server returned responds wait compare, and compares, if response is consistent, test case success if non_uniform response, is surveyed Example failure on probation.
In device 300: configuration module 301 can also be used in the specified network request that the page to be measured is configured using Java code; And sending module 302 can also be used to call application server of the httpclient tool-class of Java to application program before correcting The specified network request is sent respectively with the application server of application program after correcting.
In the embodiment of the present invention, the page to be measured includes following one or more: the interface upgrade class page, structural adjustment class page Face, the what's new class page.
In addition, device 300 can also include: shroud module (not shown), for the application program before receiving correcting Application server return benchmark response and correcting after application program application server return wait compare response after, It will be increased newly in the page of application program after comparing correspondence correcting involved in response and/or the part of change shield.
It should be noted that shroud module can be also used for: will be wait compare involved in response by the matched mode of canonical Correspondence correcting after application program the page in increase newly and/or change part shielded.
From the above, it can be seen that obtaining application page before correcting by configuring specified network request because using Response compares the technological means of the response of the page to be measured after correcting, is limited to so overcoming directly as benchmark test use-case The stationarity of page structure is just looked for if slightly adjusting or reconstructing occur in the page using the path and attribute that configured originally The technical issues of less than specified element, and then reach page automatic test and be no longer dependent on page elements to assert, i.e., Change page elements, it is only necessary to modify configuration file to shield the page structure part changed, for old structure according to It is old to return, without the technical effect of waste plenty of time maintenance;In addition, using the technical solution of the embodiment of the present invention, from And verified for multiple elements of a page, the even verification of full page all elements and structure, without each Element all writes a test case, thus improve the flexibility of test case, reduce the maintenance of test case and write cost, Discharge human resources;By grabbing specified network request using Java code, so as to facilitate subsequent realization to the page to be measured Test;By having adjustment to structure or having the page to be measured of what's new, get after comparing response, the shielding page is new The corresponding response in the place of function or change, so as to accurately determine whether the old funtion part of the page after correcting is surveyed It tries successfully;Shielding carrying out corresponding response contents in the way of regular expression matching, to accurately realize response ratio It is right, complete regression test.
Fig. 4 shows the page automated testing method or page automatic test device that can apply the embodiment of the present invention Exemplary system architecture 400.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405. Network 404 between terminal device 401,402,403 and server 405 to provide the medium of communication link.Network 404 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 401,402,403 and be interacted by network 404 with server 405, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath -- merely illustrative) feed back to terminal device.
It should be noted that page automated testing method provided by the embodiment of the present invention is generally held by server 405 Row, correspondingly, page automatic test device is generally positioned in server 405.
It should be understood that the number of terminal device, network and server in Fig. 4 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 509, and/or from can Medium 511 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 501, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include configuration module, sending module and contrast module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, configuration module is also described as " configuring the module of the specified network request of the page to be measured ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: the specified network request for configuring the page to be measured;Before to correcting after the application server of application program and correcting The application server of application program sends the specified network request respectively;The application server of application program returns before reception correcting What the application server of application program returned after the benchmark response and correcting returned responds wait compare, and compares.
Technical solution according to an embodiment of the present invention, because using by being answered before configuring specified network request acquisition correcting With the response of the page directly as benchmark test use-case, the technological means of the response of the page to be measured after correcting is compared, so overcoming Be limited to the stationarity of page structure, if slightly adjusting or reconstructing occur in the page, using the path configured originally and Attribute just can not find the technical issues of specified element, and then reaches page automatic test and be no longer dependent on page elements to do It asserts, even if page elements are changed, it is only necessary to modify configuration file to shield the page structure part changed, for old Structure can still return, without the technical effect of waste plenty of time maintenance;In addition, utilizing the technical side of the embodiment of the present invention Case, so that multiple elements for a page are verified, the even verification of full page all elements and structure is not necessarily to Each element writes a test case, to improve the flexibility of test case, reduce the maintenance of test case and write Cost discharges human resources;By grabbing specified network request using Java code, so as to facilitate subsequent realization to be measured The test of the page;By having adjustment to structure or having the page to be measured of what's new, get after comparing response, shielded page The corresponding response in the place of face new function or change, the old funtion part so as to the page after accurately determining correcting are It is no to be successfully tested;Shielding being carried out corresponding response contents in the way of regular expression matching, is rung to accurately realize It should compare, complete regression test.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (12)

1. a kind of method of page automatic test characterized by comprising
Configure the specified network request of the page to be measured;
Before to correcting after the application server of application program and correcting the application server of application program send respectively it is described specified Network request;
The application service of application program after the application server of application program returns before reception correcting benchmark response and correcting What device returned responds wait compare, and compares, if response is consistent, test case success, if non_uniform response, test case is lost It loses.
2. the method according to claim 1, wherein the described method includes:
The specified network request of the page to be measured is configured using Java code;And
Call the httpclient tool-class of Java to application program after the application server of application program before correcting and correcting Application server sends the specified network request respectively.
3. the method according to claim 1, wherein the page to be measured includes following one or more: interface Upgrade the class page, the structural adjustment class page, the what's new class page.
4. the method according to claim 1, wherein the application server of application program returns before receiving correcting Benchmark response and correcting after application program application server return wait compare response after, the method also includes: It will be increased newly in the page of application program after comparing correspondence correcting involved in response and/or the part of change shield.
5. according to the method described in claim 4, it is characterized in that, the method also includes: passing through the matched mode of canonical will It is increased newly in the page of application program after comparing correspondence correcting involved in response and/or the part of change is shielded.
6. a kind of device of page automatic test characterized by comprising
Configuration module, for configuring the specified network request of the page to be measured;
Sending module, for the application server to application program before correcting and the application server of application program after correcting difference Send the specified network request;
Contrast module, using journey after benchmark response and correcting that the application server for receiving application program before correcting returns What the application server of sequence returned responds wait compare, and compares, if response is consistent, test case success, and if non_uniform response, Then test case fails.
7. device according to claim 6, which is characterized in that in described device:
The configuration module is also used to configure the specified network request of the page to be measured using Java code;And
The sending module is also used to call application server of the httpclient tool-class of Java to application program before correcting The specified network request is sent respectively with the application server of application program after correcting.
8. device according to claim 6, which is characterized in that the page to be measured includes following one or more: interface Upgrade the class page, the structural adjustment class page, the what's new class page.
9. device according to claim 6, which is characterized in that described device further include: shroud module, for changing in reception Version before application program application server return benchmark response and correcting after application program application server return to It compares after responding, the portion that will be increased newly and/or change in the page of application program after comparing correspondence correcting involved in response Divide and is shielded.
10. device according to claim 9, which is characterized in that the shroud module is also used to: passing through the matched side of canonical Formula will increase newly in the page of application program after comparing correspondence correcting involved in response and/or the part of change shields.
11. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 5 is realized when row.
CN201710422503.1A 2017-06-07 2017-06-07 Method and device for automatically testing page Active CN109002389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710422503.1A CN109002389B (en) 2017-06-07 2017-06-07 Method and device for automatically testing page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710422503.1A CN109002389B (en) 2017-06-07 2017-06-07 Method and device for automatically testing page

Publications (2)

Publication Number Publication Date
CN109002389A true CN109002389A (en) 2018-12-14
CN109002389B CN109002389B (en) 2022-03-04

Family

ID=64573929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710422503.1A Active CN109002389B (en) 2017-06-07 2017-06-07 Method and device for automatically testing page

Country Status (1)

Country Link
CN (1) CN109002389B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889402A (en) * 2019-01-23 2019-06-14 北京字节跳动网络技术有限公司 Method and apparatus for generating information
CN110086692A (en) * 2019-05-14 2019-08-02 广州云智易物联网有限公司 A kind of automated testing method based on Internet of Things, device and computer equipment
CN112579425A (en) * 2019-09-27 2021-03-30 腾讯科技(深圳)有限公司 Method, device and medium for testing small program method interface

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658158A (en) * 2004-01-28 2005-08-24 微软公司 Method and system for masking dynamic regions in a user interface to enable testing of user interface consistency
CN101526916A (en) * 2008-03-03 2009-09-09 阿里巴巴集团控股有限公司 Method and system for using page-based object flow verification in regression test
CN102902619A (en) * 2011-07-29 2013-01-30 阿里巴巴集团控股有限公司 Method and device for regression testing of Web application programs
CN102932197A (en) * 2011-08-11 2013-02-13 阿里巴巴集团控股有限公司 Testing method and system
US20170083290A1 (en) * 2015-09-21 2017-03-23 Shridhar V. Bharthulwar Integrated System for Software Application Development

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658158A (en) * 2004-01-28 2005-08-24 微软公司 Method and system for masking dynamic regions in a user interface to enable testing of user interface consistency
CN101526916A (en) * 2008-03-03 2009-09-09 阿里巴巴集团控股有限公司 Method and system for using page-based object flow verification in regression test
CN102902619A (en) * 2011-07-29 2013-01-30 阿里巴巴集团控股有限公司 Method and device for regression testing of Web application programs
CN102932197A (en) * 2011-08-11 2013-02-13 阿里巴巴集团控股有限公司 Testing method and system
US20170083290A1 (en) * 2015-09-21 2017-03-23 Shridhar V. Bharthulwar Integrated System for Software Application Development

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889402A (en) * 2019-01-23 2019-06-14 北京字节跳动网络技术有限公司 Method and apparatus for generating information
CN110086692A (en) * 2019-05-14 2019-08-02 广州云智易物联网有限公司 A kind of automated testing method based on Internet of Things, device and computer equipment
CN112579425A (en) * 2019-09-27 2021-03-30 腾讯科技(深圳)有限公司 Method, device and medium for testing small program method interface

Also Published As

Publication number Publication date
CN109002389B (en) 2022-03-04

Similar Documents

Publication Publication Date Title
CN108984370A (en) A kind of method and apparatus of determining monitoring threshold value
CN109558134A (en) The method and apparatus of business datum verification
CN108694104A (en) A kind of interface function contrast test method, apparatus, electronic equipment and storage medium
CN107844324A (en) Customer terminal webpage redirects treating method and apparatus
CN110109979A (en) A kind of allocation list radio button method and apparatus
CN110019125A (en) The method and apparatus of data base administration
CN107908666A (en) A kind of method and apparatus of identification equipment mark
CN110019087A (en) Data processing method and its system
CN109634833A (en) A kind of Software Defects Predict Methods and device
CN110471848A (en) A kind of method and apparatus of dynamic returned packet
CN109347921A (en) A kind for the treatment of method and apparatus of digital certificate business
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN109933509A (en) A kind of method and apparatus for realizing automatic test defect management
CN109002389A (en) The method and apparatus of page automatic test
CN109918191A (en) A kind of method and apparatus of the anti-frequency of service request
CN110019539A (en) A kind of method and apparatus that the data of data warehouse are synchronous
CN110309142A (en) The method and apparatus of regulation management
CN107347093A (en) Collocation method and device for distributed server system
CN112817562A (en) Service processing method and device
CN108875355A (en) A kind of control method and device of access authority
CN109814957A (en) A kind of label addition method and device for IOS system
CN112887355B (en) Service processing method and device for abnormal server
CN109522202A (en) A kind of method and apparatus of software test
CN107729394A (en) Data Mart management system and its application method based on Hadoop clusters
US8341530B1 (en) Customer service center database management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant