CN111782117A - Interface display method and device, storage medium and electronic device - Google Patents

Interface display method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111782117A
CN111782117A CN202010623223.9A CN202010623223A CN111782117A CN 111782117 A CN111782117 A CN 111782117A CN 202010623223 A CN202010623223 A CN 202010623223A CN 111782117 A CN111782117 A CN 111782117A
Authority
CN
China
Prior art keywords
data
window
field
interface
client
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
CN202010623223.9A
Other languages
Chinese (zh)
Other versions
CN111782117B (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.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN202010623223.9A priority Critical patent/CN111782117B/en
Publication of CN111782117A publication Critical patent/CN111782117A/en
Application granted granted Critical
Publication of CN111782117B publication Critical patent/CN111782117B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses an interface display method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: detecting a first operation on a client, wherein the first operation is used for indicating the client to receive a first file, and the first file is used for describing the data format of target data in a first window; determining a data field and a field description of the target data by parsing the first file; and in response to the first operation, presenting an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the presented field. The data testing method and device solve the technical problem that data testing efficiency in the related technology is low.

Description

Interface display method and device, storage medium and electronic device
Technical Field
The application relates to the field of internet, in particular to an interface display method and device, a storage medium and an electronic device.
Background
json refers to JavaScript Object Notation (JavaScript Object Notation). Has the following characteristics: json is a lightweight text data interchange format; json is language independent; json is self-descriptive and easier to understand; json uses JavaScript syntax to describe data objects, but json is still language and platform independent; the json parser and json library support many different programming languages.
At present, json verification in related technologies mainly aims at verifying correctness of a json format, namely whether json is correct data according with json-schema or not, and if the json format is incorrect, corresponding errors are prompted, and then analysis cannot be performed. In addition, the json data is provided in a json form and is required to meet requirements specified by definition of the application program interface, for example, the required parameter types are shaping, character strings and the like, the parameters can be filled or not, a certain parameter requires an incoming ip address and an incoming correct ip address, and the parameters can be introduced and the application program interface is called after meeting the json-schema format and the specific service rule.
The interface test is a test for testing interfaces among system components, and is mainly used for detecting interaction points between an external system and a system and between each internal subsystem. Most of the existing interface testing tools select an interface, provide a reference json string, click a request and check whether a returned result (json string) is correct or not to test.
At present, when data such as json and the like are tested, a tester needs to participate in each link of the test, so that the test efficiency is influenced.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides an interface display method and device, a storage medium and an electronic device, and aims to at least solve the technical problem of low data testing efficiency in the related art.
According to an aspect of an embodiment of the present application, there is provided an interface display method, including: detecting a first operation on a client, wherein the first operation is used for indicating the client to receive a first file, and the first file is used for describing a data format of target data in a first window; determining a data field and a field description of the target data by parsing the first file; and in response to the first operation, presenting an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the presented field.
According to another aspect of the embodiments of the present application, there is also provided an interface display apparatus, including: the client comprises a detection unit, a first window and a second window, wherein the detection unit is used for detecting a first operation on the client, the first operation is used for indicating the client to receive a first file, and the first file is used for describing the data format of target data in the first window; a determining unit, configured to determine a data field and a field description of the target data by parsing the first file; and the display unit is used for responding to the first operation and displaying an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the displayed field.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, a first file in a data format in which target data is recorded is transmitted to a client, an interactive interface (the interface comprises an interactive window of the data in the data format and an interactive window of field description of the data) interacting with a tester is formed through analysis of the client, the tester can directly interact in the interactive interface, for example, after the target data is directly input, whether each field is correct or not is checked according to the data field, and whether the data field is correct or not is not checked after the test, or the target data is directly generated after the data field is input, so that errors occurring when the whole target data is manually input are avoided, the technical problem of low data test efficiency in the related technology can be solved, and the technical effect of inputting the wrong target data in a test stage is further avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of a hardware environment of a presentation method of an interface according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative interface presentation method according to an embodiment of the present application;
FIG. 3 is a schematic view of an alternative interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram of alternative tabular data according to an embodiment of the present application;
FIG. 5 is a schematic view of an alternative interface according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an alternative interface description according to an embodiment of the present application;
FIG. 7 is a diagram of an alternative field definition according to an embodiment of the present application;
FIG. 8 is a schematic view of an alternative interface according to an embodiment of the present application;
FIG. 9 is a schematic illustration of an alternative form linkage according to an embodiment of the present application;
FIG. 10 is a schematic view of an alternative interface according to an embodiment of the present application;
FIG. 11 is a schematic view of an alternative interface display according to an embodiment of the present application;
and
fig. 12 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, partial nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
JSON: the full name is JavaScript Object Notation, namely JS Object Notation, which is a lightweight data exchange format. Based on a subset of ECMAScript (js specification established by European computer Association), the method adopts a text format completely independent of a programming language to store and express data, and a simple and clear hierarchical structure enables JSON to become an ideal data exchange language, so that the method is easy for a user to read and write, is easy for machine analysis and generation, and effectively improves the network transmission efficiency.
json-schema: the json-schema is actually a standard json string, describes a required data specification by the json string, supports annotation and verifies a json document, namely, the json-schema can be used for verifying whether the given json string meets the required data format specification or not, the json-schema is a standard for defining json data constraint, according to the convention mode, two parties exchanging data can understand the requirements and the constraints of the json data, and can verify the data accordingly to ensure the correctness of data exchange.
Today, software development tends to be micro-servings more and more, system application is changed from an original single body to dozens to hundreds of different micro-services, interfaces among the micro-services are called more and more frequently, wherein mainstream data transmission adopts an agreed data format (for example, json and other formats are adopted, and json is taken as an example for description in the following), so that the json format check is very important.
The inventor analyzes the related technology, realizes that the verification of the access parameter json format of each interface is time-consuming and labor-consuming in the software development and test joint debugging stage, the json verification in the related technology depends on more manpower, errors can be found only when a program runs, if the error prompt is not accurate, if a complete json data is manually written to a test port through a specific tool, the problem is found by detecting the returned data, if the json definition is correct, the data field is correct, and the writing format is correct, more manpower is consumed to analyze the problem, so that the realization of one tool can verify the grammar rule of the json and verify the service logic rule of a given interface is necessary; interface testing often requires manual splicing into a reference json string, so that the possibility of error occurs, and for returned json string results, an inconvenient place also exists for manual checking; the propagation of the interface document is limited to the office document, and the synchronization after modification is time-consuming and labor-consuming.
In view of the foregoing problems, according to an aspect of the embodiments of the present application, a method embodiment of a method for displaying an interface is provided.
Optionally, in this embodiment, the interface presentation method may be applied to a hardware environment formed by a terminal 101 (corresponding to a front end, which may be deployed at a web front end of a server, and call a backend service) and a server 103 (corresponding to a backend, which may be deployed at a backend of the server, and expose an interface for use by the front end service) as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as business services, game services, application services, etc.) for the terminal or a client installed on the terminal, and a database 105 may be provided on the server or separately from the server, which may be used to provide data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like.
The interface display method in the embodiment of the present application may be executed by the terminal 101, or may be executed by both the server 103 and the terminal 101. The method for displaying the interface executed by the terminal 101 according to the embodiment of the present application may also be executed by a client installed thereon. For example, the terminal 101 executes the method, and fig. 2 is a flowchart of an optional interface displaying method according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, a first operation is detected on the client, where the first operation is used to instruct the client to receive a first file, and the first file is used to describe a data format of the target data in the first window.
The first file is a file for describing a data format (including at least one data field and field description) of target data, the first file has a format of a data field and a field description agreed with a client, for example, an excel form, one specified column in the form is filled in the data field, the other specified column is filled in the field description, and the data field and the field description corresponding to the same row are corresponding; and thirdly, the first file can be a word file or a text file, wherein data fields positioned between "#" are indicated by using a designated character "# #" in the file, and field descriptions positioned between "#" are indicated by using a designated character "#".
The client is a client installed on a terminal, and the client may be a client of a system self-contained application (such as a self-contained browser) or a client of an installation application (such as a client for testing), and logic for parsing the logic content of the first file and identifying the "data field" and the "field description" according to a specified position or specified characters is defined in the bottom logic of the client.
Step S204, determining the data field and the field description of the target data by analyzing the first file.
Step S206, responding to the first operation, displaying an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of data conforming to the data format, and the second window is an interactive window of data described by the displayed field.
The first window corresponds to an interactive window of complete target data, and target data can be viewed or input in the window, and the second window corresponds to an interactive window of a data field in the target data, and content corresponding to the data field can be viewed or input in the window.
For example, target data input in a first window can be analyzed to a corresponding second window to be displayed according to data fields; and filling the data input in the second window into the corresponding position in the first window according to the data field.
Through the steps, the first file with the data format of the target data recorded is transmitted to the client, an interactive interface (the interface comprises an interactive window of the data with the data format and an interactive window of field description of the data) interacting with a tester is formed through analysis of the client, the tester can directly interact in the interactive interface, for example, after the target data is directly input, whether each field is correct or not is checked according to the data field, whether the data field is correct or not is not required to be checked after the test, or the target data is directly generated after the data field is input, errors occurring when the whole target data is manually input are avoided, the technical problem that the data test efficiency in the related technology is low can be solved, and the technical effect that the wrong target data is input in the test stage is further avoided.
Optionally, after the interactive interface is displayed on the client, the technical solution of the present application supports editing the data fields and the field descriptions in the interface according to the following steps 11 to 12:
and 11, detecting the editing operation of the tester on the client.
And step 12, editing the data field and the field description of the target data according to the instruction of the editing operation.
In the above scheme, editing the data field and the field description of the target data according to the instruction of the editing operation includes at least one of: 1) adding data fields and corresponding field descriptions for the target data according to the adding operation, wherein the editing operation comprises the adding operation; 2) deleting the corresponding data fields and field descriptions in the target data according to the deletion operation, wherein the editing operation comprises the deletion operation; 3) and modifying the corresponding data field and the field description in the target data according to the modification operation, wherein the editing operation comprises the modification operation.
Optionally, in the above embodiment, after the interactive interface is presented on the client, the interaction may be performed on the interactive interface in the following two ways:
a first way of interacting is to update the data in the second window (shown in the middle of fig. 3) according to the data entered in the first window by the second operation, in case the second operation in the first window (shown in the left side of fig. 3) is detected.
In the above scheme, updating the data in the second window according to the data input by the second operation in the first window includes: acquiring first data input by a second operation in a first window and a first data field in which the first data are located in target data, wherein the target data comprise the first data; and updating the content in a first sub-window in the second window into first data, wherein the first sub-window is a window corresponding to the first field description, and the first field description is used for describing the first data field.
As shown in fig. 3, when "202001021345" is input in the "trade time" data field of the first window, the "13 o' clock 45 minutes 1/2/2020 appears at the position corresponding to the" trade time "data field on the left side, thereby realizing the linkage of the first window and the second window.
In the second interaction mode, when a third operation in the second window is detected, the data in the first window is updated according to the data input in the second window by the third operation.
In the above scheme, updating the data in the first window according to the data input by the third operation in the second window includes: acquiring second data input by a third operation in a second sub-window of a second window and a second data field in which the second data is located in target data, wherein the second sub-window is a window corresponding to the description of the second field, and the description of the second field is used for describing the second data field; and updating the content of the second data field of the target data in the first window into second data.
As shown in fig. 3, if "123456" is input in the "business number" data field, then "123456" appears at a position corresponding to the "business number" on the left side, thereby realizing linkage of the second window and the first window.
Optionally, after determining the data field and the field description of the target data by parsing the first file, an interface document of the target interface is generated according to the data field and the field description of the target data, where the interface document includes a field interface description, a parameter code, a parameter name, and a parameter type.
Optionally, after presenting the interactive interface on the client, after generating the required target data: detecting a fourth operation (such as clicking 'submit' in the second window by a tester) on the client, wherein the fourth operation is used for indicating that the target interface is tested by using the target data displayed in the first window; sending the target data to a target interface; and receiving a response result returned by the target interface.
Optionally, the receiving the response result returned by the target interface includes: under the condition that the response result is matched with the target information, displaying prompt information which passes the test on the client, wherein the target information is information for responding to the target data when the target interface is normal; and under the condition that the response result is not matched with the target information, displaying prompt information of the test exception on the client.
If the scheme is realized in a web service mode, after a user logs in from a front-end page, the excel forms of each interface field meeting the specified rules are imported in batch from the front-end page, one interface can be configured into one sheet, a plurality of interfaces can be imported at one time, the sheet names can be interface field names, a back-end program is analyzed and then stored in a database, and the user can maintain the interface fields of each interface and can also generate an online interface document. A user clicks one interface on an interface page, a program is displayed into three parts according to rules, namely a join json string (initialized according to the rules), a form (comprising a text box, a drop-down selection box, a check box, a radio box and the like) and a join json string (empty if not requested), wherein the form and the json data are in bidirectional linkage. The user can input data in the form, check the business rules in real time in the input process and update the json data at the same time. The user can also directly paste the existing json data, the program automatically fills the data into each field in the form, and the business rules of each field are verified. After the verification is passed, the returned result can be directly obtained by clicking and submitting.
By adopting the technical scheme, the problems of checking the syntax format of the json entry of the application program calling interface and checking the service rule of each field in the json string are solved, the problem caused by the fact that the field does not accord with the specification in the debugging process is reduced, and the development, joint debugging and testing costs are saved; the problems of generation, editing and verification of the input json string and visual check of the output json string in the interface test are solved, and the efficiency of the interface test is improved; the method solves the problems of offline handover and synchronization of the interface documents, and improves the efficiency of demand synchronization, interface development and test.
As an alternative example, the technical solution of the present application is further described below with reference to specific embodiments.
Step 1, a user opens a web page, imports data of each field of an interface meeting conditions, and imports the data in an excel form. The simple schematic diagram of importing excel data is shown in fig. 4 (taking the entry of a simple interface as an example):
all the fields are fields contained in json required to be provided for calling the interface, and each field can have a parent-child relationship; the content in the parameter rule column can be filled in according to a specified grammar format, and the interface is imported and then stored in a database; when the parameter type is json and the parameter type is a parent field, all subordinate fields are spliced into json character strings.
The rule settings for the parameter rule (general rule) column are as follows (including but not limited to): enum enumeration, amout amount rules, date format, phone number, email, ip address, etc., the parameter types may be expanded by simple configuration, and these parameter rules may give a prompt on a foreground page, for example, if a mobile phone number input in a foreground form is illegal or a mobile phone number given in a json string is illegal, a red prompt is given in the form: the mobile phone number is illegal.
The user may edit (add, modify, delete, etc.) the interface field data at the interface, as shown in fig. 5, or may view the interface document online, where the interface document is generated by dynamically splicing the imported interface data in real time, as shown in fig. 6.
And 2, clicking an interface by a user on the interface, reading data from the database by a program, sending the data to a front-end page, mapping background data into a corresponding form by the front-end page according to rules, wherein the content of each field is null, and the data of each field in a corresponding json string is null.
As shown in fig. 3, the left side is the entry json data, the middle is the form, the right side is the exit json data (the entry conforms to the rules and then is submitted by clicking, and the entry is obtained by calling the background interface), the left entry fields and the middle form entries are in one-to-one correspondence and are linked in a two-way manner, that is, one entry is input, and the other entry is changed synchronously.
After the user opens an interface, page initialization is completed, and the left side generates an initialization json string, as shown in fig. 3, but fields of the json string are initialized to be empty, and a specific rule is shown in fig. 7. The field of the string type is initialized to an empty string, i.e., the field of the "" int/double type is initialized to null. The json initialization on the left side only generates mandatory fields, but not mandatory fields, and the fields are automatically added to the left side after the user inputs the fields, and are deleted from the left side after the user deletes the input. If the upper field is json, after filling the lower fields, all the lower fields can be spliced into a json character string as the data of the upper fields. An example illustration of the entry of the lower band fields is shown in fig. 8.
And 3, the user inputs data of each field in the middle form, the service rule of each field can be prompted in real time in the input process, the prompt is given when the data do not meet the conditions, the input is finished, after the verification is passed, the user can take the automatically generated json data string on the left side, the json data string can be used for subsequent interface testing, the json data string can be directly clicked and submitted on the page, the corresponding interface is called by the background, the result is returned to the right side, the json string is formatted, and the success or failure state of the interface calling is given according to the success or failure rule set by the code table.
The flow of the left and middle form linkage sections is shown in FIG. 9:
json string represents the left json string in FIG. 3; the From form represents the intermediate form area, containing the following three data sets: schema, which represents the background return value and the user initialization form, wherein the user initialization form contains all fields of the interface and all information thereof; model, representing a collection of form fields and data; rules, which represent the form fields extracted from the schema, include business rules (mandatory, type, length, etc.) and general rules (mobile phone number, mailbox, etc.); the intermediate variable (middle) represents intermediate data.
JsonFormStongRules and JsonFurmStongModel are responsible for monitoring the form, monitoring the changes of the rules and the model respectively, synchronizing the changes to an intermediate variable in real time, JsonStringToForm is responsible for monitoring and updating json strings to the form, and the json strings are mapped to the intermediate variable of the form; wherein, the line corresponding to A is an initialization line. And the line corresponding to B is a linkage line from the json string on the left side to the form. The other lines are the linkage lines from the form to the json string on the left.
And 4, pasting json data generated by the program on the left side of the interface by the user, or directly editing json string data, filling a right form after program analysis, filling data into a form corresponding to the right side after checking that json is correct json data, and giving an error prompt if a field which does not accord with a rule exists.
The json string on the left must contain the mandatory fields displayed by the form on the right, and if not, a prompt is given. The optional fields can be deleted on the left side, and the data can be emptied on the form, and the results are the same in the two ways. In practical engineering applications, filling and not filling of unnecessary fields are different program logics and need to be processed respectively, and testers need to verify respectively, and the flexibility provided herein is just to solve the problem.
Step 5, the user takes the correct json data for subsequent use. Or directly clicking and submitting the page to obtain a return result (output reference), wherein the rule is that correct json data meeting the condition can only be submitted to the background, and an example of the return result (correct result) is shown in fig. 10.
In the scheme, after the existing interface document is imported, online visual editing can be carried out; viewing on line, wherein the viewed interface document is dynamically generated in real time; the json string and the form are linked in a bidirectional mode, the json string initialization value shows mandatory fields, unnecessary fields are added to the json string in real time after being input, and unnecessary field data are deleted from the json string in real time after being deleted; after the lower fields are filled in, all the lower fields can be spliced into a json character string to be used as data of the upper fields; a user inputs form content, gives json format rules, business rules and general rules in real time, and gives rule prompts; after the json data accords with the business rule and the general rule, the user directly submits, the program calls the interface, and the interface execution result is returned for testing the forward data of the interface test.
The beneficial effect that this technical scheme brought includes: the interface document is edited, modified, checked, imported and exported in the whole process for visualization, and a web system is convenient for all people to use in real time; after the interface data is maintained, the latest interface document can be checked on line in real time, and the investment of the off-line synchronous interface document is reduced; basic format check is carried out on the json data, whether fields need to be filled or not, the field types, the field lengths and special fields (mobile phone numbers, mailboxes, ip and the like, and the fields can be easily expanded), errors in the json data preparation stage in the developing, testing and joint debugging processes are reduced, and software development, testing and joint debugging progress is accelerated; the interface fields are visualized, development testers can input data in a form and can also paste the existing json data, wherein the processing of unnecessary fields is flexible and also accords with request logic, the fields are defaulted and not initialized, and the fields are initialized after being filled by a user; after the entry json rule of the interface passes the verification, the interface is clicked and submitted, the interface can be directly called, and a result (exit) is returned for the interface test in the joint debugging stage.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiment of the application, an interface display device for implementing the interface display method is further provided. Fig. 11 is a schematic view of an alternative interface display apparatus according to an embodiment of the present application, which may include, as shown in fig. 11:
a detecting unit 1101, configured to detect a first operation on a client, where the first operation is used to instruct the client to receive a first file, and the first file is used to describe a data format of target data in a first window;
a determining unit 1103, configured to determine, by parsing the first file, a data field and a field description of the target data;
a presentation unit 1105, configured to, in response to the first operation, present an interactive interface on the client, where the interactive interface includes the first window and a second window, the first window is an interactive window of data conforming to the data format, and the second window is an interactive window of data described by the presented field.
It should be noted that the detecting unit 1101 in this embodiment may be configured to execute step S202 in this embodiment, the determining unit 1103 in this embodiment may be configured to execute step S204 in this embodiment, and the displaying unit 1105 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, the first file with the data format of the target data recorded is transmitted to the client, an interactive interface (the interface comprises an interactive window of the data with the data format and an interactive window of field description of the data) interacting with a tester is formed through analysis of the client, the tester can directly interact in the interactive interface, for example, after the target data is directly input, whether each field is correct or not is checked according to the data field, whether the data field is correct or not is not required to be checked after the test, or the target data is directly generated after the data field is input, errors occurring when the whole target data is manually input are avoided, the technical problem that the data test efficiency in the related technology is low can be solved, and the technical effect that the wrong target data is input in the test stage is further avoided.
Optionally, the apparatus further comprises: the first updating unit is used for updating data in the second window according to data input by the second operation in the first window under the condition that the second operation in the first window is detected after the interactive interface is displayed on the client; or, the second updating unit is used for updating the data in the first window according to the data input by the third operation in the second window under the condition that the third operation in the second window is detected.
Optionally, the first updating unit includes: the first acquisition module is used for acquiring first data input by a second operation in a first window and a first data field where the first data are located in target data, wherein the target data comprise the first data; and the first updating module is used for updating the content in a first sub-window in the second window into first data, wherein the first sub-window is a window corresponding to the first field description, and the first field description is used for describing the first data field.
Optionally, the second updating unit includes: a second obtaining module, configured to obtain second data input by a second sub-window of a second window in a third operation and a second data field in which the second data is located in the target data, where the second sub-window describes a corresponding window for the second field, and the second field description is used to describe the second data field; and the second updating module is used for updating the content of the second data field of the target data in the first window into second data.
Optionally, the apparatus may further include: the editing unit detects editing operation on the client after the interactive interface is displayed on the client; and editing the data field and the field description of the target data according to the indication of the editing operation.
Optionally, editing the data field and the field description of the target data according to the indication of the editing operation includes at least one of: adding data fields and corresponding field descriptions for the target data according to the adding operation, wherein the editing operation comprises the adding operation; deleting the corresponding data fields and field descriptions in the target data according to the deletion operation, wherein the editing operation comprises the deletion operation; and modifying the corresponding data field and the field description in the target data according to the modification operation, wherein the editing operation comprises the modification operation.
Optionally, the apparatus may further include a testing unit, configured to detect a fourth operation on the client after the interactive interface is displayed on the client, where the fourth operation is used to instruct to test the target interface using the target data displayed in the first window; sending the target data to a target interface; and receiving a response result returned by the target interface.
Optionally, the test unit is further configured to: after receiving a response result returned by the target interface, displaying prompt information that the test is passed on the client under the condition that the response result is matched with target information, wherein the target information is information for responding to target data when the target interface is normal; and under the condition that the response result is not matched with the target information, displaying prompt information of the test exception on the client.
Optionally, the apparatus may further include a generating unit, configured to generate an interface document of the target interface according to the data field and the field description of the target data after determining the data field and the field description of the target data by parsing the first file, where the interface document includes a field interface description, a parameter code, a parameter name, and a parameter type.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the application, a server or a terminal for implementing the display method of the interface is also provided.
Fig. 12 is a block diagram of a terminal according to an embodiment of the present application, and as shown in fig. 12, the terminal may include: one or more processors 1201 (only one of which is shown in fig. 12), a memory 1203, and a transmission 1205. as shown in fig. 12, the terminal may also include an input-output device 1207.
The memory 1203 may be used to store software programs and modules, such as program instructions/modules corresponding to the interface display method and apparatus in the embodiment of the present application, and the processor 1201 executes various functional applications and data processing by running the software programs and modules stored in the memory 1203, that is, implements the interface display method described above. The memory 1203 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1203 may further include memory located remotely from the processor 1201, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The above-mentioned transmission means 1205 is used for receiving or sending data via a network, and may also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1205 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 1205 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
Among them, the memory 1203 is specifically used for storing an application program.
The processor 1201 may invoke an application stored in the memory 1203 via the transmission 1205 to perform the following steps:
detecting a first operation on a client, wherein the first operation is used for indicating the client to receive a first file, and the first file is used for describing a data format of target data in a first window;
determining a data field and a field description of the target data by parsing the first file;
and in response to the first operation, presenting an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the presented field.
The processor 1201 is further configured to perform the following steps:
detecting a fourth operation on the client, wherein the fourth operation is used for indicating that the target interface is tested by using the target data displayed by the first window;
sending the target data to a target interface;
receiving a response result returned by the target interface;
under the condition that the response result is matched with the target information, displaying prompt information which passes the test on the client, wherein the target information is information for responding to the target data when the target interface is normal;
and under the condition that the response result is not matched with the target information, displaying prompt information of the test exception on the client.
By adopting the embodiment of the application, the first file with the data format of the target data is transmitted to the client, an interactive interface (the interface comprises the interactive window of the data in the data format and the interactive window of the field description data) interacting with a tester is formed through the analysis of the client, the tester can directly interact in the interactive interface, for example, after the target data is directly input, whether each field is correct or not is checked according to the data field, the test is not required to wait until the data field is correct or not, or the target data is directly generated after the data field is input, errors occurring when the whole target data is manually input are avoided, the technical problem of low data test efficiency in the related technology can be solved, and the technical effect of inputting the wrong target data in the test stage is further avoided.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 12 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 12 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 12, or have a different configuration than shown in FIG. 12.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be used to execute a program code of the interface presentation method.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
detecting a first operation on a client, wherein the first operation is used for indicating the client to receive a first file, and the first file is used for describing a data format of target data in a first window;
determining a data field and a field description of the target data by parsing the first file;
and in response to the first operation, presenting an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the presented field.
Optionally, the storage medium is further arranged to store program code for performing the steps of:
detecting a fourth operation on the client, wherein the fourth operation is used for indicating that the target interface is tested by using the target data displayed by the first window;
sending the target data to a target interface;
receiving a response result returned by the target interface;
under the condition that the response result is matched with the target information, displaying prompt information which passes the test on the client, wherein the target information is information for responding to the target data when the target interface is normal;
and under the condition that the response result is not matched with the target information, displaying prompt information of the test exception on the client.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. An interface display method is characterized by comprising the following steps:
detecting a first operation on a client, wherein the first operation is used for instructing the client to receive a first file, and the first file is used for describing a data format of target data in a first window;
determining data fields and field descriptions of the target data by parsing the first file;
and in response to the first operation, presenting an interactive interface on the client, wherein the interactive interface comprises the first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the presented field.
2. The method of claim 1, wherein after presenting the interactive interface on the client, the method further comprises:
in the case of detecting a second operation in the first window, updating data in the second window according to data input in the first window by the second operation; or the like, or, alternatively,
and in the case of detecting a third operation on the second window, updating the data in the first window according to the data input by the third operation on the second window.
3. The method of claim 2, wherein updating the data in the second window based on the data entered in the first window by the second operation comprises:
acquiring first data input by the second operation in the first window and a first data field in which the first data is located in the target data, wherein the target data comprises the first data;
and updating the content in a first sub-window in the second window into the first data, wherein the first sub-window is a window corresponding to a first field description, and the first field description is used for describing the first data field.
4. The method of claim 2, wherein updating the data in the first window based on the data entered in the second window by the third operation comprises:
acquiring second data input by the third operation in a second sub-window of the second window and a second data field where the second data is located in the target data, wherein the second sub-window is a window corresponding to the second field description, and the second field description is used for describing the second data field;
updating the content of a second data field of the target data in the first window to the second data.
5. The method of claim 1, wherein after presenting the interactive interface on the client, the method further comprises:
detecting an editing operation on the client;
and editing the data field and the field description of the target data according to the indication of the editing operation.
6. The method of claim 5, wherein editing the data fields and field descriptions of the target data in accordance with the indication of the editing operation comprises at least one of:
adding a data field and a corresponding field description for the target data according to a new adding operation, wherein the editing operation comprises the new adding operation;
deleting the corresponding data fields and field descriptions in the target data according to a deleting operation, wherein the editing operation comprises the deleting operation;
and modifying the corresponding data field and field description in the target data according to a modification operation, wherein the editing operation comprises the modification operation.
7. The method of claim 1, wherein after presenting the interactive interface on the client, the method further comprises:
detecting a fourth operation on the client, wherein the fourth operation is used for indicating that a target interface is tested by using the target data exposed by the first window;
sending the target data to the target interface;
and receiving a response result returned by the target interface.
8. An interface display device, comprising:
the device comprises a detection unit, a first window and a second window, wherein the detection unit is used for detecting a first operation on a client, the first operation is used for indicating the client to receive a first file, and the first file is used for describing the data format of target data in the first window;
a determining unit, configured to determine a data field and a field description of the target data by parsing the first file;
and the display unit is used for responding to the first operation and displaying an interactive interface on the client, wherein the interactive interface comprises a first window and a second window, the first window is an interactive window of the data conforming to the data format, and the second window is an interactive window of the data described by the displayed field.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 7 by means of the computer program.
CN202010623223.9A 2020-06-30 2020-06-30 Interface display method and device, storage medium and electronic device Active CN111782117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010623223.9A CN111782117B (en) 2020-06-30 2020-06-30 Interface display method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010623223.9A CN111782117B (en) 2020-06-30 2020-06-30 Interface display method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111782117A true CN111782117A (en) 2020-10-16
CN111782117B CN111782117B (en) 2021-11-09

