CN113836460A - mock data control method, equipment terminal and computer readable storage medium - Google Patents

mock data control method, equipment terminal and computer readable storage medium Download PDF

Info

Publication number
CN113836460A
CN113836460A CN202110934981.7A CN202110934981A CN113836460A CN 113836460 A CN113836460 A CN 113836460A CN 202110934981 A CN202110934981 A CN 202110934981A CN 113836460 A CN113836460 A CN 113836460A
Authority
CN
China
Prior art keywords
data
interface
mock
browser
operation panel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110934981.7A
Other languages
Chinese (zh)
Other versions
CN113836460B (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.)
Shenzhen Mingyuanyun Space E Commerce Co ltd
Original Assignee
Shenzhen Mingyuanyun Space E Commerce 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 Shenzhen Mingyuanyun Space E Commerce Co ltd filed Critical Shenzhen Mingyuanyun Space E Commerce Co ltd
Priority to CN202110934981.7A priority Critical patent/CN113836460B/en
Publication of CN113836460A publication Critical patent/CN113836460A/en
Application granted granted Critical
Publication of CN113836460B publication Critical patent/CN113836460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/261Functional testing by simulating additional hardware, e.g. fault simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Abstract

The invention discloses a mock data control method, a device terminal and a computer readable storage medium, wherein the mock data control method comprises the following steps: when Mock data test is needed in front-end development, the name of a data interface of a current website page of a browser is obtained through a Mock data browser plug-in, or data received by the data interface is displayed on an operation panel of an extension program, the data received by the data interface is modified or re-simulated based on the operation of a user, the cost of the Mock data is greatly reduced, the friendliness of the data test process to front-end developers is improved, and therefore the efficiency of the developers is improved. The technical problems that the cost of analog data testing by building a mock testing server is high, the use experience is not friendly, and the flexibility is poor, so that the efficiency is low when front-end developers test data are solved.

Description

