CN107256195B - Webpage front-end test method and device - Google Patents

Webpage front-end test method and device Download PDF

Info

Publication number
CN107256195B
CN107256195B CN201710425734.8A CN201710425734A CN107256195B CN 107256195 B CN107256195 B CN 107256195B CN 201710425734 A CN201710425734 A CN 201710425734A CN 107256195 B CN107256195 B CN 107256195B
Authority
CN
China
Prior art keywords
tested
test
data
client
file
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
CN201710425734.8A
Other languages
Chinese (zh)
Other versions
CN107256195A (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.)
China Southern Power Grid Internet Service Co ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710425734.8A priority Critical patent/CN107256195B/en
Publication of CN107256195A publication Critical patent/CN107256195A/en
Priority to PCT/CN2018/074486 priority patent/WO2018223717A1/en
Application granted granted Critical
Publication of CN107256195B publication Critical patent/CN107256195B/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/3684Test management for test design, e.g. generating new test cases
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention provides a kind of webpage front-end test method and device, is related to Internet technical field.The method is applied to be in communication with each other the client and web page server of connection, which comprises client end response test instruction generates access request data, wherein access request data includes for identifying the test mark for needing function to be tested to be tested;Access request data is sent to web page server;Web page server is identified according to test, obtains test case corresponding with function to be tested;According to access request data, data to be feedback are obtained, wherein data to be feedback include file to be tested corresponding with function to be tested;According to test case and data to be feedback, response data is generated;Response data is sent to client;Client executing response data, to obtain test result.The degree of coupling of response data is reduced, testing efficiency and accuracy is improved, reduces the time cost and human cost of test.

Description

