CN110413519A - Template processing method and processing device - Google Patents

Template processing method and processing device Download PDF

Info

Publication number
CN110413519A
CN110413519A CN201910656902.3A CN201910656902A CN110413519A CN 110413519 A CN110413519 A CN 110413519A CN 201910656902 A CN201910656902 A CN 201910656902A CN 110413519 A CN110413519 A CN 110413519A
Authority
CN
China
Prior art keywords
filled
field
value
interface model
mock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910656902.3A
Other languages
Chinese (zh)
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.)
WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd
Original Assignee
WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd filed Critical WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd
Priority to CN201910656902.3A priority Critical patent/CN110413519A/en
Publication of CN110413519A publication Critical patent/CN110413519A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The present invention relates to template processing method and processing devices.This method comprises: the Mock interface model that traversal receives;Determine the field to be filled in the Mock interface model;Analog value is inputted to the field to be filled.Manual operation can be reduced according to the technical solution of the present invention, improves the input efficiency of Mock interface model, and is avoided user from artificially determining the field to be filled in Mock interface model and artificially inputted analog value.

Description

Template processing method and processing device
Technical field
The present invention relates to field of terminal technology more particularly to template processing method and processing devices.
Background technique
Currently, using Mock interface model to survey Mock interface if necessary for interface Mock platform The operation such as examination, usually first fills in the value of the field on Mock interface model, and is filling in these fields in the prior art Value when need the attribute (such as field characterization is price or weight) of the type for artificially confirming these fields and field, Then corresponding value is artificially filled in, and this operation is very cumbersome, needs to fill in a value at random particularly with unimportant Field, the treatment effeciency of Mock interface model seems especially low.
Summary of the invention
The embodiment of the invention provides template processing method and processing devices.The technical solution is as follows:
According to a first aspect of the embodiments of the present invention, a kind of template processing method is provided, comprising:
Traverse the Mock interface model received;
Determine the field to be filled in the Mock interface model;
Analog value is inputted to the field to be filled.
In one embodiment, the field to be filled in the determination Mock interface model, comprising:
Automatically determine the character types of the field to be filled in the Mock interface model.
In one embodiment, analog value is inputted to the field to be filled, comprising:
According to the character types of the field to be filled, it is consistent to the field input to be filled with the character types Analog value.
In one embodiment, analog value is inputted to the field to be filled, comprising:
Determine the corresponding selectable value of the field to be filled;
A value is randomly choosed from the selectable value is used as random value;
Based on the field to be filled, the random value is inputted.
In one embodiment, the method also includes:
After inputting random value to the field to be filled, the Mock interface model that will be filled with the analog value is defeated Out.
According to a second aspect of the embodiments of the present invention, a kind of template processing unit is provided, comprising:
Spider module, for traversing the Mock interface model received;
Determining module, for determining the field to be filled in the Mock interface model;
Input module, for inputting analog value to the field to be filled.
In one embodiment, the determining module includes:
First determines submodule, for automatically determining the character types of the field to be filled in the Mock interface model.
In one embodiment, the input module includes:
First input submodule is inputted for the character types according to the field to be filled to the field to be filled The analog value being consistent with the character types.
In one embodiment, the input module includes:
Second determines submodule, for determining the corresponding selectable value of the field to be filled;
Submodule is selected, is used as random value for randomly choosing a value from the selectable value;
Second input submodule inputs the random value for being based on the field to be filled.
In one embodiment, described device further include:
Output module, for will be filled with the analog value after inputting random value to the field to be filled The output of Mock interface model.
The technical solution that the embodiment of the present invention provides can include the following benefits:
When receiving Mock interface model, by traversing the Mock interface model received, Mock can be automatically determined and connect Then field to be filled in mouth template automatically inputs analog value to field to be filled, to reduce manual operation, improve The input efficiency of Mock template, and avoid user from artificially determining the field to be filled in Mock interface model and artificially input phase It should be worth.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of flow chart of template processing method shown according to an exemplary embodiment.
Fig. 2 is the flow chart of another template processing method shown according to an exemplary embodiment.
Fig. 3 is a kind of block diagram of template processing unit shown according to an exemplary embodiment.
Fig. 4 is the block diagram of another template processing unit shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
In order to solve the above-mentioned technical problem, the embodiment of the invention provides a kind of template processing method, this method can be used for Information processing determines in program, system or device, and the corresponding executing subject of this method can be server, as shown in Figure 1, should Method includes step S101 to step S103:
In step s101, the Mock interface model received is traversed;
Wherein Mock interface model can be used for carrying out Mock test, and mock test is exactly during the test, to Mr. Yu It is not easy the object for constructing or being not easy to obtain a bit, creates the test method so as to test with a virtual object.
In step s 102, the field to be filled in the Mock interface model is determined;
In step s 103, analog value is inputted to the field to be filled.
When receiving Mock interface model, by traversing the Mock interface model received, Mock can be automatically determined and connect Then field to be filled in mouth template automatically inputs analog value to field to be filled, to reduce manual operation, improve The input efficiency of Mock template, and avoid user from artificially determining the field to be filled in Mock interface model and artificially input phase It should be worth.
The analog value can be random value, it may also be said to be the value etc. for meeting certain functional rule.
In one embodiment, the field to be filled in the determination Mock interface model, comprising:
Automatically determine the character types of the field to be filled in the Mock interface model.
When determining field to be filled, the character types even field to be filled of the field to be filled can be automatically determined Attribute information, if the field to be filled is for characterizing price, age, weight, color or other features, in order to sharp later Analog value is inputted with the character types and attribute information.
Character types can be character string, number, array, double etc., it might even be possible to be video, picture etc..
In one embodiment, analog value is inputted to the field to be filled, comprising:
According to the character types of the field to be filled, it is consistent to the field input to be filled with the character types Analog value.
When inputting analog value, the phase being consistent with the character types should be inputted according to the character types of the field to be filled It should be worth.Such as: when character types are character string, which also belongs to character string;When character types are number, the analog value Belong to number;When character types are array, which also belongs to array.
Certainly, if character types are picture, analog value is exactly the picture of the formats such as .gif .png .bmp, accordingly Ground, if character types are video, analog value is exactly video.
In one embodiment, analog value is inputted to the field to be filled, comprising:
Determine the corresponding selectable value of the field to be filled;
A value is randomly choosed from the selectable value is used as random value;
Based on the field to be filled, the random value is inputted.
What it is due to field to be filled default is all input random value, thus, when inputting analog value, it can first determine and set in advance Then at least one corresponding selectable value of the field to be filled set randomly selects a value as random from these selectable value Value, and the random value is automatically entered, to reduce artificial input operation, improve template treatment effeciency.
In one embodiment, the method also includes:
After inputting random value to the field to be filled, the Mock interface model that will be filled with the analog value is defeated Out.
After inputting random value to the field to be filled, the Mock interface model that will be filled with the analog value is defeated Out, it to continue other operations using the Mock interface model filled with analog value, is such as tested.
Technical solution of the present invention is further described below:
1. user input interface template (JSON (JavaScript Object Notation, JS object numbered musical notation) format)
2. the template of automatic traverse user input
The key of JSON (character segment type) is determined during traversal, obtains the corresponding value value of key Type fills certain types of random value according to type, such as: value corresponding to key is number, just inputs random number, Value is character string, just inputs character string, and value is Chinese, is returned to Chinese, value be Boolean type be returned to True or Person False is returned to timestamp if timestamp.
And all fields all can be substituted for dynamic data automatically according to rule as above.
Certainly, user can also change the field rule for only needing to modify according to their own needs, and remaining field is whole Using automatic dynamic rule.
Finally, it should be clear that: those skilled in the art can according to actual needs carry out above-mentioned multiple embodiments certainly By combining.
Corresponding above-mentioned template processing method provided in an embodiment of the present invention, the embodiment of the present invention also provide a kind of template processing Device, as shown in figure 3, the device includes:
Spider module 301, for traversing the Mock interface model received;
Determining module 302, for determining the field to be filled in the Mock interface model;
Input module 303, for inputting analog value to the field to be filled.
In one embodiment, the determining module includes:
First determines submodule, for automatically determining the character types of the field to be filled in the Mock interface model.
In one embodiment, the input module includes:
First input submodule is inputted for the character types according to the field to be filled to the field to be filled The analog value being consistent with the character types.
In one embodiment, the input module includes:
Second determines submodule, for determining the corresponding selectable value of the field to be filled;
Submodule is selected, is used as random value for randomly choosing a value from the selectable value;
Second input submodule inputs the random value for being based on the field to be filled.
As shown in figure 4, in one embodiment, described device further include:
Output module 401, for will be filled with the analog value after inputting random value to the field to be filled The output of Mock interface model.
Those skilled in the art will readily occur to of the invention its after considering specification and the invention invented here of practice Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or The common knowledge in the art that person's adaptive change follows general principle of the invention and do not invent including the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (10)