mock data control method, equipment terminal and computer readable storage medium
Technical Field
The invention relates to the field of TI industry front-end development and testing, in particular to a mock data control method, a device terminal and a computer readable storage medium.
Background
At present, the research and development of a project in the computer industry are usually carried out simultaneously by the front end and the back end, but the front end development work may depend on interface data provided by the back end, so that an embarrassing problem can be encountered in the actual working process, and the back end working process falls behind and cannot provide interface data for the front end, thereby influencing the working process of the front end. To solve the problem, the existing scheme is to build a mock test (simulation test, a test method for testing some objects which are not easy to construct or easily obtained by using a virtual object) server, and the front end performs test development by using simulated dummy data. But the problem of low efficiency of front-end developers during data testing is caused by high cost of building the mock test server, unfriendly use experience and poor flexibility.
Disclosure of Invention
The invention mainly aims to provide a mock data control method, and aims to solve the problems of high cost, unfriendly use experience and poor flexibility of building a mock test server during testing of a front-end network station, which result in low efficiency of data testing of front-end developers.
In order to achieve the above object, the present invention provides a mock data control method, including the following steps:
popping up an expansion program operation panel when receiving a starting instruction sent by a browser;
intercepting interface data sent or received by a data interface of a current page of a browser;
displaying the intercepted interface data on the operation panel of the extension program;
and if the user operation of editing the interface data on the operation panel of the extension program is checked, returning the edited interface data to the current page of the browser.
Further, the intercepting interface data received by the browser current page data interface includes:
the method comprises the steps of obtaining interface data sent or received by all data interfaces of a current page through a request sent to a server through a data interface by a hijack browser, wherein the interface data comprises: the URL address of the interface and the data content received by the interface.
Further, the displaying the intercepted interface data on the operation panel of the extension program comprises:
if the data interface receives the data content, the data content and the URL of the interface are used as interface data to be displayed on an extended program operation panel;
and if the interface does not receive the data content, displaying the URL of the interface as interface data on an operation panel of the extension program.
Further, the extended program operation panel includes: one or more items of a mock data master switch, an API interface search column, a single interface mock data switch, a mock expression input column, a data content display column, a JSON Editor switch and a data content formatting display column.
Further, after the step of intercepting the data of the data interface of the current page of the browser, the method includes:
if the mock data master switch on the expansion program operation panel is opened based on user operation, opening the interface data editing permission of all data interfaces of the expansion program operation panel;
and if the mock data main switch and the mock data switch of any data interface on the expansion panel are simultaneously opened based on the user operation, opening the interface data editing authority of the data interface for opening the mock data switch based on the user operation on the expansion program operation panel.
Further, if the user operation of editing the interface data on the operation panel of the extension program is checked, returning the edited interface data to the current page of the browser:
if the mock data expression is input in the mock expression input field on the operation panel based on the user operation, generating a data set conforming to the data expression in the data content display field, and returning the data set conforming to the data expression to the current page of the browser;
and if the data in the data content display column on the operation panel is modified based on the user operation, returning the modified data to the current page of the browser.
Further, the browser is provided with a Mock data browser plug-in and displays the plug-in icon button in a browser toolbar.
Further, when receiving an enabling instruction sent by the browser, the method includes:
and when the Mock data browser plug-in icon button is triggered based on user operation, the Mock data browser plug-in enabling instruction is considered to be received.
In addition, in order to achieve the above object, the present invention further provides an apparatus terminal, where the apparatus terminal includes a memory, a processor, and a mock data control program stored in the memory and executable on the processor, and the processor implements the steps of the mock data control method when executing the mock data control program.
In addition, to achieve the above object, the present invention provides a readable storage medium having a mock data control program stored thereon, wherein the mock data control program is executed by a processor, and the method of the mock data control program is characterized in that the step of the method is executed.
According to the Mock data control method provided by the embodiment of the invention, when a Mock data test is carried out on a front-end website, a Mock data browser plug-in is used for obtaining the name of a data interface of a current website page of a browser or data received by the data interface, the name of the data interface and the data received by the data interface are displayed on an operation panel of an extension program, the data received by the data interface is modified or re-simulated based on the operation of a user, and the data are returned to the current website page of the browser for display. The mock data cost is greatly reduced, and the efficiency of developers is improved.
Drawings
Fig. 1 is a schematic structural diagram of a terminal device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a mock data control method according to a first embodiment of the present invention;
FIG. 3 is a schematic detailed flow chart of an alternative embodiment of the mock data control method in combination with step S20 and step S30;
fig. 4 is a detailed flowchart of step S40 in fig. 2 of the mock data control method according to the present invention;
fig. 5 is an interface diagram of an operation panel of an extended program in the mock data control method according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: when Mock data testing is carried out on a front-end website, a Mock data browser plug-in is used for obtaining the name of a data interface of a current website page of a browser or data received by the data interface, the name of the data interface and the data received by the data interface are displayed on an operation panel of an expansion program, the data received by the data interface are modified or re-simulated based on the operation of a user, and the data are returned to the current website page of the browser for displaying.
Because the prior art builds a mock test server, the front end carries out test development by using simulated false data. However, the problems of high cost, unfriendly use experience, poor flexibility and the like of building the mock test server result in low working efficiency of front-end developers during data testing.
The invention provides a solution, which enables a front-end developer to directly obtain interactive contents between a front-end website and a back-end server and to modify or simulate the interactive contents.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be a terminal device with an access interconnection function, such as a smart phone, a tablet computer, an electronic book reader, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a mock data control program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the mock data control program stored in the memory 1005 and perform the following operations:
popping up an expansion program operation panel when receiving a starting instruction sent by a browser;
intercepting interface data sent or received by a data interface of a current page of a browser;
displaying the intercepted interface data on the operation panel of the extension program;
and if the user operation of editing the interface data on the operation panel of the extension program is checked, returning the edited interface data to the current page of the browser.
Further, the processor 1001 may call the mock data control program stored in the memory 1005, and also perform the following operations:
the interface data received by the interface for intercepting the current page data of the browser comprises the following steps:
the method comprises the steps of obtaining interface data sent or received by all data interfaces of a current page through a request sent to a server through a data interface by a hijack browser, wherein the interface data comprises: the URL address of the interface and the data content received by the interface.
Further, the processor 1001 may call the mock data control program stored in the memory 1005, and also perform the following operations:
the displaying the intercepted interface data on the operation panel of the extension program comprises:
if the data interface receives the data content, the data content and the URL of the interface are used as interface data to be displayed on an extended program operation panel;
and if the interface does not receive the data content, displaying the URL of the interface as interface data on an operation panel of the extension program.
Further, the extended program operation panel includes: one or more items of a mock data master switch, an API interface search column, a single interface mock data switch, a mock expression input column, a data content display column, a JSON Editor switch and a data content formatting display column.
Further, the processor 1001 may call the mock data control program stored in the memory 1005, and also perform the following operations:
after the step of intercepting the data of the data interface of the current page of the browser, the method comprises the following steps:
if the mock data master switch on the expansion program operation panel is opened based on user operation, opening the interface data editing permission of all data interfaces of the expansion program operation panel;
and if the mock data main switch and the mock data switch of any data interface on the expansion panel are simultaneously opened based on the user operation, opening the interface data editing authority of the data interface for opening the mock data switch based on the user operation on the expansion program operation panel.
Further, the processor 1001 may call the mock data control program stored in the memory 1005, and also perform the following operations:
and if the user operation of editing the interface data on the operation panel of the extension program is checked, returning the edited interface data to the current page of the browser:
if the mock data expression is input in the mock expression input field on the operation panel based on the user operation, generating a data set conforming to the data expression in the data content display field, and returning the data set conforming to the data expression to the current page of the browser;
and if the data in the data content display column on the operation panel is modified based on the user operation, returning the modified data to the current page of the browser.
Further, the browser is provided with a Mock data browser plug-in and displays the plug-in icon button in a browser toolbar.
Further, the processor 1001 may call the mock data control program stored in the memory 1005, and also perform the following operations:
the method comprises the following steps when an enabling instruction sent by a browser is received:
and when the Mock data browser plug-in icon button is triggered based on user operation, the Mock data browser plug-in enabling instruction is considered to be received.
Referring to fig. 2, a first embodiment of the present invention provides a mock data control method, where the mock data control method includes:
step S10, when receiving the starting instruction sent by the browser, popping up an expansion program operation panel;
it can be understood that the implementation subject of the invention is a Mock data browser plug-in, which is installed with the Mock data browser plug-in and displays the plug-in icon buttons in the browser toolbar for Mock data and tools for controlling Mock during front-end development. And the browser is provided with a Mock data browser plug-in and displays the plug-in icon button in a browser toolbar, and the plug-in icon appears in the browser function or the function bar after the plug-in is installed. When the Mock data browser plug-in icon button is triggered based on user operation, the Mock data browser plug-in starting instruction is considered to be received, and meanwhile, the Mock data browser plug-in pops up an expansion program operation panel. The extended program operation panel includes: the detailed layout of the panel contents can refer to an extended program operation panel Interface in fig. 5, and the sequence of the sequence numbers in fig. 5 is consistent with the sequence described above.
When a front-end developer needs to perform data testing on a newly developed website or when a later website runs and debugs, the plug-in can be directly opened to perform mock or debugging.
Step S20, intercepting interface data sent or received by the current page data interface of the browser;
it is understood that the data of the data interface includes a URL (Uniform resource Locator) address of the interface and data content received by the interface. The URL is used for being connected with a back-end server, when a current page of the browser triggers a request under the operation of a user, the request is sent to the back-end server through the URL address of the request interface, and meanwhile, the Mock data browser plug-in intercepts and acquires the URL address of the request interface. When the back-end server receives the request sent by the front-end website, the data is returned to the front-end website according to the content of the request, and at the moment, the Mock data browser plug-in will intercept and acquire the data sent by the back-end server.
Step S30, displaying the intercepted interface data on the operation panel of the extension program;
it can be understood that when the user opens the Mock data browser plug-in, the plug-in will intercept the data of the data interface of the current page of the browser by default and visualize the URL address of the interface or the data content received by the interface on the operation panel of the extension program.
The front-end website developer can visually see all interfaces used by the current page, including the URL address of the interface and the data content received by the interface
In step S40, if the user operation for editing the interface data on the operation panel of the extension program is detected, the edited interface data is returned to the current page of the browser.
After the user edits the content of the mock expression input column, the data content display column or the data content formatting display column on the expansion program operation panel according to the actual requirement, click confirmation detects that the user editing operation is completed, and at the moment, the browser is refreshed, so that the edited data content can be displayed on the current page through the browser.
It can be understood that, in the actual project research and development process, at this time, the user is a front-end developer, if the front-end developer needs to test the developed website functions, the back-end developer does not make data yet, if a certain page of the front-end website sends a data request to the back-end server through the data interface on the page, the back-end server will not return data, and at this time, it will not be possible to test whether the functions of the front-end website are normal. Therefore, to ensure the progress of the front-end development work, the test data needs to be simulated. At the moment, a front-end developer can turn on a mock switch on an extended program operation panel, a mock expression is input on a plug-in panel according to self simulation requirements, then a mock data browser plug-in generates a data set conforming to the expression, the mock data browser plug-in serves as a rear-end server after the browser is refreshed, the data set randomly generated and conforming to the data format is returned to a website, the website presents received data on a page, the front-end developer can test whether the functions of a front-end website are normal, and the data simulation test of one interface is completed. Similarly, if the website function needs to be debugged when the website is put into operation, a tester can open the mock data browser plug-in, because the website is put into operation, the back-end server provides data for the website, at the moment, the plug-in intercepts and acquires the data sent by the back-end server, the acquired and intercepted data is displayed in a data content display bar of an extended program operation panel, and a developer can change the data in the data content display bar according to the test requirement to achieve the test purpose.
In this embodiment, when a front-end developer needs to test a function of a certain page of a website, a mock data browser plug-in is opened, an extended program operation panel is popped up, and at this time, the plug-in acquires a URL of a data interface of the current page and data content received by the interface and displays the URL and the data content on the extended program operation panel, so that the front-end developer can visually see the URL address of the interface and the received data content. If data sent by the back-end server is lacked, the data content display column on the panel is blank, a front-end developer can input a mock expression in the mock expression input column according to self requirements, at the moment, the plug-in randomly generates a data set according to the expression and returns the data set to a website page, and therefore the purpose of testing the website page function is achieved. Compared with the conventional method for building the mock server to provide test data for the front-end project, the method has the advantages that the interface URL address defined in the project is not required to be modified for docking the mock server, and the workload of developers is reduced. In addition, when the back-end server returns data, the front-end developer can intercept the returned data through the mock data browser plug-in and change the data according to the test requirement, and the efficiency of the front-end developer is greatly improved.
Further, with reference to fig. 3, another embodiment of the present invention provides that steps S20 and S30 include:
step S21, acquiring interface data sent or received by all data interfaces of the current page through a request sent to the server by the hijack browser, where the interface data includes: the URL address of the interface and the data content received by the interface;
when a plug-in of a mock data browser is opened, when a certain interface of a website triggers a request, the following steps are carried out: a user needs to log in a certain webpage, when the user inputs a user name and a user password and clicks the login, XHR (XmlHttpRequest, extensible hypertext transfer request) or fetch (a request mode similar to XHR) and the like are triggered, and the plug-in can acquire the URL address of the interface, namely the name of the interface, through hijacking the sent request. And if the back-end server receives the request, sending the data to the website according to the requirement of the request, and hijacking the data sent by the back-end server, namely the data received by the data interface by the mock data browser plug-in.
It can be understood that, after the plug-in is used, it is equivalent to that a controller is built between the front-end webpage and the back-end server, and data interacted between the front end and the back end can be acquired. The method for processing the test data by the front-end developer is widened, and the efficiency of the developer is improved.
Step S31, if the data interface receives the data content, the data content and the URL of the interface are displayed on the operation panel of the extended program as interface data;
when the website sends a request and the back-end server can send corresponding data according to the received request, the URL address of the interface and the data received by the interface are hijacked through the plug-in, and the URL address of the interface and the data received by the interface are displayed on the operation panel of the expansion program.
It can be understood that the related data content of the display interface of the operation panel of the extension program can enable the front-end developer to more intuitively see the interactive content between the front-end website and the back-end server.
Step S32, if the interface does not receive the data content, the URL of the interface is displayed on the extended program operation panel as the interface data.
The data needs to be tested after the front-end website is developed, but when the data cannot be provided for the front end due to the fact that a rear-end server is not well built, the data cannot be returned when the website sends a request, at the moment, the plug-in can only acquire the URL of the interface, the URL address is only displayed on the expansion program operation panel, and a data content display column of the expansion program operation panel is blank.
It can be understood that, in the case of data that needs to be simulated and tested, a blank data content display column corresponding to the interface is left on the operation panel of the extension program for the front-end developer to edit the test data. Therefore, the developer can conveniently input the test data to the website.
In this embodiment, by using the mock data browser plug-in, interactive data between the front-end website and the back-end server can be directly acquired, and interactive contents are displayed on the operation panel of the extension program so as to visualize the data, thereby improving the friendliness of the front-end data testing work to developers.
Further, referring to fig. 4, in another embodiment of the present invention, step S40 includes:
step S41, if the mock data master switch on the operation panel of the extension program is opened based on the user operation, opening the interface data editing authority of all data interfaces of the operation panel of the extension program;
and if the mock data main switch and the mock data switch of any data interface on the expansion panel are simultaneously opened based on the user operation, opening the interface data editing authority of the data interface for opening the mock data switch based on the user operation on the expansion program operation panel.
The user may be understood to be a front-end developer but is not limited to a front-end developer. And opening a mock data master switch on the extended program operation panel according to the operation instruction of the front-end developer, and then opening the data editing authority presented by all data interfaces of the current page on the extended program operation panel to the front-end developer. Meanwhile, a user can turn on or turn off any single interface mock data switch according to the data simulation requirement. And closing the switch of the single interface mock data, and closing the interface data editing authority of the data interface of the corresponding single interface mock data switch. When a specific data interface is searched under the condition of more data interfaces, the interface name, namely the interface URL address, which needs to be searched can be input in the API interface search bar, and the specific data interface can be highlighted by clicking for searching.
The mock data master switch and the switch for single interface mock data are introduced, so that data simulation of a single data interface can be realized, and the requirement of a developer on simulating any interface data is met. Meanwhile, the editing authority is controlled by using the switch of mock data, so that the interface data of the data interface can be prevented from being modified by misoperation of a developer.
Step S42, if a mock data expression is input in the mock expression input column on the operation panel based on user operation, generating a data set conforming to the data expression in the data content display column, and returning the data set conforming to the data expression to the current page of the browser;
when the back-end server cannot provide data but needs to test the function of the front-end website, a user can input an expression of the data in a mock expression input field of an operation panel of the extension program according to a test requirement, and clicks a data generation data button after the data is completed, the plug-in can simulate and generate corresponding data in a data content display field according to the expression, and meanwhile, the plug-in serves as a server to return the generated data to a browser, and the user can present the simulated and generated data on a current page only by refreshing the browser so as to test whether the function of the website is normal or not.
And by introducing the mock expression input field, developers can directly input expressions in the mock expression input field according to test requirements, and simulation generated data meet the simulation requirements of front-end developers. Compared with the prior art, the mock server does not need to be built, and test data are simulated to be returned through the mock server. The mock data cost is reduced, and the testing efficiency of front-end development is improved.
Step S43, if the data in the data content display bar on the operation panel is modified based on the user operation, returning the modified data to the current page of the browser.
When the back-end server can provide data, but the provided data can not meet the test requirements of the front-end developer, the front-end developer can modify the data provided by the server in the data content display column of the operation panel of the extension program through the plug-in. And if the JSON Editor switch is turned on based on the operation of a front-end developer, the plug-in formats the data in the data content display column and displays the formatted content in the data content formatting display column. The front-end developer may modify the data in the data content formatting presentation bar. Such as: inquiring the balance of the user in the online bank, returning data of 612314548752424889, 123456 yuan and regular deposit by the back-end service, and displaying the items after opening a JSON Editor switch: the current account is: 612314548752424889, respectively; account balance: 123456 yuan; the deposit type: deposit regularly.
It can be understood that the front-end developer can modify the data returned by the server through the plug-in, and can also display the data in the data content formatting display column in a strip mode according to the format. The testing and debugging work of front-end developers is further facilitated.
In this embodiment, both simulation test data and modification test data can be implemented by using the plug-in. Compared with the prior art that data is simulated or modified through mock service, the mock data cost is greatly reduced, and the efficiency of front-end developers is improved.
The embodiment of the invention also provides an equipment terminal, which comprises a memory, a processor and a mock data control program which is stored on the memory and can run on the processor, wherein the step of the mock data control method is realized when the processor executes the mock data control program.
The embodiment of the invention also provides a readable storage medium, wherein the readable storage medium stores a mock data control program, and the mock data control program is characterized in that the steps of the method of the mock data control program are realized when being executed by a processor.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A mock data control method is characterized by comprising the following steps:
popping up an expansion program operation panel when receiving a starting instruction sent by a browser;
intercepting interface data sent or received by a data interface of a current page of a browser;
displaying the intercepted interface data on the operation panel of the extension program;
and if the user operation of editing the interface data on the operation panel of the extension program is checked, returning the edited interface data to the current page of the browser.
2. The mock data control method according to claim 1, wherein said intercepting interface data received by the browser current page data interface comprises:
the method comprises the steps of obtaining interface data sent or received by all data interfaces of a current page through a request sent to a server through a data interface by a hijack browser, wherein the interface data comprises: the URL address of the interface and the data content received by the interface.
3. The mock data control method according to claim 2, wherein said exposing of said intercepted interface data on said extended program operation panel comprises:
if the data interface receives the data content, the data content and the URL of the interface are used as interface data to be displayed on an extended program operation panel;
and if the interface does not receive the data content, displaying the URL of the interface as interface data on an operation panel of the extension program.
4. The mock data control method according to claim 3, wherein said extended program operation panel comprises: one or more items of a mock data master switch, an API interface search column, a single interface mock data switch, a mock expression input column, a data content display column, a JSON Editor switch and a data content formatting display column.
5. The mock data control method according to claim 4, wherein after said step of intercepting data of a data interface of a current page of a browser, comprising:
if the mock data master switch on the expansion program operation panel is opened based on user operation, opening the interface data editing permission of all data interfaces of the expansion program operation panel;
and if the mock data main switch and the mock data switch of any data interface on the expansion panel are simultaneously opened based on the user operation, opening the interface data editing authority of the data interface for opening the mock data switch based on the user operation on the expansion program operation panel.
6. The mock data control method according to claim 5, wherein if the user operation of editing the interface data on the operation panel of the extended program is checked, the edited interface data is returned to the current page of the browser:
if the mock data expression is input in the mock expression input field on the operation panel based on the user operation, generating a data set conforming to the data expression in the data content display field, and returning the data set conforming to the data expression to the current page of the browser;
and if the data in the data content display column on the operation panel is modified based on the user operation, returning the modified data to the current page of the browser.
7. The Mock data control method according to claim 1, wherein said browser is installed with a Mock data browser plug-in and displays said plug-in icon button in a browser toolbar.
8. The mock data control method according to claim 7, wherein said step of receiving an enabling instruction sent by a browser comprises:
and when the Mock data browser plug-in icon button is triggered based on user operation, the Mock data browser plug-in enabling instruction is considered to be received.
9. An equipment terminal, characterized in that the equipment terminal comprises a memory, a processor and a mock data control program stored on the memory and operable on the processor, the processor implementing the steps of the mock data control method according to any one of claims 1 to 8 when executing the mock data control program.
10. A readable storage medium, on which a mock data control program is stored, characterized in that the mock data control program, when executed by a processor, implements the steps of the mock data control program method according to any one of claims 1 to 8.
CN202110934981.7A 2021-08-13 2021-08-13 mock data control method, equipment terminal and computer readable storage medium Active CN113836460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110934981.7A CN113836460B (en) 2021-08-13 2021-08-13 mock data control method, equipment terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110934981.7A CN113836460B (en) 2021-08-13 2021-08-13 mock data control method, equipment terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113836460A true CN113836460A (en) 2021-12-24
CN113836460B CN113836460B (en) 2022-05-27