Webpage front-end test method and device
Technical field
The present invention relates to Internet technical fields, in particular to webpage front-end test method and device.
Background technique
Webpage front-end is the important branch of Internet technology, is occupied in terms of showing interface and user's interaction particularly important Status.With the development of internet, more and more back end business logics gradually front end, so that front-end business logic is increasingly multiple It is miscellaneous.
Front-end technology was maked rapid progress in recent years, and therewith, front end field also emerges various unit test plans one after another, such as: Jasmine, mocha etc..Though these unit test plans can guarantee front-end code quality to a certain extent.But exist industry For the test case direct-coupling for function of being engaged in service code, the high degree of coupling of front-end business code causes front end unit test to use Example maintenance becomes complex.
Summary of the invention
The purpose of the present invention is to provide a kind of webpage front-end test methods, to improve the above problem.
Another object of the present invention is to provide a kind of webpage front-end test devices, to improve the above problem.
To achieve the goals above, technical solution used in the embodiment of the present invention is as follows:
The embodiment of the present invention provides a kind of webpage front-end test method.The method is applied to be in communication with each other the client of connection End and web page server.The described method includes: the client end response test instruction, generates access request data, wherein described Access request data includes for identifying the test mark for needing function to be tested to be tested;The client asks the access Data are asked to be sent to the web page server;The web page server is identified according to the test, is obtained and function pair to be tested The test case answered;The web page server obtains data to be feedback according to access request data, wherein the number to be feedback According to including file to be tested corresponding with the function to be tested;The web page server is according to the test case and to be feedback Data generate response data;The response data is sent to the client by the web page server;The client executing The response data, to obtain test result.
The embodiment of the present invention also provides a kind of webpage front-end test method.The method is applied to connect with client communication Web page server, which comprises receive the access request data that the client is sent, wherein the access request Data include for identifying the test mark for needing function to be tested to be tested;According to the test identify, obtain with it is to be tested The corresponding test case of function;According to access request data, obtain data to be feedback, wherein the data to be feedback include with The corresponding file to be tested of the function to be tested;According to the test case and data to be feedback, response data is generated;By institute State response data and be sent to the client, to obtain the test result of the client feedback, wherein the test result by It is generated after response data described in the client executing.
The embodiment of the present invention also provides a kind of webpage front-end test device.Described device is applied to connect with client communication Web page server, described device includes: receiving module, obtains module, generation module and sending module.Receiving module is used for Receive the access request data that the client is sent, wherein the access request data includes need to be to be tested for mark The test of function to be tested identifies.Module is obtained, for identifying according to the test, obtains test corresponding with function to be tested Use-case;And be also used to obtain data to be feedback according to access request data, wherein the data to be feedback include with it is described to The corresponding file to be tested of test function.Generation module, for generating number of responses according to the test case and data to be feedback According to.Sending module, for the response data to be sent to the client, to obtain the test knot of the client feedback Fruit, wherein the test result generates after the response data as described in the client executing.
Compared with prior art, a kind of webpage front-end test method provided by the invention and device.It can be applied to phase intercommunication Believe the client and web page server of connection.The method includes client end response tests to instruct, and generates access request number According to, wherein the access request data includes for identifying the test mark for needing function to be tested to be tested.The webpage clothes Business device is identified according to the test, obtains test case corresponding with function to be tested.It accurately and quickly finds corresponding Test case passes through efficiency.According to access request data, data to be feedback are obtained, wherein the data to be feedback include and institute State the corresponding file to be tested of function to be tested;According to the test case and data to be feedback, response data is generated.To subtract Feedback data of waiting a little while,please and test case are highly coupled, and improve that test case is maintainable and testing efficiency.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows the application environment schematic diagram of present pre-ferred embodiments.
Fig. 2 is the block diagram for the web page server that present pre-ferred embodiments provide.
Fig. 3 is a kind of flow chart for webpage front-end test method that first embodiment of the invention provides.
Fig. 4 is the sub-step flow chart of step S101 in Fig. 3.
Fig. 5 is the sub-step flow chart of step S105 in Fig. 3.
Fig. 6 is a kind of flow chart for webpage front-end test method that second embodiment of the invention provides.
A kind of block diagram for webpage front-end test device that Fig. 7 third embodiment of the invention provides.
Icon: 400- user terminal;401- client;100- web page server;300- network;111- memory;112- Processor;113- communication unit;200- webpage front-end test device;201- receiving module;202- obtains module;203- generates mould Block;204- sending module.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
The following each embodiments of the present invention can be applied in environment as shown in Figure 1 unless otherwise instructed, as shown in Figure 1, User terminal 400, web page server 100 are located in network 300, and network 300 includes wireless network or cable network, pass through network 300, user terminal 400 and web page server 100 carry out data interaction.Web page server 100 can be a server, can also To be multiple servers for executing different task.
In the embodiment of the present invention, user terminal 400 be preferably mobile terminal device, such as may include smart phone, Tablet computer, E-book reader, pocket computer on knee, vehicle-mounted computer, wearable mobile terminal etc..The user terminal Client 401 is installed in 400, it is corresponding with web page server 100, service is provided for user.The client 401 and the net Page server 100 communicates to connect.The client 401 can be browser, or other webpage accessible servers 100 APP.
As shown in Fig. 2, being the block diagram of web page server 100 in Fig. 1.The web page server 100 includes webpage Head end test device 200, memory 111, processor 112 and communication unit 113.
The memory 111, processor 112 and each element of communication unit 113 are directly or indirectly electrical between each other Connection, to realize the transmission or interaction of data.For example, these elements can pass through one or more communication bus or letter between each other Number line, which is realized, to be electrically connected.The webpage front-end test device 200 includes at least one can be with software or firmware (Firmware) Form be stored in the memory 111 or be solidificated in the operating system (Operating of the web page server 100 System, OS) in software function module.The processor 112 is for executing the executable mould stored in the memory 111 Block, such as software function module and computer program etc. included by the webpage front-end test device 200.
Wherein, the memory 111 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM), realize the storage system etc. of data persistence function.Wherein, memory 111 for store program or Person's data.The communication unit 113 is used to establish the web page server 100 and other communication terminals by the network 300 Between communication connection, and for passing through 300 sending and receiving data of network.
It should be understood that structure shown in FIG. 1 is only the structural schematic diagram of web page server 100, the web service Device 100 may also include than shown in Fig. 1 more perhaps less component or with the configuration different from shown in Fig. 1.In Fig. 1 Shown in each component can using hardware, software, or its combination realize.
First embodiment
Referring to figure 3., it is a kind of webpage front-end test method that present pre-ferred embodiments provide, applied to being in communication with each other The client 401 and web page server 100 of connection.The webpage front-end test method the following steps are included:
Step S101,401 response test of the client instruction generate access request data.
In the present embodiment, client 401 obtains the data of load webpage by access request data from web page server 100 And realize the data of various front end website services.The access request data includes needing function to be tested to be tested for identifying And the test mark of file to be tested corresponding with function to be tested.It should be noted that function to be tested and file to be tested Between corresponding relationship can preset.The access request data further includes the corresponding web page address of web page server 100 (for example, the corresponding web page address of Baidu's web page server 100 is www.***.com).Function to be tested can be webpage The corresponding functional module of front end website service.File to be tested can be the script file for realizing function to be tested, such as can be with It is front end javascript script file.As shown in figure 4, step S101 includes following sub-step:
Sub-step S1011, the client 401 respond test instruction, obtain it is corresponding with the test instruction to Test business information.
In the present embodiment, test instruction can be triggering and test one or more front end website services of webpage Instruction.Test instruction can be triggered by test man by user terminal 400, be also possible to according to the rule triggering pre-seted. Business information to be tested, which can be, to be designated to need the tested corresponding function to be tested of one or more front end website services Business information.Business information to be tested includes the identification information of function to be tested and the business rule for realizing function to be tested. Corresponding relationship between front end website service and business information to be tested can be by being pre-set at user terminal 400.
Sub-step S1012, the client 401 generate corresponding with the function to be tested according to business information to be tested Test mark.
In the present embodiment, test mark includes file identification to be tested and Function Identification to be tested.Files-designated to be tested Knowledge can be file name to be tested, for example, file name to be tested can be demo.js;Function Identification to be tested can be The title of function to be tested, for example, the title of function to be tested can be DemoController.demoFunction.Client End 401 generates file identification to be tested and Function Identification to be tested according to business information to be tested.
Sub-step S1013, the client 401 obtain web page address corresponding with the web page server 100.
Sub-step S1014, the client 401 generate the access according to the web page address and test mark and ask Seek data.
In the present embodiment, client 401 accesses web page server 100 by web page address to obtain the number of load webpage According to and realize the data of various front end website services, for example, multiple front end JS script texts corresponding with every front end website service The picture resources file such as part, front end CSS style file, jpg, png, these resource files can take from webpage simultaneously in access It is obtained in business device 100.Test mark is for indicating through access request data need function to be tested to be tested and to be measured Try file.The access request data can be including access address, and access address includes web page address and test mark.Example Such as, access address can be ***.com? testFile=demo.js&testModule= DemoController.demoFunction。
The access request data is sent to the web page server 100 by step S102, client 401.
In the present embodiment, client 401 is automatically transmitted to web page server 100 after generating access request data.Tool Body, access request is sent to by web page server 100 by network 300.So that process enters step S103.
Step S103, the web page server 100 are identified according to the test, obtain test corresponding with function to be tested Use-case.
In the present embodiment, after web page server 100 receives access request data, the test in access request data is parsed Mark, to obtain file identification to be tested and Function Identification to be tested in test mark.Test case (Test Case) be for Some special objective and one group of test input, execution condition and the expected results worked out.Each function to be tested exists Corresponding test case.Test case and test case and it can be to the corresponding relationship between brake and be stored in advance in net In page server 100.Therefore, after parsing Function Identification to be tested from test mark, according to Function Identification to be tested, benefit With test case with obtained from pre-stored test case to the corresponding relationship between brake it is corresponding with function to be tested Test case.The accuracy and efficiency for searching test case corresponding with function to be tested are improved in this way.
Step S104, the web page server 100 obtain data to be feedback according to access request data, wherein it is described to Feedback data includes file to be tested corresponding with the function to be tested.
In the present embodiment, data to be feedback, which can be, feeds back to client 401 so that client 401 loads the number of webpage According to and realize the data of various front end website services.Data to be feedback may include, but be not limited to include: file to be tested, temporarily The picture resources file such as the corresponding script file of the function of not testing, front end CSS style file, jpg, png.
Step S105, the web page server 100 generate response data according to the test case and data to be feedback.
In the present embodiment, the test case that the web page server 100 will acquire dynamically is injected described to anti- Data are presented, to generate response data.Test case is separated with all script files, test when by will acquire with it is to be tested In the corresponding test case Dynamic injection data to be feedback of function, the degree of coupling of response data is effectively reduced, number of responses is made According to optimised, the burden of the mitigation load response data of client 401.It is reduced by Dynamic injection test case and is even detached from simultaneously Dependence of the test case to running environment realizes that the test case of any environment introduces, and greatling improve test case can safeguard Property and testing efficiency.Optionally, as shown in figure 5, step S105 includes following sub-step:
Sub-step S1051, the web page server 100 is according to the file identification to be tested from the data to be feedback Obtain the corresponding file to be tested.
It in the present embodiment, include the script file for realizing each front end website service in data to be feedback, from all File to be tested is found out by file identification to be tested in script file.It should be noted that even if only testing a front end Website service, client 401 is both needed to first access web page server 100, and accesses web page server 100, can request simultaneously multiple The corresponding multiple front end JS script files of front end website service.
Sub-step S1052, the web page server 100 will according to business rule corresponding with the Function Identification to be tested The test case injects the file to be tested.
In the present embodiment, business rule can be the service logic during website service is realized, for example, search service Business rule be first to show search interface, then receive search content, then carry out searching element, finally show search result.Injection Test case, which can be, test case to be added in the script file of file to be tested.Test case is injected according to business rule It can be in file to be tested, select the position that test case is added in file to be tested according to business rule.For example, test When function of search, according to the business rule of search service, the test case for testing function of search is infused in realization display search After the script file at interface, make file to be tested during being performed, starts to execute survey after showing search interface Try the test case of function of search.It can reduce in this way, even eliminate dependence of the test case to test environment.
In the present embodiment, the file to be tested for having been injected into test case is replaced and does not inject test use in data to be feedback The file to be tested of example, to generate response data.
The response data is sent to the client 401 by step S106, the web page server 100.
In the present embodiment, and by response data by network 300 it is sent to client 401.
Step S107, the client 401 execute the response data, to obtain test result.
In the present embodiment, data load webpage to client 401 according to response.Start function to be tested.It can be with Being that operation is corresponding with function to be tested is filled with the file to be tested of test case, to obtain the test under preset test environment As a result.It is alternatively possible to carry out test result collection using JavaScript Object Notation.
The test result is sent to the web page server 100 by step S108, the client 401.
In the present embodiment, the test result of collection is sent to web page server 100.For example, by the survey of JSON format Test result is sent to web page server 100 by ajax.
Step S109, the web page server 100 are shown the test result.
In the present embodiment, the test result received is parsed.It concentrates and shows that different web sites service corresponding test result. To handle the test result of different web sites service, for example, when test result shows that the business of a web site traffic is patrolled Volume there are logical problems, then are adjusted to the service logic sequence of the website also.Can to Website development personnel provide from Microcosmic (individual event front-end business function) arrives the unified monitoring of macroscopical (Website front-end entirety business function), greatlys improve business function It can be with the stability and maintainability of entire website.
Second embodiment
As shown in fig. 6, being a kind of webpage front-end test method that present pre-ferred embodiments provide, the method is applied to Web page server 100, the webpage front-end test method the following steps are included:
Step S201 receives the access request data that the client 401 is sent, wherein the access request data packet It includes for identifying the test mark for needing function to be tested to be tested.
In the present embodiment, access request data is parsed, is obtained from access request data to be tested to be tested to needing The test of function identifies.Test mark includes file identification to be tested and Function Identification to be tested.File identification to be tested can be with It is file name to be tested, for example, file name to be tested can be demo.js;Function Identification to be tested can be to be tested The title of function, for example, the title of function to be tested can be DemoController.demoFunction.Client 401 File identification to be tested and Function Identification to be tested are generated according to business information to be tested.
Step S202 is identified according to the test, obtains test case corresponding with function to be tested.
In the present embodiment, it test case and test case and can be stored in advance in the corresponding relationship between brake In web page server 100.Therefore, after parsing Function Identification to be tested from test mark, according to Function Identification to be tested, It is obtained from pre-stored test case using test case and to the corresponding relationship between brake and function pair to be tested The test case answered.The accuracy and efficiency for searching test case corresponding with function to be tested are improved in this way.
Step S203 obtains data to be feedback according to access request data, wherein the data to be feedback include and institute State the corresponding file to be tested of function to be tested.
In the present embodiment, data to be feedback, which can be, feeds back to client 401 so that client 401 loads the number of webpage According to and realize the data of various front end website services.Data to be feedback may include, but be not limited to include: file to be tested, temporarily The picture resources file such as the corresponding script file of the function of not testing, front end CSS style file, jpg, png.
Step S204 generates response data according to the test case and data to be feedback.
In the present embodiment, the test case that the web page server 100 will acquire dynamically is injected described to anti- Data are presented, to generate response data.Test case is separated with all script files, test when by will acquire with it is to be tested In the corresponding test case Dynamic injection data to be feedback of function, the degree of coupling of response data is effectively reduced, number of responses is made According to optimised, the burden of the mitigation load response data of client 401.It is reduced by Dynamic injection test case and is even detached from simultaneously Dependence of the test case to running environment realizes that the test case of any environment introduces, and greatling improve test case can safeguard Property and testing efficiency.Optionally, execute step S204 mode can be according to the file identification to be tested from it is described to The corresponding file to be tested is obtained in feedback data;According to business rule corresponding with the Function Identification to be tested by institute It states test case and injects the file to be tested.
The response data is sent to the client 401 by step S205, to obtain the feedback of client 401 Test result, wherein the test result generates after executing the response data by the client 401.
Step S206 is shown the test result.
In the present embodiment, the test result received is parsed.It concentrates and shows that different web sites service corresponding test result. To handle the test result of different web sites service, for example, when test result shows that the business of a web site traffic is patrolled Volume there are logical problems, then are adjusted to the service logic sequence of the website also.Can to Website development personnel provide from Microcosmic (individual event front-end business function) arrives the unified monitoring of macroscopical (Website front-end entirety business function), greatlys improve business function It can be with the stability and maintainability of entire website.
3rd embodiment
Fig. 7 is please referred to, is the webpage front-end test dress applied to web page server 100 that present pre-ferred embodiments provide Set 200.Webpage front-end test device 200 includes: receiving module 201, obtains module 202, generation module 203 and sending module 204。
Receiving module 201, the access request data sent for receiving the client 401, wherein the access request Data include for identifying the test mark for needing function to be tested to be tested.
In embodiments of the present invention, step S201 can be executed by receiving module 201.
Module 202 is obtained, for identifying according to the test, obtains test case corresponding with function to be tested;And also For obtaining data to be feedback according to access request data, wherein the data to be feedback include and the function pair to be tested The file to be tested answered.
In the present embodiment, step S202, step S203, step S103 step S104 can be executed by acquisition module 202.
Generation module 203, for generating response data according to the test case and data to be feedback.
In the present embodiment, step S204 and step S105 can be executed by generation module 203.It should be noted that sub Step S1051 and sub-step S1051 can also be executed by generation module 203.Generation module 203 executes step S204 or step The mode of S105 can be the test case that will acquire and dynamically inject the data to be feedback, to generate response data. Optionally, the test case is dynamically injected in the following way: according to the file identification to be tested from described to be feedback The corresponding file to be tested is obtained in data, it will be described further according to business rule corresponding with the Function Identification to be tested Test case injects the file to be tested.
Sending module 204, for the response data to be sent to the client 401, to obtain the client 401 The test result of feedback, wherein the test result generates after executing the response data by the client 401.
In the present embodiment, step S205 and step S106 can be executed by sending module 204.
In the present embodiment, webpage front-end test device 200 further includes display module, and the display module is used for described Test result is shown.Optionally, step S109 and step S206 can be executed by display module.
In conclusion a kind of webpage front-end test method provided in an embodiment of the present invention and device.The method is applied to It is in communication with each other the client and web page server of connection.The described method includes: client end response test instruction, generates access request Data, wherein the access request data includes for identifying the test mark for needing function to be tested to be tested;By the visit Ask that request data is sent to the web page server;The web page server is identified according to the test, is obtained and function to be tested It can corresponding test case;According to access request data, data to be feedback are obtained, wherein the data to be feedback include and institute State the corresponding file to be tested of function to be tested;According to the test case and data to be feedback, response data is generated;It will be described Response data is sent to the client;Response data described in the client executing, to obtain test result.Reduce test process The degree of coupling of middle client load data, reduces dependence of the test case to test environment, improves testing efficiency.Test case More convenient management service.And then reduce the human cost and time cost of webpage front-end test job.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. a kind of webpage front-end test method, which is characterized in that the method is applied to be in communication with each other the client and net of connection Page server, which comprises
The client end response test instruction, generates access request data, wherein the access request data includes for identifying Need the test mark of function to be tested to be tested;
The access request data is sent to the web page server by the client;
The web page server is identified according to the test, obtains test case corresponding with function to be tested, and the test is used Example includes preset one group of test input, executes condition and expected results;
The web page server obtains data to be feedback according to access request data, wherein the data to be feedback include and institute The corresponding file to be tested of function to be tested is stated, the file to be tested is front end javascript script file;
The test case is dynamically injected the file to be tested by the web page server, to generate response data;
The response data is sent to the client by the web page server;
Response data described in the client executing, to obtain test result.
2. webpage front-end test method as described in claim 1, which is characterized in that the test mark includes file to be tested The test case is dynamically injected the step of the data to be feedback by mark and Function Identification to be tested, the web page server Suddenly include:
The web page server obtains from the data to be feedback corresponding described to be measured according to the file identification to be tested Try file;
The test case is injected institute according to business rule corresponding with the Function Identification to be tested by the web page server State file to be tested.
3. webpage front-end test method as described in claim 1, which is characterized in that the client end response test instruction, it is raw Include: at the step of access request data
Instruction is tested described in the client end response, obtains business information to be tested corresponding with the test instruction;
The client generates test mark corresponding with the function to be tested according to business information to be tested;
The client obtains web page address corresponding with the web page server;
The client generates the access request data according to the web page address and test mark.
4. webpage front-end test method as described in claim 1, which is characterized in that the method also includes:
The test result is sent to the web page server by the client;
The web page server is shown the test result.
5. a kind of webpage front-end test method, which is characterized in that the method is applied to the webpage connecting with client communication clothes Business device, which comprises
Receive the access request data that the client is sent, wherein the access request data includes needing to survey for identifying The test mark of the function to be tested of examination;
It is identified according to the test, obtains test case corresponding with function to be tested, the test case includes preset one Group test input executes condition and expected results;
According to access request data, data to be feedback are obtained, wherein the data to be feedback include and the function pair to be tested The file to be tested answered, the file to be tested are front end javascript script file;
The test case is dynamically injected into the data to be feedback, to generate response data;
According to the test case and data to be feedback, response data is generated;
The response data is sent to the client, to obtain the test result of the client feedback, wherein the survey Test result generates after the response data as described in the client executing.
6. webpage front-end test method as claimed in claim 5, which is characterized in that the test mark includes file to be tested Mark and Function Identification to be tested, the step of test case is dynamically injected the data to be feedback include:
The corresponding file to be tested is obtained from the data to be feedback according to the file identification to be tested;
The test case is injected into the file to be tested according to business rule corresponding with the Function Identification to be tested.
7. webpage front-end test method as claimed in claim 5, which is characterized in that the method also includes:
The test result is shown.
8. a kind of webpage front-end test device, which is characterized in that described device is applied to the webpage connecting with client communication clothes Business device, described device include:
Receiving module, the access request data sent for receiving the client, wherein the access request data includes using The test mark of function to be tested to be tested is needed in mark;
Module is obtained, for identifying according to the test, obtains test case corresponding with function to be tested, the test case Including preset one group of test input, execute condition and expected results;And it is also used to be obtained according to access request data to anti- Present data, wherein the data to be feedback include file to be tested corresponding with the function to be tested, the file to be tested For front end javascript script file;
Generation module, for the test case dynamically to be injected the data to be feedback, to generate response data;
Sending module, for the response data to be sent to the client, to obtain the test knot of the client feedback Fruit, wherein the test result generates after the response data as described in the client executing.
CN201710425734.8A 2017-06-08 2017-06-08 Webpage front-end test method and device Active CN107256195B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710425734.8A CN107256195B (en) 2017-06-08 2017-06-08 Webpage front-end test method and device
PCT/CN2018/074486 WO2018223717A1 (en) 2017-06-08 2018-01-29 Webpage front-end testing method, device, system, apparatus and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710425734.8A CN107256195B (en) 2017-06-08 2017-06-08 Webpage front-end test method and device

Publications (2)

Publication Number Publication Date
CN107256195A CN107256195A (en) 2017-10-17
CN107256195B true CN107256195B (en) 2019-01-29

Family

ID=60023027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710425734.8A Active CN107256195B (en) 2017-06-08 2017-06-08 Webpage front-end test method and device

Country Status (2)

Country Link
CN (1) CN107256195B (en)
WO (1) WO2018223717A1 (en)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107256195B (en) * 2017-06-08 2019-01-29 武汉斗鱼网络科技有限公司 Webpage front-end test method and device
CN109857628A (en) * 2017-11-30 2019-06-07 北京高德云图科技有限公司 Dynamic UI business end code method for testing performance and device
CN109871312B (en) * 2017-12-05 2022-08-12 航天信息股份有限公司 Interface testing method, device, equipment and readable storage medium
CN110347577B (en) * 2018-04-04 2024-04-09 阿里巴巴集团控股有限公司 Page testing method, device and equipment thereof
CN109359050A (en) * 2018-11-15 2019-02-19 北京奇虎科技有限公司 Webpage test method, device and system
CN109656829A (en) * 2018-12-24 2019-04-19 西安四叶草信息技术有限公司 Test method and device based on docker
CN110008117A (en) * 2019-03-12 2019-07-12 深圳壹账通智能科技有限公司 Page test method, device, computer equipment and storage medium
CN110008118B (en) * 2019-03-13 2023-03-10 深圳壹账通智能科技有限公司 Page data testing method and device, computer equipment and storage medium
CN110046101B (en) * 2019-04-15 2022-08-19 腾讯音乐娱乐科技(深圳)有限公司 Page automatic testing method and device and computer storage medium
CN110321287A (en) * 2019-06-20 2019-10-11 北京奇艺世纪科技有限公司 A kind of detection method of server capability, device and electronic equipment
CN110502444B (en) * 2019-08-28 2023-08-18 北京达佳互联信息技术有限公司 Testing method and testing device for image processing algorithm
CN110765001B (en) * 2019-09-06 2023-04-07 赛诺贝斯(北京)营销技术股份有限公司 Modularized automatic test method and device for application system
CN110633219B (en) * 2019-09-24 2023-09-08 网易(杭州)网络有限公司 Page test method and device, storage medium and electronic equipment
CN111030894B (en) * 2020-01-07 2022-01-18 燕东科技(广东)有限公司 Front-end testing method of distributed communication system
CN111597110B (en) * 2020-04-27 2024-02-27 五八有限公司 Page test method and device, electronic equipment and storage medium
CN111767217B (en) * 2020-06-24 2024-02-02 中国工商银行股份有限公司 JS unit test case generation method and device
CN111984539A (en) * 2020-08-25 2020-11-24 北京微步在线科技有限公司 Automatic testing method and device for webpage front end
CN112328470A (en) * 2020-10-22 2021-02-05 中国建设银行股份有限公司 Automatic operation and maintenance testing method, device, equipment and storage medium
CN112269739A (en) * 2020-10-26 2021-01-26 广州华多网络科技有限公司 Webpage testing method and device, equipment and medium thereof
CN113434378B (en) * 2021-06-30 2023-09-05 北京百度网讯科技有限公司 Webpage stability detection method and device, electronic equipment and readable storage medium
CN113448691B (en) * 2021-08-30 2021-11-05 天津市天房科技发展股份有限公司 Interaction method and device for front-end JavaScript and local Java application
CN115567564B (en) * 2022-12-06 2023-09-08 东方空间(西安)宇航技术有限公司 Method, device, system and equipment for testing aerospace equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461903A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Method and device for testing client side based on browser
CN105260299A (en) * 2015-09-17 2016-01-20 安一恒通(北京)科技有限公司 Method, device, and system for software test

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377127B (en) * 2012-04-28 2016-04-13 阿里巴巴集团控股有限公司 The development and testing system of web page product, method of testing and device
GB2514796A (en) * 2013-06-04 2014-12-10 Ibm Web service testing
CN105159833A (en) * 2015-09-30 2015-12-16 努比亚技术有限公司 Automatic testing device and method
CN107256195B (en) * 2017-06-08 2019-01-29 武汉斗鱼网络科技有限公司 Webpage front-end test method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461903A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Method and device for testing client side based on browser
CN105260299A (en) * 2015-09-17 2016-01-20 安一恒通(北京)科技有限公司 Method, device, and system for software test

Also Published As

Publication number Publication date
CN107256195A (en) 2017-10-17
WO2018223717A1 (en) 2018-12-13

Similar Documents

Publication Publication Date Title
CN107256195B (en) Webpage front-end test method and device
CN106528432B (en) The construction method and device of test scene data bury a test method
CN102272757B (en) Method for server-side logging of client browser state through markup language
CN108574604B (en) Test method and device
CN108345543B (en) Data processing method, device, equipment and storage medium
CN107133174A (en) Test case code automatically generating device and method
CN108259598A (en) A kind of awareness apparatus unified access method based on isomery fusion and cloud analytic technique
CN103647775B (en) Method and apparatus for registration in webpage
CN106209487B (en) For detecting the method and device of the security breaches of webpage in website
CN109684188A (en) Test method and device
CN108334641A (en) The method of acquisition user behavior data, system, electronic equipment, storage medium
CN108846286A (en) Cross site scripting leak detection method and device
CN110149298A (en) A kind of method and apparatus for kidnapping detection
CN104967644A (en) Message push method, apparatus and system
CN109684571A (en) Data acquisition method and device and storage medium
CN110598135A (en) Network request processing method and device, computer readable medium and electronic equipment
CN107766509A (en) A kind of method and apparatus of webpage static backup
CN113536185B (en) Application page loading method, storage medium and related equipment
CA2786418C (en) Identifying equivalent javascript events
CN106886594A (en) For the method and apparatus of exhibition information
CN108694120A (en) The method and apparatus of testing service component
CN109818994A (en) Information processing method and device for agent side
CN107360036A (en) A kind of network failure locating method, terminal and server
CN106649299A (en) Method and device for lazy loading of webpage block
CN108255672A (en) The method, apparatus and storage medium and electronic equipment of data check

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
TR01 Transfer of patent right

Effective date of registration: 20231123

Address after: Room 606-609, Compound Office Complex Building, No. 757, Dongfeng East Road, Yuexiu District, Guangzhou, Guangdong Province, 510699

Patentee after: China Southern Power Grid Internet Service Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right