Family

ID=72760580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010623223.9A Active CN111782117B (en) 2020-06-30 2020-06-30 Interface display method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111782117B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256375A (en) * 2020-10-22 2021-01-22 深圳市元征科技股份有限公司 Vehicle information interaction method, device, equipment and medium
CN112926290A (en) * 2021-03-09 2021-06-08 上海万向区块链股份公司 System, method and medium for generating presentation interface document
CN114785769A (en) * 2022-03-31 2022-07-22 北京达佳互联信息技术有限公司 File processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140122043A1 (en) * 2012-11-01 2014-05-01 University Of Nebraska Linking graphical user interface testing tools and human performance modeling to enable usability assessment
US20160140024A1 (en) * 2014-11-18 2016-05-19 Semiconductor Manufacturing International (Shanghai) Corporation Method and device for testing semiconductor manufacturing equipment automation program
CN107577599A (en) * 2017-08-21 2018-01-12 同程网络科技股份有限公司 A kind of automatic interface testing method and platform based on custom script
CN110096434A (en) * 2019-03-28 2019-08-06 咪咕文化科技有限公司 Interface testing method and device
CN111176976A (en) * 2019-08-05 2020-05-19 腾讯科技(深圳)有限公司 Test data generation method and device, storage medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140122043A1 (en) * 2012-11-01 2014-05-01 University Of Nebraska Linking graphical user interface testing tools and human performance modeling to enable usability assessment
US20160140024A1 (en) * 2014-11-18 2016-05-19 Semiconductor Manufacturing International (Shanghai) Corporation Method and device for testing semiconductor manufacturing equipment automation program
CN107577599A (en) * 2017-08-21 2018-01-12 同程网络科技股份有限公司 A kind of automatic interface testing method and platform based on custom script
CN110096434A (en) * 2019-03-28 2019-08-06 咪咕文化科技有限公司 Interface testing method and device
CN111176976A (en) * 2019-08-05 2020-05-19 腾讯科技(深圳)有限公司 Test data generation method and device, storage medium and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256375A (en) * 2020-10-22 2021-01-22 深圳市元征科技股份有限公司 Vehicle information interaction method, device, equipment and medium
CN112926290A (en) * 2021-03-09 2021-06-08 上海万向区块链股份公司 System, method and medium for generating presentation interface document
CN114785769A (en) * 2022-03-31 2022-07-22 北京达佳互联信息技术有限公司 File processing method, device, equipment and storage medium
CN114785769B (en) * 2022-03-31 2024-03-19 北京达佳互联信息技术有限公司 File processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111782117B (en) 2021-11-09

