CN115509932A - Interface test case generation method, device, equipment and medium - Google Patents

Interface test case generation method, device, equipment and medium Download PDF

Info

Publication number
CN115509932A
CN115509932A CN202211252349.5A CN202211252349A CN115509932A CN 115509932 A CN115509932 A CN 115509932A CN 202211252349 A CN202211252349 A CN 202211252349A CN 115509932 A CN115509932 A CN 115509932A
Authority
CN
China
Prior art keywords
interface
tested
test case
flow chart
generating
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
CN202211252349.5A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211252349.5A priority Critical patent/CN115509932A/en
Publication of CN115509932A publication Critical patent/CN115509932A/en
Pending legal-status Critical Current

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/3696Methods or tools to render software testable

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)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention discloses a method, a device, equipment and a medium for generating an interface test case. The method comprises the following steps: acquiring a normalized requirement template which is compiled in advance relative to an interface to be tested; analyzing the standardized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested; and generating an interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested. According to the method, a standardized demand template is provided for testers, a flow chart of the demand corresponding to the interface to be tested is generated according to the standardized demand template, the interface elements in the interface to be tested are automatically converted into corresponding coordinates, and the interface test case is automatically generated according to the flow chart and the interface element coordinate library, so that the process of manually clicking the interface to be tested to record is omitted, the generation efficiency of the interface test case is improved, and the problem of interface test case conflict caused by difference generated by manual recording is avoided.

Description

