CN110618941B - Interface element processing method and device - Google Patents

Interface element processing method and device Download PDF

Info

Publication number
CN110618941B
CN110618941B CN201910887925.5A CN201910887925A CN110618941B CN 110618941 B CN110618941 B CN 110618941B CN 201910887925 A CN201910887925 A CN 201910887925A CN 110618941 B CN110618941 B CN 110618941B
Authority
CN
China
Prior art keywords
interface element
test case
case template
interface
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910887925.5A
Other languages
Chinese (zh)
Other versions
CN110618941A (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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201910887925.5A priority Critical patent/CN110618941B/en
Publication of CN110618941A publication Critical patent/CN110618941A/en
Application granted granted Critical
Publication of CN110618941B publication Critical patent/CN110618941B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Abstract

The invention provides an interface element processing method and device, and a preset test case template is obtained, wherein the preset test case template is a collection of interface element types and test cases of test points corresponding to the interface element types, the first interface element type in a page is selected based on the first interface element type in the page provided by a web application system, the attribute value of the selected first interface element type is set, a second interface element type with a corresponding attribute value is obtained, the second interface element type with the corresponding attribute value is sent to the preset test case template through the web application system based on a preset data processing rule, and finally the test cases are generated. The method and the device realize automatic generation of the test cases of all the test points in the interface elements, and solve the problem that the accuracy of the test cases is influenced by the fact that test points are omitted or wrong test cases are compiled due to fatigue of workers compiling the test cases in the compiling process.

Description

Interface element processing method and device
Technical Field
The invention belongs to the technical field of computer software testing, and particularly relates to an interface element processing method and device.
Background
With the progress of science and technology, whether a product is qualified or not is checked, the product is tested, and test cases about the product are compiled. In computer software testing, interface class scene testing is involved, the testing needs a writer to write a test case of an interface element in an interface, and because the interface element comprises a plurality of test points, the writer needs to write corresponding test cases for all the test points in each interface element to complete the testing of the interface element.
However, once the interface is large, the writer needs to spend a lot of time and energy to write the test case of each element, which causes waste of human resources, and causes fatigue of the writer to miss the test points or write wrong test cases, thereby affecting the accuracy of the test cases.
Disclosure of Invention
In view of this, the present invention provides a method and a device for processing an interface element, which are used to automatically generate a test case of the interface element. The technical scheme is as follows:
the invention provides an interface element processing method, which comprises the following steps:
obtaining a preset test case template, wherein the preset test case template is a collection of interface elements and test cases of test points corresponding to the interface elements;
selecting a first interface element in a page based on the first interface element in the page provided by a web application system, and setting an attribute value of the selected first interface element to obtain a second interface element with a corresponding attribute value, wherein the first interface element comprises X interface elements, and X is a positive integer greater than or equal to 1;
and based on a preset data processing rule, sending the second interface element with the corresponding attribute value to the preset test case template through the web application system to generate a test case.
Preferably, the sending the second interface element with the corresponding attribute value to the preset test case template based on a preset data processing rule to generate a test case includes:
acquiring a test case corresponding to a third interface element of the same type as the second interface element in the preset test case template based on the second interface element input in the preset test case template;
replacing the attribute value of the second interface element input into the preset test case template with the parameter value of a corresponding third interface element in the preset test case template, so that the third interface element with the attribute value is used as the second interface element;
and filling the basic information corresponding to the test case into the corresponding column of the test case, thereby forming the test case with complete second interface elements.
Preferably, the obtaining of the test case corresponding to a third interface element of the preset test case template, which is of the same type as the second interface element, based on the input of the second interface element in the preset test case template includes:
judging whether a third interface element of the same type as the second interface element input into the preset test case template exists in the preset test case template or not based on the second interface element input into the preset test case template;
if a third interface element with the same type as the second interface element input into the preset test case template does not exist in the preset test case template, not acquiring the test case;
and if a third interface element with the same type as the second interface element input into the preset test case template exists in the preset test case template, acquiring a test case corresponding to the third interface element with the same type as the second interface element in the preset test case template.
Preferably, the basic information includes: and guiding the information input by the user and the information of the test task in the web application system.
Preferably, the obtaining of the preset test case template includes:
obtaining N interface elements, wherein N is a positive integer greater than or equal to 1;
analyzing the test point of each interface element in the N interface elements;
writing a corresponding test case aiming at the test point corresponding to each interface element;
and compiling a corresponding set of test cases based on the test points corresponding to the interface elements to obtain the preset test case template.
The present invention also provides an interface element processing apparatus, comprising:
the device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining a preset test case template, and the preset test case template is a collection of interface elements and test cases of test points corresponding to the interface elements;
the second obtaining module is used for selecting a first interface element in a page based on the first interface element in the page provided by the web application system, setting an attribute value of the selected first interface element and obtaining a second interface element with a corresponding attribute value;
and the generating module is used for sending the second interface element with the corresponding attribute value to the preset test case template through the web application system based on a preset data processing rule to generate a test case.
Preferably, the generating module includes:
the first obtaining unit is used for obtaining a test case corresponding to a third interface element, which is in the same type as the second interface element, in the preset test case template based on the second interface element input in the preset test case template;
the replacing unit is used for replacing the attribute value of the second interface element input into the preset test case template with the parameter value of a corresponding third interface element in the preset test case template, so that the third interface element with the attribute value is used as the second interface element;
and the composition unit is used for filling the basic information corresponding to the test case into the corresponding column of the test case so as to compose the complete test case of the second interface element.
Preferably, the first obtaining unit includes:
a judging subunit, configured to judge, based on the second interface element input into the preset test case template, whether a third interface element of the same type as the second interface element input into the preset test case template exists in the preset test case template; if a third interface element with the same type as the second interface element input into the preset test case template does not exist in the preset test case template, not acquiring the test case; and if a third interface element with the same type as the second interface element input into the preset test case template exists in the preset test case template, obtaining a test case corresponding to the third interface element with the same type as the second interface element in the preset test case template.
Preferably, the basic information includes: and guiding the information input by the user and the information of the test task in the web application system.
Preferably, the first obtaining module includes: the second acquisition unit is used for acquiring N interface elements;
the analysis unit is used for analyzing the test point of each interface element in the N interface elements;
the compiling unit is used for compiling corresponding test cases aiming at the test points corresponding to the interface elements;
and the obtaining unit is used for compiling a corresponding set of test cases based on the test points corresponding to the interface elements to obtain the preset test case template.
Compared with the prior art, the technical scheme provided by the invention has the following advantages:
the method comprises the steps of obtaining a preset test case template, wherein the preset test case template is a collection of interface element types and test cases of test points corresponding to the interface element types, then selecting the first interface element types in a page based on the first interface element types in the page provided by a web application system, setting attribute values of the selected first interface element types, obtaining second interface element types with corresponding attribute values, sending the second interface element types with the corresponding attribute values to the preset test case template through the web application system based on preset data processing rules, and finally generating the test cases.
According to the scheme, the test cases of all test points in the interface elements are automatically generated, and the problem that the accuracy of the test cases is influenced due to the fact that test points are missed or wrong test cases are compiled by workers compiling the test cases in the compiling process is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of an interface element processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart of generating a test case according to an embodiment of the present invention;
FIG. 3 is a flow chart of another example for generating test cases according to an embodiment of the present invention;
FIG. 4 is a flowchart of obtaining a test case according to an embodiment of the present invention;
fig. 5 is a flowchart of obtaining a preset test case template according to an embodiment of the present invention;
fig. 6 is a structural diagram of an interface element processing apparatus according to an embodiment of the present invention.
Detailed Description
The invention provides an interface element processing method and device, which achieve the purpose of automatically generating test cases of all test points in interface elements and solve the problem that the accuracy of the test cases is influenced by the fact that test points are omitted or wrong test cases are compiled due to fatigue of workers compiling the test cases in the compiling process.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
As shown in fig. 1, a flowchart of an interface element processing method according to an embodiment of the present invention is provided, where the method includes the following steps:
and S101, obtaining a preset test case template.
In the process of executing S101, a template of a preset test case needs to be obtained first, where the preset test case template is a set of interface elements and test cases of test points corresponding to the interface elements. The term in the present embodiment is explained here, and the test case: a set of test inputs, execution conditions, and expected results tailored for a particular purpose to test a certain program path or verify that a certain specific requirement is met; testing points: after the function of the object to be tested is decomposed, the test key points of the described minimum granularity are explained; interface elements: for example, the control for showing or interacting with the user on the web page or the application system interface may include but is not limited to: a tablet frame, a drop-down frame, single-selection and multi-selection buttons.
It should be noted that, in the embodiment of the present invention, the preset test case template is a template of a preset test case in an Excel format, and may also be a template of a preset test case in another format, for example: XML format and Json format.
S102, selecting the first interface element in the page based on the first interface element in the page provided by the web application system, and setting the attribute value of the selected first interface element to obtain a second interface element with a corresponding attribute value.
In the process of executing S102, the first interface element includes multiple types of interface elements in a page provided by the web application system, and in the first interface element in the page provided by the web application system, a writer who writes a test case can freely select an interface element to be processed in the first interface element, for example: the first interface elements included in the page provided by the web application system are: the interface element selection method comprises the steps that a writer selects a text box from the interface elements, then the writer can continue to select the drop-down box, the single-selection button and the multi-selection button, and it needs to be noted that the first interface element has other interface elements besides the text box, the drop-down box, the single-selection button and the multi-selection button in the examples, and the interface elements are not listed here any more, and the selection of the first interface element can be completely selected according to the will of the writer, so that the interface element processing is more flexible. For an interface element that has been selected, firstly, setting an attribute value of the interface element is performed, that is, configuring an attribute value of the selected interface element, for example: for a selected text box, the name of the text box may be configured to be 1. The first interface element with the configured attribute value can be called a second interface element, so as to distinguish the interface element before the configured attribute value from the interface element after the configured attribute value.
It should be noted that, the configuration of the attribute values of the interface elements is designed as a plurality of web page interaction processes. According to the structural relationship of the interface products, a certain interface element exists according to a certain interface, and the interface comprises a plurality of interface elements of different types and different quantities. Therefore, the configuration of the global attribute value needs to be performed on the whole interface, some common attributes are specifically configured, and all interface elements needing to use these common attributes are applicable to the page, where the common attributes may include but are not limited to: interface name, transaction code name (when inputting the preset test case template, some places, such as "operation step", need to use the public attribute). And then, configuring attribute values of each specific interface element in the interface.
And S103, sending the second interface element with the corresponding attribute value to a preset test case template through the web application system based on a preset data processing rule to generate a test case.
In the process of executing S103, the attribute value of the selected first interface element is configured to become a second interface element, and then the second interface element is sent to the preset test case template through the web application system, so as to complete the generation of the test case.
According to the technical scheme, a writer writing a test case freely selects an interface element to be processed in a page provided by a web application system, then configures an attribute value of the selected interface element, sends the interface element with the configured attribute value to a template of a preset test case through the web application system, and finally generates the test case needing to write the corresponding interface element. The method and the device realize automatic generation of the test cases of all the test points in the interface elements, and solve the problem that the accuracy of the test cases is influenced by the fact that test points are omitted or wrong test cases are compiled due to fatigue of workers compiling the test cases in the compiling process.
Based on the step S103 disclosed in fig. 1 in the above embodiment of the present invention, as shown in fig. 2, a flowchart for specifically generating a test case provided in the embodiment of the present invention mainly includes:
s201, acquiring a test case corresponding to a third interface element of the same type as the second interface element in the preset test case template based on the second interface element in the input preset test case template.
In the process of executing S201, inputting the second interface element into the preset test case template through the web application system, and then obtaining a test case corresponding to a third interface element in the preset test case template, where the type of the third interface element is the same as that of the second interface element, it should be noted here that, in the interface elements, if the types of the interface elements are the same, the test points of the interface elements of the same type are the same, so that the written test cases are the same. Here, the interface element text box is exemplified: the two interface elements are of the same type and are text boxes, so that the test points are all whether the input item is necessary, the input length range, whether the input is allowed or not, the character type of the input is allowed, and the like. Therefore, the test cases generated by the test points of the same type of interface elements are all uniform, and the difference is that the attribute values of the interface elements are different, for example: although both interface elements are text boxes, the names of the two interface elements are different, namely the names of the text boxes are different, the types of characters allowed to be input are different, and the like.
It should be noted that, the test points are the same except that the attribute values of the interface elements of the same type are different.
S202, replacing the attribute value of the second interface element input into the preset test case template with the parameter value of the corresponding third interface element in the preset test case template, and enabling the third interface element with the attribute value to serve as the second interface element.
And in the process of executing S202, replacing the attribute value of the second interface element input into the preset test case template with the parameter value of the corresponding third interface element in the preset test case template. That is to say, inputting a second interface element with a configured attribute value into a preset test case template, and then replacing the attribute value of an interface element of the same type according to that the second interface element is the same as a third interface element in the preset test case template, that is, the same interface element is of the same type, for example: the attribute value of the second interface element replaces the parameter value of a third interface element of the same type. Because the test points of the same type are the same, the written test cases are also the same, the only difference is the difference of the attribute values, the problem of the difference of the attribute values is solved by utilizing the attribute value replacement mode, and the third interface element with the attribute value of the second interface element is used as the second interface element through the embodiment of the invention.
It should be noted that test points of test cases corresponding to the same type of interface elements are often the same, and only the specific attribute values are different, and as long as the attribute values are replaced, one interface element can be used as another interface element under the condition of the same type of interface elements.
And S203, filling the basic information corresponding to the test case into the corresponding column of the test case so as to form the test case with complete second interface elements.
In the process of executing S203, basic information corresponding to the test case also needs to be filled into a corresponding column of the test case, where the basic information corresponding to the test case refers to: the basic information can provide basic information such as testers, product names and the like, which can guide a user to input information related to a test task through a web page. By filling the basic information of the test cases, the writers can correspond to the test cases one by one, and the integrity of the test case information is ensured. Through the technical scheme, the test case with the complete second interface element is formed, namely the test case with the second interface element is generated.
It should be noted that the basic information is collected by the collection module.
In order to better understand the embodiment, as shown in fig. 3, another flowchart for generating a test case is provided for the embodiment of the present invention, and the technical solution in the present invention can be more clearly understood through fig. 3 and the description in combination with the above embodiment.
According to the technical scheme, the second interface element is input into the preset test case template, then the test case corresponding to the third interface element of the same type is obtained, the parameter value of the third interface element is replaced by the attribute value of the second interface element, the obtained test case is filled with basic information, and finally the complete test case is obtained. By automatically generating the test cases, the compiling efficiency of compiling the test cases is integrally improved, and meanwhile, the accuracy of the test cases is also improved.
Based on the above-mentioned embodiment of the present invention, as shown in fig. 4, the method for obtaining a test case corresponding to a third interface element in a preset test case template, which is of the same type as the second interface element, based on inputting the second interface element in the preset test case template disclosed in fig. 2, includes the following steps:
s401, judging whether a third interface element with the same type as the second interface element input into the preset test case template exists in the preset test case template or not based on the second interface element input into the preset test case template.
In the process of executing S401, based on inputting the second interface element in the preset test case template, it is first determined whether a third interface element that is the same as the second interface element exists in the test case template. So as to obtain the test case corresponding to the second interface element.
It should be noted that the basis for the judgment is mainly to see whether the interface elements are of the same type.
S402, if a third interface element with the same type as the second interface element input into the preset test case template does not exist in the preset test case template, the test case is not obtained.
In the process of executing S402, if a third interface element of the same type as the second interface element does not exist in the preset test case template, the test case is not obtained, and only if an interface element of the same type as the second interface element exists in the preset test case template, the test case corresponding to the corresponding interface element of the same type can be obtained.
It should be noted that the test cases and the corresponding interface elements in the preset test case template are not fixed, and the test cases and the corresponding interface elements in the preset test case template may be added or deleted.
S403, if a third interface element with the same type as the second interface element in the input preset test case template exists in the preset test case template, obtaining a test case corresponding to the third interface element with the same type as the second interface element in the preset test case template.
In the process of executing S403, if a third interface element of the same type as the second interface element exists in the preset test case template, a test case corresponding to the third interface element of the same type as the second interface element in the preset test case template is obtained.
It should be noted that, after the corresponding test case is obtained, the attribute value may be replaced.
According to the technical scheme, the third interface element with the same type as the second interface element is judged, the corresponding test case is obtained, and guarantee is provided for replacing the attribute value and filling the basic information.
Based on the preset test case template obtained in the embodiment disclosed in fig. 1, as shown in fig. 5, a flowchart for specifically obtaining the preset test case template provided in the embodiment of the present invention mainly includes:
s501, N interface elements are obtained.
In the process of executing S501, first, N interface elements are obtained, and the writer can obtain the interface element that is desired to be processed according to actual needs.
N is a positive integer greater than 1 or equal to 1.
And S502, analyzing the test point of each interface element in the N interface elements.
In the process of executing S502, the writer writing the test case analyzes the test points of the interface element to find out the test points of the interface element, so as to write the corresponding test case for the test points of the interface element.
It should be noted that there are multiple test points for each interface element, and different types of interface elements have different corresponding test points.
S503, writing a corresponding test case aiming at the test point corresponding to each interface element.
In the process of executing S503, writing a corresponding test case for the test point corresponding to each interface element, so as to sort the written test cases.
It should be noted that the contents of the test cases written at different test points are different.
S504, compiling a corresponding test case set based on the test points corresponding to the interface elements to obtain a preset test case template.
In the process of executing S504, the test cases compiled from the test points corresponding to each interface element are arranged into a set, and the set is used as a preset test case template.
It should be noted that the preset test case template is in an Excel form.
According to the technical scheme, the preset test case template is obtained as a key step in the scheme, and important guarantee is provided for automatically obtaining the test cases of the test points corresponding to other interface elements.
Based on the interface element processing method disclosed by the present invention, an interface element processing apparatus corresponding to the method is also disclosed in the embodiment of the present invention, as shown in fig. 6, which is a structural diagram of an interface element processing apparatus provided by the embodiment of the present invention, and mainly includes: a first obtaining module 10, a second obtaining module 11 and a generating module 12.
The first obtaining module 10 is configured to obtain a preset test case template, where the preset test case template is a set of interface elements and test cases of test points corresponding to the interface elements. For the explanation of the terms such as test case, test point and interface element, please refer to the related method embodiment, which will not be further described here.
The second obtaining module 11 is configured to select a first interface element in a page based on the first interface element in the page provided by the web application system, set an attribute value of the selected first interface element, and obtain a second interface element with a corresponding attribute value. The first interface element includes multiple types of interface elements in a page provided by a web application system, and in the first interface element in the page provided by the web application system, a writer who writes a test case can freely select an interface element which needs to be processed from the first interface element. For the selected interface element, firstly, the attribute value of the interface element is set, that is, the attribute value of the selected interface element is configured, and for a specific description, reference is made to the related method embodiment, and a description is not provided here.
And the generating module 12 is configured to send the second interface element with the corresponding attribute value to a preset test case template through a web application system based on a preset data processing rule, so as to generate a test case.
According to the technical scheme, a writer for writing the test case freely selects the interface element to be processed in the page provided by the web application system, then configures the attribute value of the selected interface element, sends the interface element with the configured attribute value to a preset test case template through the web application system, and finally generates the test case which needs to write the corresponding interface element. The method and the device realize automatic generation of the test cases of all the test points in the interface elements, and solve the problem that the accuracy of the test cases is influenced by the fact that test points are omitted or wrong test cases are compiled due to fatigue of workers compiling the test cases in the compiling process.
An optional structure of the generating module 12 in the embodiment of the present invention is: the generation module 12 includes a first acquisition unit, a replacement unit, and a composition unit.
And the first obtaining unit is used for obtaining a test case corresponding to a third interface element which is in the same type as the second interface element in the preset test case template based on the second interface element input in the preset test case template.
And the replacing unit is used for replacing the attribute value of the second interface element input into the preset test case template with the parameter value of the corresponding third interface element in the preset test case template, so that the third interface element with the attribute value is used as the second interface element.
And the composition unit is used for filling the basic information corresponding to the test case into the corresponding column of the test case so as to compose the test case with complete second interface elements.
The specific first acquiring unit may include: and judging the subunit.
The judging subunit is used for judging whether a third interface element of the same type as the second interface element input into the preset test case template exists in the preset test case template or not based on the second interface element input into the preset test case template; if a third interface element with the same type as the second interface element input into the preset test case template does not exist in the preset test case template, the test case is not acquired; and if a third interface element with the same type as the second interface element input into the preset test case template exists in the preset test case template, obtaining a test case corresponding to the third interface element with the same type as the second interface element in the preset test case template.
According to the technical scheme, the second interface element is input into the preset test case template, then the test case corresponding to the third interface element of the same type is obtained, the parameter value of the third interface element is replaced by the attribute value of the second interface element, the obtained test case is filled with basic information, and finally the complete test case is obtained. By automatically generating the test cases, the compiling efficiency of compiling the test cases is integrally improved, and meanwhile, the accuracy of the test cases is also improved.
An alternative structure of the first obtaining module 10 in the embodiment of the present invention is: the first obtaining module 10 includes a second obtaining unit, an analyzing unit, a compiling unit, and an obtaining unit.
And the second acquisition unit is used for acquiring the N interface elements.
And the analysis unit is used for analyzing the test point of each interface element in the N interface elements.
And the compiling unit is used for compiling corresponding test cases aiming at the test points corresponding to the interface elements.
And the obtaining unit is used for compiling a corresponding test case set based on the test points corresponding to the interface elements to obtain a preset test case template.
According to the technical scheme, the preset test case template is obtained, which is one of the key steps in the scheme, and important guarantee is provided for automatically obtaining the test cases of the test points corresponding to other interface elements.
It should be noted that, in this specification, each embodiment is described in a progressive manner, and each embodiment focuses on differences from other embodiments, and portions that are the same as and similar to each other in each embodiment may be referred to. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and reference may be made to the partial description of the method embodiment for relevant points.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (8)

1. An interface element processing method, characterized in that the method comprises:
obtaining a preset test case template, wherein the preset test case template is a collection of interface elements and test cases of test points corresponding to the interface elements;
selecting a first interface element in a page based on the first interface element in the page provided by a web application system, and setting an attribute value of the selected first interface element to obtain a second interface element with a corresponding attribute value, wherein the first interface element comprises X interface elements, and X is a positive integer greater than or equal to 1;
acquiring a test case corresponding to a third interface element of the same type as the second interface element in the preset test case template based on the second interface element input in the preset test case template;
replacing the attribute value of the second interface element input into the preset test case template with the parameter value of a corresponding third interface element in the test case template, so that the third interface element with the attribute value is used as the second interface element;
and filling the basic information corresponding to the test case into the corresponding column of the test case, thereby forming the test case with complete second interface elements.
2. The method according to claim 1, wherein the obtaining of the test case corresponding to a third interface element of the preset test case template, which is of the same type as the second interface element, based on the input of the second interface element in the preset test case template comprises:
judging whether a third interface element with the same type as the second interface element input into the preset test case template exists in the test case template or not based on the second interface element input into the preset test case template;
if a third interface element with the same type as the second interface element input into the preset test case template does not exist in the preset test case template, not acquiring the test case;
and if a third interface element with the same type as the second interface element input into the preset test case template exists in the preset test case template, acquiring a test case corresponding to the third interface element with the same type as the second interface element in the preset test case template.
3. The method of claim 1, wherein the basic information comprises: and guiding the information input by the user and the information of the test task in the web application system.
4. The method according to claim 1, wherein the obtaining of the preset test case template comprises:
obtaining N interface elements, wherein N is a positive integer greater than or equal to 1;
analyzing the test point of each interface element in the N interface elements;
compiling corresponding test cases for the test points corresponding to the interface elements;
and compiling a corresponding set of test cases based on the test points corresponding to the interface elements to obtain the preset test case template.
5. An interface element processing apparatus, the apparatus comprising:
the device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining a preset test case template, and the preset test case template is a set of interface elements and test cases of test points corresponding to the interface elements;
the second obtaining module is used for selecting a first interface element in a page based on the first interface element in the page provided by the web application system, setting an attribute value of the selected first interface element and obtaining a second interface element with a corresponding attribute value;
the generation module comprises a first acquisition unit, a replacement unit and a composition unit;
the first obtaining unit is configured to obtain, based on the second interface element input into the preset test case template, a test case corresponding to a third interface element in the preset test case template, where the type of the third interface element is the same as that of the second interface element;
the replacing unit is used for replacing the attribute value of the second interface element input into the preset test case template with the parameter value of a corresponding third interface element in the preset test case template, so that the third interface element with the attribute value is used as the second interface element;
and the composition unit is used for filling the basic information corresponding to the test case into the corresponding column of the test case, so as to compose the test case with complete second interface elements.
6. The apparatus of claim 5, wherein the first obtaining unit comprises:
a judging subunit, configured to judge, based on the second interface element input into the preset test case template, whether a third interface element of the same type as the second interface element input into the preset test case template exists in the preset test case template; if a third interface element of the same type as the second interface element input into the preset test case template does not exist in the preset test case template, not acquiring the test case; and if a third interface element with the same type as the second interface element input into the preset test case template exists in the preset test case template, acquiring a test case corresponding to the third interface element with the same type as the second interface element in the preset test case template.
7. The apparatus of claim 5, wherein the basic information comprises: and guiding the information input by the user and the information of the test task in the web application system.
8. The apparatus of claim 5, wherein the first obtaining module comprises: the second acquisition unit is used for acquiring N interface elements;
the analysis unit is used for analyzing the test point of each interface element in the N interface elements;
the compiling unit is used for compiling corresponding test cases aiming at the test points corresponding to the interface elements;
and the obtaining unit is used for compiling a corresponding set of test cases based on the test points corresponding to the interface elements to obtain the preset test case template.
CN201910887925.5A 2019-09-19 2019-09-19 Interface element processing method and device Active CN110618941B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910887925.5A CN110618941B (en) 2019-09-19 2019-09-19 Interface element processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910887925.5A CN110618941B (en) 2019-09-19 2019-09-19 Interface element processing method and device

Publications (2)

Publication Number Publication Date
CN110618941A CN110618941A (en) 2019-12-27
CN110618941B true CN110618941B (en) 2023-01-20

Family

ID=68923620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910887925.5A Active CN110618941B (en) 2019-09-19 2019-09-19 Interface element processing method and device

Country Status (1)

Country Link
CN (1) CN110618941B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416746A (en) * 2020-01-21 2021-02-26 上海哔哩哔哩科技有限公司 Test case generation method, device, equipment and medium
CN113032275A (en) * 2021-04-08 2021-06-25 平安国际智慧城市科技股份有限公司 Method and device for testing field, electronic equipment and storage medium
CN114780091A (en) * 2022-04-08 2022-07-22 安天科技集团股份有限公司 Page code generation method and device, computing equipment and storage medium
CN117112400A (en) * 2023-07-24 2023-11-24 东方通创新科技(重庆)有限公司 Automatic test case generation platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608007A (en) * 2015-12-28 2016-05-25 北京致远协创软件有限公司 Page model as well as user interface automated test method and device
CN107122295A (en) * 2017-03-30 2017-09-01 腾讯科技(深圳)有限公司 The generation method and device of test case script
CN109992496A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of data processing method and device for automatic test

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8954933B2 (en) * 2011-05-31 2015-02-10 International Business Machines Corporation Interactive semi-automatic test case maintenance
US9424167B2 (en) * 2014-05-21 2016-08-23 Cgi Technologies And Solutions Inc. Automated testing of an application system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608007A (en) * 2015-12-28 2016-05-25 北京致远协创软件有限公司 Page model as well as user interface automated test method and device
CN107122295A (en) * 2017-03-30 2017-09-01 腾讯科技(深圳)有限公司 The generation method and device of test case script
CN109992496A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of data processing method and device for automatic test

Also Published As

Publication number Publication date
CN110618941A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
CN110618941B (en) Interface element processing method and device
JP7398068B2 (en) software testing
Larrea Black-box testing technique for information visualization. Sequencing constraints with low-level interactions
Maguire Using human factors standards to support user experience and agile design
CN104391786B (en) Webpage automatization test system and its method
CN104657274B (en) software interface test method and device
CN107943466B (en) Database access statement generation method, device and equipment
JP2008191963A (en) Source code verification system, source code verification method and source code verification program
CN106325596A (en) Automatic error correction method and system for writing handwriting
US9678856B2 (en) Annotated test interfaces
Torunski et al. Code style analytics for the automatic setting of formatting rules in ides: A solution to the tabs vs. spaces debate
CN111427760A (en) Page testing method, device, equipment and storage medium
De Boeck et al. High-level modeling of multimodal interaction techniques using nimmit
Strüber et al. Clone detection for graph-based model transformation languages
JP5787404B2 (en) Apparatus and program for generating test specifications for a computer program
Rocha Silva et al. Ensuring the consistency between user requirements and GUI prototypes: A behavior-based automated approach
JP2007304846A (en) Specification creation support method and specification creation support apparatus
JP2009230420A (en) Source code quality management device
CN115809058A (en) Method and related device for generating user interface framework logic tree
US10007493B1 (en) Event based validation
CN113326193A (en) Applet testing method and device
JP2013145443A (en) Test code generation device, test code generation method and test code generation program
Krämer et al. Using runtime traces to improve documentation and unit test authoring for dynamic languages
US20230080572A1 (en) System and method to engineer user experience
JP2015133031A (en) Program analyzer and program analysis method

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