1. a kind of template processing method characterized by comprising
Traverse the Mock interface model received;
Determine the field to be filled in the Mock interface model;
Analog value is inputted to the field to be filled.
2. the method according to claim 1, wherein
Field to be filled in the determination Mock interface model, comprising:
Automatically determine the character types of the field to be filled in the Mock interface model.
3. according to the method described in claim 2, it is characterized in that,
Analog value is inputted to the field to be filled, comprising:
According to the character types of the field to be filled, it is consistent to the field input to be filled to the character types corresponding Value.
4. the method according to claim 1, wherein
Analog value is inputted to the field to be filled, comprising:
Determine the corresponding selectable value of the field to be filled;
A value is randomly choosed from the selectable value is used as random value;
Based on the field to be filled, the random value is inputted.
5. method according to claim 1 to 4, which is characterized in that the method also includes:
After inputting random value to the field to be filled, the Mock interface model output of the analog value will be filled with.
6. a kind of template processing unit characterized by comprising
Spider module, for traversing the Mock interface model received;
Determining module, for determining the field to be filled in the Mock interface model;
Input module, for inputting analog value to the field to be filled.
7. device according to claim 6, which is characterized in that
The determining module includes:
First determines submodule, for automatically determining the character types of the field to be filled in the Mock interface model.
8. device according to claim 7, which is characterized in that
The input module includes:
First input submodule, for the character types according to the field to be filled, to the field input to be filled and institute State the analog value that character types are consistent.
9. device according to claim 6, which is characterized in that
The input module includes:
Second determines submodule, for determining the corresponding selectable value of the field to be filled;
Submodule is selected, is used as random value for randomly choosing a value from the selectable value;
Second input submodule inputs the random value for being based on the field to be filled.
10. device according to any one of claims 6 to 9, which is characterized in that described device further include:
Output module, for after inputting random value to the field to be filled, the Mock that will be filled with the analog value to be connect Mouth template output.
CN201910656902.3A 2019-07-19 2019-07-19 Template processing method and processing device Pending CN110413519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910656902.3A CN110413519A (en) 2019-07-19 2019-07-19 Template processing method and processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910656902.3A CN110413519A (en) 2019-07-19 2019-07-19 Template processing method and processing device

