CN110727587A - Test data acquisition method and device, storage medium and computer equipment - Google Patents
Test data acquisition method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN110727587A CN110727587A CN201910894040.8A CN201910894040A CN110727587A CN 110727587 A CN110727587 A CN 110727587A CN 201910894040 A CN201910894040 A CN 201910894040A CN 110727587 A CN110727587 A CN 110727587A
- Authority
- CN
- China
- Prior art keywords
- test
- test data
- data
- interface
- mock
- 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.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 343
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000003860 storage Methods 0.000 title claims abstract description 17
- 238000004088 simulation Methods 0.000 claims abstract description 55
- 238000012216 screening Methods 0.000 claims abstract description 14
- 238000002360 preparation method Methods 0.000 claims abstract description 11
- 238000012545 processing Methods 0.000 claims description 11
- 230000000694 effects Effects 0.000 abstract description 4
- 238000005516 engineering process Methods 0.000 abstract description 2
- 230000008569 process Effects 0.000 description 8
- 230000015654 memory Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000001514 detection method Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000005034 decoration Methods 0.000 description 2
- 230000005291 magnetic effect Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present application relates to the field of test technologies, and in particular, to a method and an apparatus for acquiring test data, a storage medium, and a computer device. The method for acquiring the test data comprises the following steps: receiving a data request sent by a test interface, and responding to the data request to acquire a current environment variable; judging the preparation completion state of the real test data provided by the interface provider according to the environment variable; calling mock data and test requirement information of the test interface through the test interface under the condition that the real test data is not prepared; screening the mock data according to the test requirement information to obtain simulation test data; and returning the simulation test data to the test interface. According to the scheme, when the mock data is called by the interface demand party to carry out self-test is determined according to the environment variable, personalized simulation test data can be generated aiming at different test interfaces, and the test effect is favorably improved.
Description
Technical Field
The present application relates to the field of test technologies, and in particular, to a method and an apparatus for acquiring test data, a storage medium, and a computer device.
Background
In the project testing process, a large amount of test data is needed for performance testing, but the test data has certain timeliness, effective testing can be carried out only by selecting the test data which accords with the current actual production, and the real-time collection of a large amount of data for project testing is difficult.
In order to meet the testing requirements, mock data (false data manufactured according to interface documents) are often adopted for system self-testing in the prior art, but when the mock data are selected for testing is an important problem, the prior art adopts manual judgment to select the opportunity, the mode has the problem of low efficiency, and the mock data selected for different testing interfaces are the same, so that the testing effect is poor.
Disclosure of Invention
The application provides a test data acquisition method and device, a computer readable storage medium and computer equipment, which determine when an interface demander calls mock data for self-test according to environmental variables, can generate personalized simulation test data for different test interfaces, and are favorable for improving test effects.
The embodiment of the application firstly provides a method for acquiring test data, which comprises the following steps:
receiving a data request sent by a test interface, and responding to the data request to acquire a current environment variable;
judging the preparation completion state of the real test data provided by the interface provider according to the environment variable;
calling mock data and test requirement information of the test interface through the test interface under the condition that the real test data is not prepared;
screening the mock data according to the test requirement information to obtain simulation test data;
and returning the simulation test data to the test interface.
In an embodiment, the step of performing screening processing on the mock data according to the test requirement information to obtain simulation test data includes:
analyzing the test requirement information to obtain processing parameters of mock data;
and correspondingly screening the mock data by using the processing parameters to obtain the simulation test data of the test interface.
In an embodiment, the method for obtaining test data further includes:
and calling real test data when the real test data provided by the interface provider is ready, and returning the real test data to the test interface for testing.
In one embodiment, the step of preparing the real test data to be completed comprises:
acquiring page address bar parameters of server starting configuration;
judging whether a mock system is adopted by a server starting configuration item or not according to the page address bar parameters;
and if so, judging that the real test data provided by the interface provider is not ready to be completed.
In an embodiment, the step of determining whether the server startup configuration item adopts a mock system according to the page address bar parameter includes:
adding identification parameters to a page address bar, and acquiring page address bar parameters by using the identification parameters;
detecting whether the parameters of the page address bar comprise preset keywords for pointing to the mock system or not;
and if so, judging that the server starting configuration item adopts a mock system.
In an embodiment, after the step of determining whether the server starts a configuration item by using a mock system according to the parameters of the page address bar, the method further includes:
if the server starting configuration item does not adopt a mock system, requesting and receiving a server address agreed in advance;
and if the server address is successfully received, returning the real test data to the test interface, otherwise, setting the test interface to point to the mock system, and returning the corresponding simulation test data of the test interface in the mock system to the test interface.
In one embodiment, after the step of obtaining the simulation test data, the method further includes:
and sending the simulation test data to a remote server, and utilizing the remote server to remotely store the simulation test data.
Correspondingly, the embodiment of the present application further provides an apparatus for acquiring test data, including:
the acquisition environment variable module is used for receiving a data request sent by the test interface and responding to the data request to acquire a current environment variable;
the real test data determining module is used for judging the preparation completion state of the real test data provided by the interface provider according to the environment variable;
the mock data calling module is used for calling mock data and test requirement information of the test interface through the test interface under the condition that the real test data is not prepared;
the analog test data obtaining module is used for screening the mock data according to the test requirement information to obtain analog test data;
and the return module is used for returning the simulation test data to the test interface.
Further, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used to store computer instructions, and when the computer instructions are run on a computer, the computer is enabled to execute the steps of the method for acquiring test data according to any one of the above technical solutions.
Still further, an embodiment of the present application further provides a computer device, where the computer device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the method for acquiring test data according to any one of the above technical solutions.
Compared with the prior art, the scheme provided by the application at least has the following advantages:
according to the method for acquiring the test data, whether the real test data is prepared or not is judged according to the environment variable, whether the test data uses the simulation test data or the real test data provided by the interface side is used as the test data to carry out the interface test is determined according to the preparation completion state of the real test data, the purpose of switching the test data according to the detection result of the environment variable is achieved, manual switching is not needed, and timely acquisition of the test data and smooth proceeding of the test are guaranteed.
According to the test data acquisition scheme, when real test data are not prepared, the called mock data are screened, corresponding simulation test data are generated according to the test requirements of the test interface, so that the test data used in the test process are more targeted, the screened simulation test data are used for testing, and the test accuracy and the test efficiency are improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is an environment diagram of an implementation of a method for obtaining test data according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for acquiring test data according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps performed by an embodiment of the present application when actual test data is not ready for completion;
fig. 4 is a schematic flowchart illustrating a process of determining whether a mock system is used for a server startup configuration item according to the parameters of the page address bar according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a method for acquiring test data according to an embodiment of the present application, which mainly shows a process of determining whether a mock system is adopted for a server startup configuration item according to a page address bar parameter;
fig. 6 is a schematic flow chart illustrating a process of screening the mock data according to the test requirement information to obtain simulated test data according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus for acquiring test data according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Fig. 1 is a diagram of an implementation environment of a method for acquiring test data according to an embodiment, where the implementation environment includes an interface provider, a test interface, and a server.
Receiving a data request sent by a test interface, wherein the data request aims at requesting a server end to send test data for testing the test interface, the server end responds to the data request, acquires a current environment variable, judges whether real test data provided by an interface provider is ready to be finished or not according to the environment variable, if not, the server end needs to utilize mock data for testing, screens the mock data, obtains simulated test data aiming at the test interface, and returns the simulated test data to the test interface.
It should be noted that the server side may be implemented by a computer device with a processing function, but is not limited to this. The server, the interface provider and the test interface may be connected to each other through bluetooth, USB (Universal Serial Bus), or other communication connection methods, which is not limited herein.
In an embodiment, fig. 2 is a schematic flow chart of a method for acquiring test data according to an embodiment of the present application, where the method for acquiring test data may be applied to the server side, and includes the following steps:
step S210, receiving a data request sent by a test interface, and responding to the data request to acquire a current environment variable;
step S220, judging the preparation completion state of the real test data provided by the interface provider according to the environment variable;
step S230, calling mock data and test requirement information of the test interface through the test interface under the state that the real test data is not prepared;
step S240, screening the mock data according to the test requirement information to obtain simulation test data;
and step S250, returning the simulation test data to the test interface.
The method comprises the steps of determining whether a development environment or a production and test environment is in the current state according to environment variables, wherein in the development environment, a test interface is connected with a mock system corresponding interface, the mock system corresponding interface lists meanings corresponding to each field of the test interface, the mock system corresponding interface has functions similar to interface documents, and the mock data can be edited to generate required test data.
The method comprises the steps that a test interface sends a data request to a server side before testing, the request returns test data for interface testing, the server side receives and responds to the data request, current environment variables are obtained, and the preparation completion state of the real test data is determined through the current environment variables, wherein the real test data can be the test data collected by the test interface, and if the real test data are not prepared, mock data are called to carry out interface testing.
According to the test data acquisition method, the called mock data are screened, and corresponding simulation test data are generated according to the test requirements of the test interface, so that the test data used in the test process are more targeted, and the screened simulation test data are used for testing, thereby being beneficial to improving the test accuracy and the test efficiency.
In order to make the scheme for acquiring test data and the technical effects thereof more clear, the following embodiments are provided to describe specific schemes in detail.
In one embodiment, the step of step S230, in which the real test data is not prepared, may be performed as follows, and the flowchart is shown in fig. 3, and includes the following steps:
s2301, acquiring page address bar parameters of server startup configuration;
s2302, judging whether the server startup configuration item adopts a mock system or not according to the page address bar parameters;
and S2303, if yes, determining that the real test data provided by the interface provider is not ready to be completed.
The page address bar parameters can be obtained by using the identification parameters, the page address bar parameters are detected, whether a mock system is adopted by the server startup configuration item or not is judged according to the detection result, and if the mock system is adopted, it is indicated that the real test data is not ready to be completed.
The embodiment provides a scheme for judging that real test data is in an unprepared state, the scheme determines the preparation state of the real test data directly by detecting whether a server configuration item adopts a detection result of a mock system, and the server configuration item can be intuitively and accurately obtained, so that the preparation state of the real test data can be accurately judged.
In this embodiment, the step S2302 of determining whether the server starts a configuration item by using a mock system according to the page address bar parameter may be performed in the following manner, where a flowchart is shown in fig. 4, and includes the following sub-steps:
s410, adding identification parameters to a page address bar, and acquiring page address bar parameters by using the identification parameters;
s420, detecting whether the address bar parameters comprise preset keywords for pointing to the mock system;
and S430, if yes, judging that the server starting configuration item adopts a mock system.
Calling identification parameters, adding the identification parameters to a page address bar, obtaining page address bar parameters, detecting whether preset keywords exist in the address bar parameters, wherein the preset keywords point to the mock system, if the address bar parameters contain the preset keywords, the address bar indicates that the address bar points to the mock system, the current server starting configuration item is indicated to adopt the mock system, and if the address bar parameters do not have parameters matched with the preset keywords, the server starting configuration item is indicated not to adopt the mock system.
The preset keywords can be preset according to the test type, if the preset keywords can be set to level, when the page address bar parameters contain the preset keywords, the address of the test data is set to be the interface address corresponding to the mock system, and it is indicated that the server startup configuration item adopts the mock system.
Html? And ssEnv ═ depth ", assuming that the preset keyword set currently is depth, and detecting that the address bar parameter of the current page contains the depth, the fact indicates that the server startup configuration item adopts the mock system.
Examples are as follows: the corresponding path of the test interface a in the server system is: https:// cfs-phone-web. pingan. com. cn/a. do, the corresponding path in the mock system is 'http:// 10.20.22.125:9080/mock/a. do', then the switching logic is:
ssEnv==‘development’?‘http://10.20.22.125:9080/mock/A.do’:‘https://cfs-phone-web.pingan.com.cn/A.do’
namely, when the preset keyword level exists in the page address bar parameter, the path of the test interface A is 'http:// 10.20.22.125: 9080/mock/A.do', namely, the mock system is docked, and the test is carried out by adopting the simulation test data.
The method provided by the embodiment obtains the parameters of the page address bar, and judges whether the server startup configuration item adopts the mock system according to whether the preset keyword exists in the parameters of the page address bar, so that the judgment process is simple, and the judgment result is accurate.
Except that the scheme provided by the embodiment can judge that the mock system is adopted by the server starting configuration item, the judgment can also be carried out in a mode that when the test service is started, in a command for starting the test service, the parameters are configured, namely, preset keywords pointing to the mock system are set in the server starting configuration item. If the command for starting the test service is set as: cross-env-shell ssEnv ═ depth.
In the solutions provided in the above embodiments, mainly, the corresponding test data obtaining solution is provided in the case that the server startup configuration item adopts the mock system, and the next embodiment is a test data obtaining solution in the case that the server startup configuration item does not adopt the mock system, and a flow diagram of the solution is shown in fig. 5, and includes the following steps:
s510, if the server starting configuration item does not adopt a mock system, requesting and receiving a server address agreed in advance;
s520, if the server address is successfully received, returning the real test data to a test interface;
s530, if not, setting the test interface to point to the mock system, and returning the corresponding simulation test data of the test interface in the mock system to the test interface.
And under the condition that the server starting configuration item does not adopt the mock system, requesting a preapproved server address, if the received return information contains information representing request failure, such as 404, 500 and the like, setting a test interface to point to the mock system, and returning the simulation test data corresponding to the test interface.
Presetting a test interface and corresponding access and exit of the test interface, storing the access and exit, and if a back-end system provides an advertisement interface named Ad.do, the complete address is https:// cfs-phone-web.
And (3) the relevant information of the input and output parameters corresponding to the test interface is stored in the Mock system and converted into a visual page, and as shown in a table I, one item of Mock value data can be edited and stored.
Table-test interface parameter-entering and parameter-exiting table
When mock data is used, the address 'http:// 10.20.22.125: 9080/mock/Ad.do' is pointed to.
The procedure for requesting test data generation is as follows:
and editing the mock value data to generate corresponding changes, and correspondingly changing the returned simulation test data.
Referring to fig. 5, a process of determining whether the server startup configuration item adopts the mock system according to the page address bar parameter is shown, which specifically includes the following steps: firstly, a server is started, a test interface A sends a data request of test data, whether a mock system is adopted by a server start configuration item is judged according to the page address bar parameters in response to the data request, and if yes, simulation test data corresponding to the mock system in the mock system by the test interface A is returned.
The Mock system is used for generating Mock data, the simulation test data is essentially Mock data, but the simulation test data is part of Mock data screened by aiming at the test interfaces, and the simulation test data corresponding to each test interface can be different.
After the test interface receives the mock data, the determination can be made by detecting whether there is an agreed data field in the mock data return value, and the agreed data sub-segment can be as follows: mock: true, if the mock data return value contains the field, it indicates that the test interface receives the mock data.
In the scheme provided by the embodiment, the test requirement information and mock data of the test interface are obtained, and the scheme provided by the following embodiment is used for obtaining the simulation test data of the test interface.
In an embodiment, the step of screening the mock data according to the test requirement information in step S240 to obtain the simulated test data may be performed in the following manner, and a flowchart of the step is shown in fig. 6, and includes the following steps:
s2401, analyzing the test requirement information to obtain a processing parameter of mock data;
s2402, correspondingly screening mock data by using the processing parameters to obtain simulation test data of the test interface.
And calling test requirement information of the test interface, analyzing the test requirement information to obtain processing parameters of the mock data, representing the operations of increasing, deleting, checking, modifying and the like on the mock data, editing the mock data according to the processing parameters, and obtaining screened simulation test data.
According to the scheme provided by the embodiment, the corresponding simulation test data is obtained according to the test requirement information of the test interface, the simulation test data are ensured to be the test data aiming at the test interface, the test of the test interface is carried out by utilizing the simulation test data provided by the scheme, and the test accuracy and the test efficiency are favorably improved.
The above embodiment elaborates the scheme for acquiring test data when the real test data is not prepared, and the following embodiment provides the scheme for acquiring test data corresponding to the state that the real test data is prepared, and after step S230, the method further includes: and calling real test data when the real test data provided by the interface provider is ready, and returning the real test data to the test interface for testing.
According to the scheme provided by the embodiment, whether real test data provided by an interface provider is in a state of being prepared or not is judged by using an environment variable, if so, the real test data provided by the interface provider is prepared, the real test data is obtained, and the test interface is tested by using the real test data; if the real test data provided by the interface provider is not ready, the simulation test data is obtained by using the scheme provided in the steps S230 to S250, and the test interface is tested by using the simulation test data.
According to the scheme provided by the embodiment, whether real test data are prepared or not is determined according to the environment variable, if not, the test is carried out by using the simulation test data, and if the test is completed, the test is carried out by using the real test data, so that the current test interface can obtain the test data, and the test can be smoothly carried out.
In order to further improve the testing efficiency, the application also provides the following embodiments: after the step of obtaining the simulation test data in step S240, the storage capacity of the test data in the project file may be reduced by performing remote storage as follows: and sending the simulation test data to a remote server, and utilizing the remote server to remotely store the simulation test data.
The simulation test data can be placed in a json file and stored in a remote server, so that the problem that in the prior art, mock data is placed in a project folder, and the data storage capacity of the project file is increased is solved.
According to the scheme provided by the embodiment, the simulation test data for the test interface is stored in advance, and the remote server is used for remotely storing the simulation test data, so that the test interface can be called and the occupation of the test data in the project file on the storage space can be reduced.
The above is an embodiment of the method for acquiring test data provided by the present application, and for the method, an embodiment of an apparatus for acquiring test data corresponding to the method is described below.
An embodiment of the present application further provides an apparatus for acquiring test data, a schematic structural diagram of which is shown in fig. 7, including: the environment variable obtaining module 710, the real test data determining module 720, the mock data calling module 730, the simulation test data obtaining module 740, and the returning module 750 are as follows:
an environment variable obtaining module 710, configured to receive a data request sent by a test interface, and obtain a current environment variable in response to the data request;
a true test data determining module 720, configured to determine, according to the environment variable, a preparation completion state of true test data provided by an interface provider;
a mock data calling module 730, configured to, in a state where the real test data is not ready, call mock data and test requirement information of the test interface through the test interface;
the module 740 for obtaining simulation test data is used for screening the mock data according to the test requirement information to obtain simulation test data;
the return module 750 is configured to return the simulation test data to the test interface.
With regard to the apparatus for acquiring test data in the above embodiments, the specific manner in which each module performs operations has been described in detail in the corresponding method embodiment, and will not be elaborated here.
Further, an embodiment of the present application also provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions, when executed by a processor, implement the steps of the method for acquiring test data described in any one of the above. The storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer). Which may be a read-only memory, magnetic or optical disk, or the like.
Still further, an embodiment of the present application further provides a computer device, where the computer device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the steps of the method for obtaining test data described in any one of the above.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.
Claims (10)
1. A method for acquiring test data is characterized by comprising the following steps:
receiving a data request sent by a test interface, and responding to the data request to acquire a current environment variable;
judging the preparation completion state of the real test data provided by the interface provider according to the environment variable;
calling mock data and test requirement information of the test interface through the test interface under the condition that the real test data is not prepared;
screening the mock data according to the test requirement information to obtain simulation test data;
and returning the simulation test data to the test interface.
2. The method for acquiring test data according to claim 1, wherein the step of performing screening processing on the mock data according to the test requirement information to obtain simulated test data includes:
analyzing the test requirement information to obtain processing parameters of mock data;
and correspondingly screening the mock data by using the processing parameters to obtain the simulation test data of the test interface.
3. The method for acquiring test data according to claim 1, further comprising:
and calling real test data when the real test data provided by the interface provider is ready, and returning the real test data to the test interface for testing.
4. The method for acquiring test data according to claim 1, wherein the step of preparing the real test data includes:
acquiring page address bar parameters of server starting configuration;
judging whether a mock system is adopted by a server starting configuration item or not according to the page address bar parameters;
and if so, judging that the real test data provided by the interface provider is not ready to be completed.
5. The method for acquiring test data according to claim 4, wherein the step of judging whether the server startup configuration item adopts a mock system according to the page address bar parameter comprises:
adding identification parameters to a page address bar, and acquiring page address bar parameters by using the identification parameters;
detecting whether the parameters of the page address bar comprise preset keywords for pointing to the mock system or not;
and if so, judging that the server starting configuration item adopts a mock system.
6. The method for acquiring test data according to claim 4, wherein after the step of judging whether the server startup configuration item adopts a mock system according to the page address bar parameter, the method further comprises:
if the server starting configuration item does not adopt a mock system, requesting and receiving a server address agreed in advance;
and if the server address is successfully received, returning the real test data to the test interface, otherwise, setting the test interface to point to the mock system, and returning the corresponding simulation test data of the test interface in the mock system to the test interface.
7. The method for obtaining test data according to claim 1, wherein the step of obtaining the simulation test data is followed by further comprising:
and sending the simulation test data to a remote server, and utilizing the remote server to remotely store the simulation test data.
8. An apparatus for acquiring test data, comprising:
the acquisition environment variable module is used for receiving a data request sent by the test interface and responding to the data request to acquire a current environment variable;
the real test data determining module is used for judging the preparation completion state of the real test data provided by the interface provider according to the environment variable;
the mock data calling module is used for calling mock data and test requirement information of the test interface through the test interface under the condition that the real test data is not prepared;
the analog test data obtaining module is used for screening the mock data according to the test requirement information to obtain analog test data;
and the return module is used for returning the simulation test data to the test interface.
9. A computer-readable storage medium for storing computer instructions which, when executed on a computer, cause the computer to perform the steps of the method for obtaining test data of any one of claims 1 to 7.
10. A computer device, characterized in that the computer device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the steps of the method of test data acquisition of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910894040.8A CN110727587A (en) | 2019-09-20 | 2019-09-20 | Test data acquisition method and device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910894040.8A CN110727587A (en) | 2019-09-20 | 2019-09-20 | Test data acquisition method and device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110727587A true CN110727587A (en) | 2020-01-24 |
Family
ID=69219324
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910894040.8A Pending CN110727587A (en) | 2019-09-20 | 2019-09-20 | Test data acquisition method and device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110727587A (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111782524A (en) * | 2020-06-29 | 2020-10-16 | 京东数字科技控股有限公司 | Application testing method and device, storage medium and electronic device |
CN111881035A (en) * | 2020-07-23 | 2020-11-03 | 上海中通吉网络技术有限公司 | Online simulation data acquisition method, device and equipment |
CN111953659A (en) * | 2020-07-21 | 2020-11-17 | 北京思特奇信息技术股份有限公司 | Method and system for simulating http request |
CN112083925A (en) * | 2020-09-07 | 2020-12-15 | 中国平安财产保险股份有限公司 | Data acquisition method, device, equipment and storage medium based on H5 page development |
CN112131118A (en) * | 2020-09-25 | 2020-12-25 | 平安国际智慧城市科技股份有限公司 | Mock test method, device, electronic device and computer-readable storage medium |
CN112199281A (en) * | 2020-09-30 | 2021-01-08 | 中国平安财产保险股份有限公司 | Data processing method and device, terminal equipment and readable storage medium |
CN112561690A (en) * | 2020-12-23 | 2021-03-26 | 平安银行股份有限公司 | Method, system, equipment and storage medium for testing credit card staging service interface |
CN112631910A (en) * | 2020-12-22 | 2021-04-09 | 平安普惠企业管理有限公司 | Front-end testing method and device, computer equipment and storage medium |
CN112783776A (en) * | 2021-01-27 | 2021-05-11 | 上海淇玥信息技术有限公司 | Interface routing-based test method and device and electronic equipment |
CN113010411A (en) * | 2020-12-15 | 2021-06-22 | 云智慧(北京)科技有限公司 | Method and system for returning data based on mock service and simulation test method |
CN113282515A (en) * | 2021-06-28 | 2021-08-20 | 中国平安人寿保险股份有限公司 | System testing method, device, computer equipment and storage medium |
CN113282506A (en) * | 2021-06-11 | 2021-08-20 | 中国农业银行股份有限公司 | Test data acquisition method, device, equipment and computer readable storage medium |
CN113472883A (en) * | 2021-06-30 | 2021-10-01 | 平安国际智慧城市科技股份有限公司 | Method, device and equipment for storing data based on block chain and storage medium |
CN113778883A (en) * | 2021-09-13 | 2021-12-10 | 湖南快乐阳光互动娱乐传媒有限公司 | Interface documentation, test and simulation generation method and apparatus, computer storage medium |
CN114238099A (en) * | 2021-12-09 | 2022-03-25 | 北京五八信息技术有限公司 | Method and device for gray scale test, electronic equipment and readable medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528400A (en) * | 2016-09-22 | 2017-03-22 | 深圳峰创智诚科技有限公司 | MOCK testing method and device |
CN109446075A (en) * | 2018-09-30 | 2019-03-08 | 北京金山安全软件有限公司 | Interface testing method and device |
CN109656807A (en) * | 2018-11-01 | 2019-04-19 | 平安科技(深圳)有限公司 | Interface mock test method, device, equipment and storage medium based on information security |
-
2019
- 2019-09-20 CN CN201910894040.8A patent/CN110727587A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528400A (en) * | 2016-09-22 | 2017-03-22 | 深圳峰创智诚科技有限公司 | MOCK testing method and device |
CN109446075A (en) * | 2018-09-30 | 2019-03-08 | 北京金山安全软件有限公司 | Interface testing method and device |
CN109656807A (en) * | 2018-11-01 | 2019-04-19 | 平安科技(深圳)有限公司 | Interface mock test method, device, equipment and storage medium based on information security |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111782524A (en) * | 2020-06-29 | 2020-10-16 | 京东数字科技控股有限公司 | Application testing method and device, storage medium and electronic device |
CN111953659B (en) * | 2020-07-21 | 2023-02-07 | 北京思特奇信息技术股份有限公司 | Method and system for simulating http request |
CN111953659A (en) * | 2020-07-21 | 2020-11-17 | 北京思特奇信息技术股份有限公司 | Method and system for simulating http request |
CN111881035A (en) * | 2020-07-23 | 2020-11-03 | 上海中通吉网络技术有限公司 | Online simulation data acquisition method, device and equipment |
CN112083925A (en) * | 2020-09-07 | 2020-12-15 | 中国平安财产保险股份有限公司 | Data acquisition method, device, equipment and storage medium based on H5 page development |
CN112131118A (en) * | 2020-09-25 | 2020-12-25 | 平安国际智慧城市科技股份有限公司 | Mock test method, device, electronic device and computer-readable storage medium |
CN112131118B (en) * | 2020-09-25 | 2024-10-29 | 平安国际智慧城市科技股份有限公司 | Mock testing method and device, electronic equipment and computer readable storage medium |
CN112199281A (en) * | 2020-09-30 | 2021-01-08 | 中国平安财产保险股份有限公司 | Data processing method and device, terminal equipment and readable storage medium |
CN113010411A (en) * | 2020-12-15 | 2021-06-22 | 云智慧(北京)科技有限公司 | Method and system for returning data based on mock service and simulation test method |
CN112631910A (en) * | 2020-12-22 | 2021-04-09 | 平安普惠企业管理有限公司 | Front-end testing method and device, computer equipment and storage medium |
CN112561690B (en) * | 2020-12-23 | 2024-05-28 | 平安银行股份有限公司 | Method, system, equipment and storage medium for testing credit card staged service interface |
CN112561690A (en) * | 2020-12-23 | 2021-03-26 | 平安银行股份有限公司 | Method, system, equipment and storage medium for testing credit card staging service interface |
CN112783776A (en) * | 2021-01-27 | 2021-05-11 | 上海淇玥信息技术有限公司 | Interface routing-based test method and device and electronic equipment |
CN113282506A (en) * | 2021-06-11 | 2021-08-20 | 中国农业银行股份有限公司 | Test data acquisition method, device, equipment and computer readable storage medium |
CN113282515A (en) * | 2021-06-28 | 2021-08-20 | 中国平安人寿保险股份有限公司 | System testing method, device, computer equipment and storage medium |
CN113472883A (en) * | 2021-06-30 | 2021-10-01 | 平安国际智慧城市科技股份有限公司 | Method, device and equipment for storing data based on block chain and storage medium |
CN113472883B (en) * | 2021-06-30 | 2024-10-25 | 平安国际智慧城市科技股份有限公司 | Method, device, equipment and storage medium for storing data based on block chain |
CN113778883A (en) * | 2021-09-13 | 2021-12-10 | 湖南快乐阳光互动娱乐传媒有限公司 | Interface documentation, test and simulation generation method and apparatus, computer storage medium |
CN113778883B (en) * | 2021-09-13 | 2024-11-22 | 湖南快乐阳光互动娱乐传媒有限公司 | Interface document, test and simulation generation method and device, and computer storage medium |
CN114238099A (en) * | 2021-12-09 | 2022-03-25 | 北京五八信息技术有限公司 | Method and device for gray scale test, electronic equipment and readable medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110727587A (en) | Test data acquisition method and device, storage medium and computer equipment | |
CN107562610A (en) | Obtain method, apparatus, terminal and the medium of page load time | |
CN107659455B (en) | Method, storage medium, device and system for Mock data of iOS (internet operating system) end | |
CN112328489B (en) | Test case generation method and device, terminal equipment and storage medium | |
CN109062613B (en) | Multi-core interconnection secondary cache access verification method | |
CN111259772A (en) | Image annotation method, device, equipment and medium | |
CN112231874A (en) | Method and device for establishing underground pipeline model, computer equipment and storage medium | |
CN106375140A (en) | Pressure testing method and device | |
CN103914212B (en) | A kind of terminal device and its application configuration method | |
CN105354138A (en) | Method for determining specific control attribute of mobile phone page | |
CN103902449A (en) | Method and device for generating search engine relevance ranking test case | |
CN112153375A (en) | Front-end performance testing method, device, equipment and medium based on video information | |
CN111796578A (en) | Vehicle controller testing method, device and system and storage medium | |
CN112965912B (en) | Interface test case generation method and device and electronic equipment | |
CN111857752A (en) | PostgreSQL database installation method, device and equipment | |
CN109523377B (en) | Transaction method, device, equipment and storage medium of digital currency | |
CN116405421B (en) | Communication test method, system and storage medium of simulation chip test sorting machine | |
CN111949537A (en) | Interface test method, device, equipment and medium | |
CN116701367A (en) | Data repeatability verification method, device and equipment based on bloom filter | |
CN113515436A (en) | Interface testing method and device | |
CN115061864B (en) | ARM architecture platform memory test method, system, equipment and storage medium | |
CN116643758A (en) | Data calibration method and device, electronic equipment and storage medium | |
KR20200082856A (en) | An apparatus for evaluating the risk of Hydrogen Energy Stations, a method therefor, and a computer recordable medium storing a program to perform the method | |
CN106405430B (en) | Lithium ion battery on-line detection conversion control equipment, system and method | |
CN115328813B (en) | Test case design method, device, equipment and storage medium |
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 |