Similar Documents

Publication Publication Date Title
CN110764753B (en) Business logic code generation method, device, equipment and storage medium
CN111782117B (en) Interface display method and device, storage medium and electronic device
US7721252B2 (en) Apparatus and method for product-line architecture description and verification
CN113900958A (en) Test case script generation method, system, medium and electronic device
CN112506759B (en) Automatic test method and device for servo system control software and storage medium
CN111190596A (en) Joint debugging method and device, computer equipment and readable storage medium
CN113312260B (en) Interface test method, device, equipment and storage medium
CN107451112B (en) Form tool data checking method, device, terminal equipment and storage medium
CN111694561A (en) Interface management method, device, equipment and storage medium
CN104111852A (en) Web application automated testing system and testing method based on data drive
CN111061696A (en) Method and device for analyzing transaction message log
CN111966587A (en) Data acquisition method, device and equipment
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN117632710A (en) Method, device, equipment and storage medium for generating test code
CN111078529B (en) Client writing module testing method and device and electronic equipment
CN111506594A (en) Big data query platform, management method thereof and data query method
CN113238940B (en) Interface test result comparison method, device, equipment and storage medium
CN110019177A (en) The method and apparatus of rule storage
CN111651696A (en) Product label customizing method and device, computer storage medium and electronic equipment
CN117573140B (en) Method, system and device for generating document by scanning codes
CN113703769B (en) CLI command execution method and related device
CN113419739B (en) Node map difference detection method and device, electronic equipment and storage medium
JP5683209B2 (en) Client computer with automatic document generation function
CN112130841B (en) SQL development method and device and terminal equipment
US20240176728A1 (en) Plug and play language acceptance testing

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.