Publications (1)

Publication Number Publication Date
CN110413519A true CN110413519A (en) 2019-11-05

Family

ID=68362112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910656902.3A Pending CN110413519A (en) 2019-07-19 2019-07-19 Template processing method and processing device

Country Status (1)

Country Link
CN (1) CN110413519A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181805A (en) * 2019-12-25 2020-05-19 航天信息股份有限公司 Micro-service test baffle generation method and system based on test case

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359149A (en) * 2018-10-08 2019-02-19 网宿科技股份有限公司 A kind of analog detection method and relevant apparatus

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359149A (en) * 2018-10-08 2019-02-19 网宿科技股份有限公司 A kind of analog detection method and relevant apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SRH啦: "04----mockjs的数据类型及语法规范", 《HTTPS://WWW.CNBLOGS.COM/SRH151219/P/10547299.HTML》 *
面条请不要欺负汉堡: "mockjs的常用方法", 《HTTPS://BLOG.CSDN.NET/GAO_XU_520/ARTICLE/DETAILS/79723613》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181805A (en) * 2019-12-25 2020-05-19 航天信息股份有限公司 Micro-service test baffle generation method and system based on test case
CN111181805B (en) * 2019-12-25 2022-04-29 航天信息股份有限公司 Micro-service test baffle generation method and system based on test case

Similar Documents

Publication Publication Date Title
CN107766940B (en) Method and apparatus for generating a model
CN103518393B (en) The system and method for detecting mobile communication equipment content
CN109508681A (en) The method and apparatus for generating human body critical point detection model
CN109472296A (en) A kind of model training method and device promoting decision tree based on gradient
CN111275784B (en) Method and device for generating image
US20180213077A1 (en) Method and apparatus for controlling smart device, and computer storage medium
CN105912500A (en) Machine learning model generation method and machine learning model generation device
CN109684188B (en) Test method and device
CN109408367A (en) A kind of method and terminal of the control element identifying interactive interface
CN109815448B (en) Slide generation method and device
CN114556413A (en) Interactive training of machine learning models for tissue segmentation
CN109359281A (en) Dynamic list generation method and device
CN109726119A (en) Test scene creation method, application method, device, client and server
CN110717555B (en) Picture generation system and device based on natural language and generation countermeasure network
CN110413519A (en) Template processing method and processing device
CN109726117A (en) A kind of Mock test method, device, server and electronic equipment
CN113780652A (en) Oil well indicator diagram fault diagnosis and prediction method and device
CN108921138A (en) Method and apparatus for generating information
CN107395692A (en) Terminal screen methods of exhibiting and device
CN108062401A (en) Using recommendation method, apparatus and storage medium
CN109672706A (en) A kind of information recommendation method, device, server and storage medium
CN105335430B (en) A kind of customer churn determining method of path and device based on map scene
CN110825472A (en) Chart color drawing method and device, readable storage medium and electronic equipment
CN110689285A (en) Test method, test device, electronic equipment and computer readable storage medium
CN106802856A (en) The performance test methods of game application, server and game application client

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191105

RJ01 Rejection of invention patent application after publication