Interface test case generation method, device, equipment and medium
Technical Field
The invention relates to the field of computer testing, in particular to a method, a device, equipment and a medium for generating an interface test case.
Background
In the development process of a software system, in order to verify the stability and functionality of the system, system function tests are generally required to be performed on the developed software. A very important task in the system functional test process is to generate functional test cases, wherein the highest percentage of the functional test cases is the interface test case. The process of generating interface test cases is cumbersome and error prone.
In the prior art, automatic scripts are generally generated by a manual recording mode, and then are maintained and managed, and are executed by a machine before each production, so that regression testing is performed. In the process of automatic script generation, due to the reason of manual recording, the generation of manual difference is avoided, the same transaction is carried out by two different persons, and finally obtained scripts are slightly different. This situation causes some trouble in script maintenance, and the manual recording mode also causes a challenge to human power.
Disclosure of Invention
The invention provides a method, a device, equipment and a medium for generating an interface test case, which are used for automatically generating the interface test case.
According to a first aspect of the present invention, a method for generating an interface test case is provided, including:
acquiring a normalized requirement template which is compiled in advance relative to an interface to be tested;
analyzing the normalized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested;
and generating an interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested.
According to a second aspect of the present invention, there is provided an apparatus for generating an interface test case, including:
the template acquisition module is used for acquiring a normalized requirement template which is compiled in advance relative to an interface to be tested;
the flow chart generation module is used for analyzing the standardized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested;
and the case generating module is used for generating the interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested.
According to a third aspect of the present invention, there is provided an electronic apparatus comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method for generating interface test cases according to any of the embodiments of the present invention.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the method for generating an interface test case according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, a standardized requirement template which is compiled in advance relative to an interface to be tested is obtained; analyzing the standardized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested; and generating an interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested. According to the method, a standardized demand template is provided for testers, a flow chart of the demand corresponding to the interface to be tested is generated according to the standardized demand template, the interface elements in the interface to be tested are automatically converted into corresponding coordinates, and the interface test case is automatically generated according to the flow chart and the interface element coordinate library, so that the process of manually clicking the interface to be tested to record is omitted, the generation efficiency of the interface test case is improved, and the problem of interface test case conflict caused by difference generated by manual recording is avoided.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating an interface test case according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for generating an interface test case according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an interface test case generation apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the 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 invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention 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 invention 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.
Example one
Fig. 1 is a flowchart of a method for generating an interface test case according to an embodiment of the present invention, where the method is applicable to a situation of generating the interface test case, and the method can be executed by a device for generating the interface test case, where the device for generating the interface test case can be implemented in a form of hardware and/or software, and the device for generating the interface test case can be configured in an electronic device. As shown in fig. 1, the method includes:
and S110, acquiring a normalized requirement template which is written in advance relative to the interface to be tested.
In this embodiment, the interface to be tested may be understood as an interface to be tested, which is generated according to a business requirement, and may be an interface in the form of a web page or the like. The normalized requirement template can be understood as a template provided by the business requirement corresponding to the interface to be tested.
Specifically, different normalized requirement templates can be provided according to interface elements (such as controls, buttons and the like) included in each interface to be tested, the normalized requirement template can be generated according to prompt information such as the execution steps of the service, the controls to be clicked, the controls to be input, the content requirements corresponding to the controls to be input, the finally achieved requirements and the like, and a user can fill in the normalized requirement template according to the prompt information in the service requirement to generate the normalized requirement template corresponding to the service requirement.
Illustratively, the interface to be tested corresponds to a page of a function of a web client in the corresponding tool, wherein the web client may include a plurality of pages. The business requirement of the interface to be tested can be account login, and the normalized requirement template can correspond to page 1, wherein the content can include: service requirements are as follows: realizing account login; step 1: the required control is a text box 1, is used for inputting account names, and can be input characters with the length of 4-8 characters, wherein special characters cannot be included; and 2, step: the required control is a text box 2, is used for inputting a password corresponding to the account name, and can be a character with no less than 10 bits and simultaneously comprises capital letters, lowercase letters, numbers and symbols; and step 3: the control that needs to be used is a login control.
And S120, analyzing the normalized requirement template according to a set analysis rule, and generating a flow chart corresponding to the interface to be tested.
In the present embodiment, the parsing rule may be understood as a parsing rule generated according to a rendering rule of the flowchart. The flow chart can be understood as a flow chart generated according to the set steps and combined with the corresponding graph shapes according to the step contents.
Specifically, the normalized requirement template may be analyzed according to a set analysis rule, the steps are divided according to the set analysis rule, the order and the corresponding branch steps of each step are determined, the content in each step is analyzed, and it is determined that the content corresponds to an affirmative sentence or corresponds to a judgment sentence, where the affirmative sentence may be filled into the flowchart in a set square frame form, the judgment sentence may be filled into the flowchart in a diamond form, and generally there may be two branches under the diamond form corresponding to the judgment sentence. After the normalized requirement template is analyzed according to the analysis rule, a flow chart corresponding to the interface to be tested can be generated according to the corresponding step sequence and the step frame shape corresponding to each step.
Illustratively, the normalized requirement template comprises a step 1, the content is a, and a step 2; the content is b; step 3, judging whether the content is c or not; step 4, the content is yes and d; step 5, if the content is negative, e; step 6 is the lower branch of step 4, with content f. Analyzing the normalized requirement template according to a set analysis rule, wherein the generated flow chart can be as follows: starting; s1, a in a square frame form; s2 connected with S1, b in a square frame form; s3 connected with S2, and c in a diamond form; s4 connected with S3, d in a square frame form; s5 connected to S3, e in the form of a square, S6 connected to S4, f in the form of a square.
And S130, combining the interface element coordinate base of the interface to be tested with the interface element coordinate base to be determined in advance according to the flow chart, and generating an interface test case of the interface to be tested.
In this embodiment, the interface element coordinate library may be understood as coordinates of corners corresponding to interface elements included in the interface to be tested. The interface test case can be understood as a script file read by a computer and used for executing the interface test.
Specifically, based on the developed UI design, the developed UI may be coordinated according to factors such as screen resolution, interface size, and the like, so as to form an interface element coordinate library corresponding to interface elements included in the interface to be tested, and interface element coordinate information corresponding to the interface element coordinate library may be found out according to each step in the flowchart, where the interface elements may be in a square shape, and the coordinate information is a coordinate group, that is, four coordinates corresponding to four corners of the square, and is determined as an area of the interface element corresponding to the area enclosed by the four coordinates. According to the steps in the flow chart, coordinate information corresponding to each interface element is arranged in sequence, an interface element operation sequence with a logic sequence is generated, the interface element operation sequence is converted into a script file which can be read by a computer, and namely an interface test case of the interface to be tested is generated.
For example, the interface to be tested may include four quadrilateral text boxes, each text box may be determined according to an area formed by four coordinates of four corners, that is, the interface element coordinate library may include 4 sets of coordinates corresponding to the interface to be tested, which are set a, set B, set C, and set D, respectively, the 4 sets of coordinates are sequentially arranged according to a flowchart, it may be determined that the operation sequence of the interface element corresponding to each interface element is C, B, D to a, and then the operation sequence of the interface element is converted, and the generated interface test case may be interface 1 (C, B, D to a).
In the method for generating the interface test case provided by the embodiment, a normalized requirement template compiled in advance relative to an interface to be tested is obtained; analyzing the standardized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested; and generating an interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested. According to the method, a standardized demand template is provided for testers, a flow chart of the demand corresponding to the interface to be tested is generated according to the standardized demand template, the interface elements in the interface to be tested are automatically converted into corresponding coordinates, and the interface test case is automatically generated according to the flow chart and the interface element coordinate library, so that the process of manually clicking the interface to be tested to record is omitted, the generation efficiency of the interface test case is improved, and the problem of interface test case conflict caused by difference generated by manual recording is avoided.
As a first optional embodiment of the first embodiment, after generating an interface test case of an interface to be tested by combining a predetermined interface element coordinate library of the interface to be tested according to the flowchart, further optimizing includes:
and testing the interface to be tested corresponding to the interface test case according to the interface test case.
Further, according to the interface test case, the specific step of testing the interface to be tested corresponding to the interface test case may include:
a1, analyzing the interface test case, and determining element coordinate information of each interface element in the interface to be tested.
In this embodiment, the element coordinate information may be understood as a coordinate set corresponding to the interface element.
Specifically, the processor may analyze the interface test case by a preset analysis method to obtain element coordinate information corresponding to the interface elements included in the interface test case.
And b1, determining the operation position of the interface element corresponding to the element coordinate information according to the element coordinate information.
In this embodiment, the operation position may be understood as a position where the function of the interface element can be triggered by clicking.
Specifically, the element coordinate information corresponding to each interface element may be determined according to the element coordinate information, and a central point coordinate, which is an operation position of the interface element corresponding to the element coordinate information, is obtained for an area surrounded by the element coordinate information. And solving the coordinates of the central point of all element coordinate information analyzed by the interface test case, so as to determine the operation position of each interface element in the interface to be tested.
And c1, testing the interface to be tested according to the operation position.
Specifically, according to the operation position and the element operation sequence in the interface test case, the mouse or the keyboard can be guided to sequentially click and input the interface elements in the interface to be tested, the center point coordinates are operated, and the test of the interface to be tested is realized.
Illustratively, the interface to be tested comprises two interface elements, and the interface test case is analyzed to determine that each interface element corresponds to four coordinates, that is, the element coordinate information comprises two sets of coordinates, the coordinates corresponding to the interface elements a are A1, A2, A3 and A4, the operating position (i.e., the middle position coordinate) thereof corresponds to AO, the coordinates corresponding to the interface elements B are B1, B2, B3 and B4, the operating position (i.e., the middle position coordinate) thereof corresponds to BO, the element operating sequence is a first order a and a second order B, and the requirement corresponding to the interface to be tested is C. The processor firstly clicks the AO position and then clicks the BO position, and whether the result is C is judged so as to finish the test of the interface to be tested.
In the first optional embodiment of this embodiment, the interface test case is analyzed to obtain the element coordinate information corresponding to the interface element, the operation position of each interface element is determined according to the element coordinate information, and the operation positions of the interface elements are clicked according to the execution sequence of the interface test case by controlling the mouse or the keyboard to trigger the function corresponding to the interface element, so that the automated test of the interface to be tested is realized, the labor is saved, and the test efficiency is improved.
Example two
Fig. 2 is a flowchart of a method for generating an interface test case according to a second embodiment of the present invention, which is further detailed based on the foregoing embodiment. As shown in fig. 2, the method includes:
s210, acquiring a normalized requirement template which is written in advance relative to the interface to be tested.
S220, determining the execution steps included in the normalized requirement template according to the analysis rule.
In this embodiment, the execution steps can be understood as the execution steps required by the specified requirements to be realized by the interface to be tested.
Specifically, the normalized requirement template includes labels of steps required for implementing the interface requirement to be tested. The normalized requirement template can be analyzed according to a set analysis rule, firstly, the label in the normalized requirement template can be determined, and the sequence of each step and the corresponding branch step can be determined according to the label, namely, the execution step included in the normalized requirement template is determined.
Illustratively, according to the parsing rule, the steps included in the normalized requirement template may be determined, which may be step 1 and the branch steps 1.1, 1.2, and 1.3 required for performing step 1, and step 2 and the branch steps 2.1, 2.2, 2.3, and 2.4 required for performing step 2.
And S230, generating a flow chart corresponding to the interface to be tested according to the execution steps.
Specifically, the content in each execution step is analyzed, and it is determined that the content corresponds to a positive statement or a judgment statement, where the step frame shape corresponding to the positive statement may be a set square shape, and then the positive statement is filled in the flow chart in the form of a square step frame; if the shape of the step box corresponding to the judgment statement can be a diamond shape, the judgment statement is filled into the flow chart in the form of a diamond step box, and the diamond step box corresponding to the judgment statement can generally have two lower branches. After the normalized requirement template is analyzed according to the analysis rule, a flow chart corresponding to the interface to be tested can be generated according to the sequence of the corresponding execution steps and the shape of the step frame corresponding to each step.
Illustratively, in the above example, the branch steps 1.1, 1.2 and 1.3 are all positive statements, and the branch step 2.1 is a judgment statement, and the branch steps 2.2, 2.3 and 2.4 are all positive statements. Then the start frame is connected with the square step frame 1.1 first, the square step frame 1.1 is connected with the square step frame 1.2, the square step frame 1.2 is connected with the square step frame 1.3, the square step frame 1.3 is connected with the diamond step frame 2.1, the diamond step frame 2.1 is connected with the square step frame 2.2 and the square step frame 2.3, the square step frame 2.3 is connected with the square step frame 2.4, and the square step frame 2.4 is connected with the finish frame.
And S240, determining an element operation sequence corresponding to the element coordinate information included in the interface element coordinate library according to the flow chart.
In this embodiment, the operation sequence of the elements may be understood as the execution sequence of the interface elements included in the interface to be tested.
Specifically, interface elements corresponding to each execution step may be determined according to each corresponding execution step in the flowchart, so as to determine element coordinate information corresponding to the interface elements in the interface element coordinate library, and the element coordinate information corresponding to the interface elements is arranged according to the sequence of the execution steps, so that an element operation sequence with business logic is generated.
The determining step of the interface element coordinate library may include:
and a2, acquiring interface parameter information corresponding to the interface to be tested.
In this embodiment, the interface parameter information may be understood as information such as an interface size corresponding to the interface to be tested.
Specifically, the optimal screen resolution of the interface to be tested can be recommended to the user in advance, and interface parameter information corresponding to the interface to be tested can be determined according to the optimal screen resolution, the interface size of the interface to be tested and other factors.
And b2, performing coordinate processing on the interface elements included in the interface to be tested according to the interface parameter information to generate a coordinate processing result.
Specifically, according to the interface parameter information, the interface size of the interface to be tested at the best screen resolution and the parameter information of the interface elements included in the interface to be tested, such as the length and width information of the button, the length and width information of the text box, the length and width information of the table and the like, are determined, the interface elements included in the interface to be tested are coordinated, the edge corresponding to the border of the interface elements can be determined by combining the edge with the interface parameter information according to a preset coordinate conversion method, the coordinate area corresponding to the edge coordinate can be regarded as the corresponding interface element, the included coordinate and the interface element are associated, and a coordinated processing result is generated.
And c2, determining an interface element coordinate library according to the coordinate processing result.
Specifically, all interface elements included in the interface to be tested may be coordinated, an association relationship is established between each interface element and a coordinate group formed by a plurality of coordinates corresponding to the interface element, and the association relationships between all interface elements and coordinates under the interface to be tested are integrated to serve as an interface element coordinate library.
Further, according to the flowchart, the specific step of determining the operation sequence of the elements corresponding to the element coordinate information included in the interface element coordinate library may include:
and a3, acquiring element coordinate information corresponding to each interface element in the interface element coordinate library.
Specifically, element coordinate information corresponding to each interface element in the interface element coordinate library can be acquired, so that a coordinate group formed by each interface element and a plurality of associated coordinates is determined.
And b3, arranging the element coordinate information according to the logic sequence contained in the flow chart.
Specifically, the logic sequence of the execution steps of the interface to be tested can be determined according to the flow chart, the corresponding interface elements are determined according to each execution step, the interface elements are sorted according to the logic sequence of the execution steps, the coordinate set associated with the interface elements can be determined according to the element coordinate information, and the coordinate set is replaced to the positions of the corresponding interface elements sorted according to the logic sequence.
For example, the interface element D is determined by 3 coordinates, that is, the coordinate set associated with D may be D3, the interface element E is determined by 4 coordinates, that is, the coordinate set associated with E may be E4, the interface element F is determined by 4 coordinates, that is, the coordinate set associated with F may be F4, and the logical order in the flowchart is D first, F last, E, the element coordinate information is arranged, that is, D3 to F4 to E4.
And c3, determining the element operation sequence corresponding to the element coordinate information according to the arrangement result.
Specifically, after the element coordinate information corresponding to the interface elements included in the interface to be tested is arranged according to the logic sequence of the flow chart, the arrangement result corresponding to the element coordinate information can be obtained, so that the element operation sequence corresponding to the element coordinate information can be determined.
And S250, compiling the element operation sequence according to the set script rule to generate an interface test case of the interface to be tested.
Specifically, the element operation sequence can be compiled according to a set script rule, and the element operation sequence can be compiled into a script file that can be read by a computer according to an interface number corresponding to the element operation sequence and element coordinate information included in the element operation sequence, that is, an interface test case of the interface to be tested is generated.
In the second embodiment of the present invention, the execution steps in the normalized requirement template are analyzed according to the set analysis rule, so as to automatically generate the flowchart corresponding to the interface to be tested. And automatically carrying out coordinate processing on the interface elements included in the interface to be tested according to the interface parameter information of the interface to be tested, and automatically converting the interface elements into a coordinate form. And determining an element operation sequence according to the flow chart and the element coordinate information, and compiling the element operation sequence according to a set script rule to automatically form an interface test case. The method saves the process of manually clicking the interface to be tested for recording, improves the generation efficiency of the interface test case, and also avoids the problem of interface test case conflict caused by the difference generated by manual recording.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a device for generating an interface test case according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a template acquisition module 31, a flowchart generation module 32 and a case generation module 33. Wherein, the first and the second end of the pipe are connected with each other,
the template obtaining module 31 is configured to obtain a normalized requirement template pre-compiled with respect to an interface to be tested.
And the flow chart generating module 32 is configured to analyze the normalized requirement template according to a set analysis rule, and generate a flow chart corresponding to the interface to be tested.
And the case generating module 33 is configured to generate an interface test case of the interface to be tested according to the flowchart in combination with a predetermined interface element coordinate library of the interface to be tested.
In the method for generating the interface test case provided by the third embodiment, a normalized requirement template compiled in advance relative to the interface to be tested is obtained; analyzing the standardized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested; and generating an interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested. According to the method, a standardized demand template is provided for testers, a flow chart of the demand corresponding to the interface to be tested is generated according to the standardized demand template, the interface elements in the interface to be tested are automatically converted into corresponding coordinates, and the interface test case is automatically generated according to the flow chart and the interface element coordinate library, so that the process of manually clicking the interface to be tested to record is omitted, the generation efficiency of the interface test case is improved, and the problem of interface test case conflict caused by difference generated by manual recording is avoided.
Optionally, the flowchart generating module 32 is specifically configured to:
determining an execution step included in the normalized requirement template according to the analysis rule;
and generating a flow chart corresponding to the interface to be tested according to the execution steps.
Further, the step of determining the interface element coordinate library comprises the following steps:
acquiring interface parameter information corresponding to an interface to be tested;
performing coordinate processing on interface elements included in the interface to be tested according to the interface parameter information to generate a coordinate processing result;
and determining an interface element coordinate library according to the coordinate processing result.
Optionally, the case generating module 33 may include:
the sequence determining unit is used for determining an element operation sequence corresponding to the element coordinate information in the interface element coordinate library according to the flow chart;
and the case generating unit is used for compiling the element operation sequence according to the set script rule to generate an interface test case of the interface to be tested.
The sequence determining unit is specifically configured to:
acquiring element coordinate information corresponding to each interface element in an interface element coordinate library;
arranging the element coordinate information according to a logic sequence contained in the flow chart;
and determining the element operation sequence corresponding to the element coordinate information according to the arrangement result.
Optionally, the apparatus further includes:
and the test module is used for testing the interface to be tested corresponding to the interface test case according to the interface test case.
Further, the test module is specifically configured to:
analyzing the interface test case, and determining element coordinate information of each interface element in the interface to be tested;
determining the operation position of the interface element corresponding to the element coordinate information according to the element coordinate information;
and testing the interface to be tested according to the operation position.
The interface test case generation device provided by the embodiment of the invention can execute the interface test case generation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. Processor 11 performs the various methods and processes described above, such as the generation of interface test cases.
In some embodiments, the method of generating the interface test case may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for generating interface test cases described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the generation method of the interface test case by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a first component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end component, first component, or front-end component. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for generating an interface test case is characterized by comprising the following steps:
acquiring a normalized requirement template which is compiled in advance relative to an interface to be tested;
analyzing the normalized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested;
and generating an interface test case of the interface to be tested by combining the flow chart with a predetermined interface element coordinate library of the interface to be tested.
2. The method according to claim 1, wherein the analyzing the normalized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested comprises:
determining an execution step included in the normalized requirement template according to the analysis rule;
and generating a flow chart corresponding to the interface to be tested according to the execution step.
3. The method of claim 1, wherein the step of determining the library of interface element coordinates comprises:
acquiring interface parameter information corresponding to the interface to be tested;
performing coordinate processing on interface elements included in the interface to be tested according to the interface parameter information to generate a coordinate processing result;
and determining an interface element coordinate library according to the coordinate processing result.
4. The method of claim 1, wherein generating the interface test case of the interface to be tested according to the flowchart in combination with the predetermined interface element coordinate library of the interface to be tested comprises:
according to the flow chart, determining an element operation sequence corresponding to element coordinate information included in the interface element coordinate library;
and compiling the element operation sequence according to a set script rule to generate an interface test case of the interface to be tested.
5. The method according to claim 4, wherein the determining, according to the flowchart, an element operation order corresponding to element coordinate information included in the interface element coordinate library includes:
acquiring element coordinate information corresponding to each interface element in the interface element coordinate library;
arranging the element coordinate information according to a logic sequence contained in the flow chart;
and determining the element operation sequence corresponding to the element coordinate information according to the arrangement result.
6. The method of claim 1, wherein after generating the interface test case of the interface to be tested by combining the predetermined interface element coordinate library of the interface to be tested according to the flowchart, the method further comprises:
and testing the interface to be tested corresponding to the interface test case according to the interface test case.
7. The method according to claim 6, wherein the testing the interface to be tested corresponding to the interface test case according to the interface test case comprises:
analyzing the interface test case, and determining element coordinate information of each interface element in the interface to be tested;
determining the operation position of an interface element corresponding to the element coordinate information according to the element coordinate information;
and testing the interface to be tested according to the operation position.
8. An interface test case generation device, comprising:
the template acquisition module is used for acquiring a standardized requirement template which is compiled in advance relative to an interface to be tested;
the flow chart generation module is used for analyzing the standardized requirement template according to a set analysis rule to generate a flow chart corresponding to the interface to be tested;
and the case generating module is used for generating an interface test case of the interface to be tested according to the flow chart and a predetermined interface element coordinate library of the interface to be tested.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method of generating interface test cases of any one of claims 1-7.
10. A computer-readable storage medium, having stored thereon computer instructions for causing a processor to execute a method for generating an interface test case according to any one of claims 1-7.
CN202211252349.5A 2022-10-13 2022-10-13 Interface test case generation method, device, equipment and medium Pending CN115509932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211252349.5A CN115509932A (en) 2022-10-13 2022-10-13 Interface test case generation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211252349.5A CN115509932A (en) 2022-10-13 2022-10-13 Interface test case generation method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115509932A true CN115509932A (en) 2022-12-23