Family

ID=78960609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110934981.7A Active CN113836460B (en) 2021-08-13 2021-08-13 mock data control method, equipment terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113836460B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177994A1 (en) * 2003-01-12 2008-07-24 Yaron Mayer System and method for improving the efficiency, comfort, and/or reliability in Operating Systems, such as for example Windows
CN101311924A (en) * 2007-05-24 2008-11-26 中兴通讯股份有限公司 Graphical user interface browsers system and method
CN105138448A (en) * 2014-06-05 2015-12-09 北京畅游天下网络技术有限公司 Method and device for page test at front end
US20160259509A1 (en) * 2015-03-02 2016-09-08 Warhead, Inc. Backend-to-frontend website development
CN106598575A (en) * 2016-11-30 2017-04-26 武汉斗鱼网络科技有限公司 Front-end data simulation implementation method and system
CN107273528A (en) * 2017-06-28 2017-10-20 努比亚技术有限公司 A kind of front and back end separation method, mobile terminal and computer-readable recording medium
CN107423049A (en) * 2017-04-18 2017-12-01 南京凯蒙教育科技有限公司 Realize method, browser and the terminal device of online programming
WO2020177519A1 (en) * 2019-03-05 2020-09-10 中国银联股份有限公司 Debugging method executed on smart terminal and software debugging device
CN111694561A (en) * 2020-06-10 2020-09-22 中国建设银行股份有限公司 Interface management method, device, equipment and storage medium
CN112631910A (en) * 2020-12-22 2021-04-09 平安普惠企业管理有限公司 Front-end testing method and device, computer equipment and storage medium
CN112732572A (en) * 2021-01-06 2021-04-30 微民保险代理有限公司 Service testing method, device and system, storage medium and electronic device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177994A1 (en) * 2003-01-12 2008-07-24 Yaron Mayer System and method for improving the efficiency, comfort, and/or reliability in Operating Systems, such as for example Windows
CN101311924A (en) * 2007-05-24 2008-11-26 中兴通讯股份有限公司 Graphical user interface browsers system and method
CN105138448A (en) * 2014-06-05 2015-12-09 北京畅游天下网络技术有限公司 Method and device for page test at front end
US20160259509A1 (en) * 2015-03-02 2016-09-08 Warhead, Inc. Backend-to-frontend website development
CN106598575A (en) * 2016-11-30 2017-04-26 武汉斗鱼网络科技有限公司 Front-end data simulation implementation method and system
CN107423049A (en) * 2017-04-18 2017-12-01 南京凯蒙教育科技有限公司 Realize method, browser and the terminal device of online programming
CN107273528A (en) * 2017-06-28 2017-10-20 努比亚技术有限公司 A kind of front and back end separation method, mobile terminal and computer-readable recording medium
WO2020177519A1 (en) * 2019-03-05 2020-09-10 中国银联股份有限公司 Debugging method executed on smart terminal and software debugging device
CN111694561A (en) * 2020-06-10 2020-09-22 中国建设银行股份有限公司 Interface management method, device, equipment and storage medium
CN112631910A (en) * 2020-12-22 2021-04-09 平安普惠企业管理有限公司 Front-end testing method and device, computer equipment and storage medium
CN112732572A (en) * 2021-01-06 2021-04-30 微民保险代理有限公司 Service testing method, device and system, storage medium and electronic device

Also Published As

Publication number Publication date
CN113836460B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN108345543B (en) Data processing method, device, equipment and storage medium
CN103810089B (en) Automatically testing gesture-based applications
CN105975393B (en) Page display detection method and system
CN111416756B (en) Protocol testing method, device, computer equipment and storage medium
CN111602107B (en) Display method and terminal during application quitting
CN110716853A (en) Test script recording method, application program testing method and related device
CN110320378B (en) Method, apparatus, device and computer readable storage medium for applying for a quality control test
CN109582317B (en) Method and apparatus for debugging hosted applications
CN112099684A (en) Search display method and device and electronic equipment
CN111475390A (en) Log collection system deployment method, device, equipment and storage medium
WO2015043352A1 (en) Method and apparatus for selecting test nodes on webpages
JP6525043B2 (en) DATA GENERATION DEVICE, DATA GENERATION METHOD, AND PROGRAM
CN110674023B (en) Interface testing method and device
CN106557411B (en) Method and system for testing Hybrid application in Android system
CN108363793B (en) Webpage application access method and device, storage medium and electronic equipment
CN113836460B (en) mock data control method, equipment terminal and computer readable storage medium
CN112416751A (en) Processing method and device for interface automation test and storage medium
CN109739758B (en) Test case conversion method and device
JP7294609B2 (en) Program, Method, and Device for Supporting Software Operation Scenario Generation
CN113468260A (en) Data analysis method and device, electronic equipment and storage medium
CN115686506A (en) Data display method and device, electronic equipment and storage medium
CN111309613A (en) Application testing method, device, equipment and computer readable storage medium
KR20170047605A (en) System and method for performing test automation of solution
CN115145464B (en) Page testing method and device, electronic equipment and storage medium
CN116049020B (en) Automatic test method, device and equipment for software products and readable 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
GR01 Patent grant
GR01 Patent grant