Family

ID=84509868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211252349.5A Pending CN115509932A (en) 2022-10-13 2022-10-13 Interface test case generation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115509932A (en)

Similar Documents

Publication Publication Date Title
CN115576828A (en) Test case generation method, device, equipment and storage medium
CN112835579A (en) Method and device for determining interface code, electronic equipment and storage medium
CN115358203A (en) Test report method, test report device, electronic equipment and storage medium
CN112989789B (en) Test method and device of text auditing model, computer equipment and storage medium
CN110826306B (en) Data acquisition method and device, computer readable storage medium and electronic equipment
CN115469849B (en) Service processing system, method, electronic equipment and storage medium
CN110457219B (en) Method and device for selecting time when test script is recorded
CN115509932A (en) Interface test case generation method, device, equipment and medium
CN115618777A (en) File generation method, device, equipment and storage medium
CN114064469A (en) Interface automation test method and storage medium
CN115860877A (en) Product marketing method, device, equipment and medium
CN114693116A (en) Method and device for detecting code review validity and electronic equipment
CN115098405B (en) Software product evaluation method and device, electronic equipment and storage medium
CN117573561B (en) Automatic test system, method, electronic equipment and storage medium
CN114328242B (en) Form testing method and device, electronic equipment and medium
CN115686479A (en) File creation method and related device
CN117493203A (en) Method, device, equipment and storage medium for testing server software
CN115543748A (en) Signal testing method, device, equipment and storage medium
CN115374010A (en) Function testing method, device, equipment and storage medium
CN117931155A (en) Code generation method, device, equipment and medium
CN115934550A (en) Test method, test device, electronic equipment and storage medium
CN117632120A (en) Processing system, method, equipment and storage medium for report data
CN115629690A (en) Method, device, equipment and storage medium for generating FIO working file
CN114860965A (en) Conference information recording method and device based on NLP technology, electronic equipment and medium
CN115292179A (en) Test data generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination