CN116932414B - Method and equipment for generating interface test case and computer readable storage medium - Google Patents

Method and equipment for generating interface test case and computer readable storage medium Download PDF

Info

Publication number
CN116932414B
CN116932414B CN202311183342.7A CN202311183342A CN116932414B CN 116932414 B CN116932414 B CN 116932414B CN 202311183342 A CN202311183342 A CN 202311183342A CN 116932414 B CN116932414 B CN 116932414B
Authority
CN
China
Prior art keywords
test
interface
configuration file
test case
file
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
CN202311183342.7A
Other languages
Chinese (zh)
Other versions
CN116932414A (en
Inventor
余伟
方朋朋
李德旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhicheng Software Technology Service Co ltd
Shenzhen Smart City Technology Development Group Co ltd
Original Assignee
Shenzhen Zhicheng Software Technology Service Co ltd
Shenzhen Smart City Technology Development Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhicheng Software Technology Service Co ltd, Shenzhen Smart City Technology Development Group Co ltd filed Critical Shenzhen Zhicheng Software Technology Service Co ltd
Priority to CN202311183342.7A priority Critical patent/CN116932414B/en
Publication of CN116932414A publication Critical patent/CN116932414A/en
Application granted granted Critical
Publication of CN116932414B publication Critical patent/CN116932414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Abstract

The invention discloses a method and equipment for generating an interface test case and a computer-readable storage medium, and belongs to the technical field of interface test. The method for generating the interface test case comprises the following steps: when an interface is updated, acquiring a configuration file corresponding to the interface based on a configuration file interface; analyzing the configuration file, and determining a file name and file content corresponding to the configuration file; and creating a corresponding interface test case according to the file name and the file content corresponding to the configuration file. By the method, when the UI interface is changed or updated, the test case can be automatically generated according to the configuration file of the interface, the test case is not required to be manually maintained according to the configuration file of the interface, and the test efficiency is improved.

Description

Method and equipment for generating interface test case and computer readable storage medium
Technical Field
The present invention relates to the field of UI testing, and in particular, to a method and apparatus for generating an interface test case, and a computer readable storage medium.
Background
The generation and release of the UI (User Interface) Interface are required to be performed according to the configuration file of the configuration system, the UI Interface is required to be tested before release, and the test case is required to be constructed according to the configuration file. In the generation process of the prior test cases, the test cases need to be written manually according to the configuration files, and once the interface is changed, the configuration files are correspondingly changed, so that the test cases are continuously modified and maintained by a tester, and the test efficiency of the interface is affected.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, equipment and a computer readable storage medium for generating an interface test case, and aims to solve the technical problems that a UI interface is changed and a configuration file is correspondingly changed, so that a tester can continuously modify and maintain the test case and the test efficiency of the interface is affected.
In order to achieve the above object, the present invention provides a method for generating an interface test case, where the method for generating an interface test case includes the steps of:
when an interface is updated, acquiring a configuration file corresponding to the interface based on a configuration file interface;
analyzing the configuration file, and determining a file name and file content corresponding to the configuration file;
and creating a corresponding interface test case according to the file name and the file content corresponding to the configuration file.
Optionally, the step of creating the corresponding interface test case according to the file name and the file content corresponding to the configuration file includes:
setting a precondition in a test case template according to the function page corresponding to the file name;
based on the interface elements in the file content, inserting corresponding assertion and screenshot operations in the test case template;
based on the jump information of the clickable event in the file content, inserting a corresponding jump test step and screenshot operation into the test case template;
and generating the test case based on the content in the test case template.
Optionally, after the step of creating the corresponding interface test case according to the file name and the file content corresponding to the configuration file, the method further includes:
entering a test page of the interface based on the preconditions;
based on the assertion and jump test step in the test case, executing the test task and recording the returned assertion result;
summarizing the assertion result and obtaining a corresponding test screenshot to generate an interface test report.
Optionally, after the step of summarizing the assertion result and obtaining the corresponding test screenshot to generate the interface test report, the method further includes:
when the interface test report shows that the test report fails, acquiring a test abnormal task based on the interface test report;
submitting the abnormal testing task to a defect management platform;
acquiring the identification of the test abnormal task based on the defect management platform;
determining an exception type of the test exception task based on the identification;
prompting a worker to modify the configuration file based on the defect management platform and the abnormality type;
and allocating a new version number for the modified configuration file.
Optionally, after the step of summarizing the assertion result and obtaining the corresponding test screenshot to generate the interface test report, the method further includes:
when the interface test report shows that the interface passes the test, checking the integrity and the correctness of the configuration file;
after the verification is passed, backing up the configuration file;
and publishing the configuration file on a corresponding server based on the publishing requirement of the configuration file.
Optionally, after the step of publishing the configuration file on the corresponding server based on the publishing requirement of the configuration file, the method further includes:
monitoring the running condition of the configuration file;
evaluating the release effect based on the returned monitoring result;
and determining whether to prompt a worker to correct the configuration file based on the release effect.
Optionally, before the step of parsing the configuration file to determine the file name and the file content corresponding to the configuration file, the method further includes:
calling the configuration file interface to acquire the configuration file based on a preset time interval;
judging whether the version number of the configuration file is the same as the version number released by the last test;
and when the version number of the configuration file is different from the version number released by the last test, carrying out gray release on the configuration file to trigger a process for analyzing the configuration file.
Optionally, when the version number of the configuration file is different from the version number released by the previous test, the step of releasing the configuration file in gray scale includes:
dividing and selecting user test groups based on the release requirements of the configuration files;
and deploying the configuration file to a server, and triggering the test case generation flow so as to test the interface corresponding to the configuration file by the user test group.
Optionally, to solve the above problem, the present invention further provides an interface test case generating device, where the interface test case generating device includes: the interface test case generating device comprises a memory, a processor and a generating program of the interface test case, wherein the generating program of the interface test case is stored in the memory and can run on the processor, and the generating program of the interface test case is configured to realize the steps of the interface test case generating method.
Optionally, to solve the above problem, the present invention further provides a computer readable storage medium, where a generating program of an interface test case is stored, where the generating program of the interface test case implements the steps of the generating method of the interface test case as described above when being executed by a processor.
The embodiment of the invention provides a method for generating an interface test case, when a UI (user interface) is updated, corresponding configuration files also need to be subjected to gray level release, the configuration files corresponding to the interface are obtained through the configuration file interface, then the configuration files are analyzed to determine the file names and the file contents corresponding to the configuration files, and further the corresponding interface test case is automatically created according to the file names and the file contents of the configuration files. Through the method, when the UI interface is changed or updated, the test case can be automatically generated according to the configuration file of the interface, the test case is not required to be manually maintained according to the configuration file of the interface, and the test efficiency is improved.
Drawings
FIG. 1 is a flowchart of a first embodiment of a method for generating an interface test case according to the present invention;
FIG. 2 is a flowchart of step S30 in a first embodiment of a method for generating an interface test case according to the present invention;
FIG. 3 is a flowchart of a second embodiment of a method for generating an interface test case according to the present invention;
FIG. 4 is a flowchart of a third embodiment of a method for generating an interface test case according to the present invention;
FIG. 5 is a schematic diagram of an overall execution flow of a method for generating an interface test case according to the present invention;
fig. 6 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the invention provides a method for generating an interface test case, and referring to fig. 1, fig. 1 is a flow diagram of a first embodiment of the method for generating an interface test case.
In this embodiment, the method for generating the interface test case includes:
and step S10, when the interface is updated, acquiring a configuration file corresponding to the interface based on the configuration file interface.
In this embodiment, the UI interface is a visual interface for a user to interact with a computer program or a device, where the UI interface generally includes content such as graphic elements, text, labels, buttons, and operation elements, where the elements are included in a configuration file of the UI interface, and can be used to operate and control the program for the user, so that the user can interact with the program through the elements such as graphics, text, buttons, and menus. In order to control the interactive effect of the UI interface, the interactive function in the UI interface needs to be detected, the user operation is simulated by creating a test case, and whether the responsiveness and the interactivity of the interface are smooth or not is evaluated according to the response result.
The configuration file of the UI interface is used to store and manage files of various parameters, settings, and attributes of the interface. The configuration files are typically in the form of text files that can be stored using different formats, such as XML, JSON, YAML, or the like. The configuration file may change during operation of the UI interface, for example, modifying the value of a certain configuration item or adding a new configuration item. When the UI interface is modified, the manager can modify the configuration file based on the configuration system, the content in the configuration file is correspondingly changed according to the changed position of the UI interface, and when the test case is generated through the configuration file, the configuration file interface is called to acquire the configuration file. The configuration file interface is a programming interface or library for reading and managing configuration files, and can load, parse, modify and save the contents of the configuration files.
Alternatively, the profile interface may be invoked to obtain the profile based on a preset time interval, such as reading the profile interface every 30 minutes, to obtain the latest profile in the previous time interval. It should be noted that, when the configuration file interface is called using a fixed time interval, the time interval should be reasonably selected. Too short a time interval may increase system burden, while too long a time interval may result in untimely configuration updates. Therefore, when setting the time interval, it is necessary to determine the optimal call frequency by balancing the time interval and the system performance according to the actual requirements.
In this embodiment, by periodically acquiring the configuration file, the application may acquire the latest configuration information in real time without restarting or reloading the entire UI interface. When a certain configuration item in the configuration file is changed, the updated value can be immediately acquired, and corresponding processing is performed according to the new configuration. In this way, real-time response and flexibility can be achieved to accommodate different configuration requirements. In addition, configuration is obtained by calling the configuration file interface at regular time, so that modification of source codes and recompilation of the UI interface can be avoided.
And step S20, analyzing the configuration file, and determining a file name and file content corresponding to the configuration file.
In this embodiment, by parsing the configuration file, the file name and file content corresponding to the configuration file may be determined. When the configuration file is analyzed, the configuration file format is determined firstly, a corresponding analysis method and tool are used according to different formats, the configuration file is opened by using the selected analysis library, and the configuration file is read into the memory to prepare for analysis. And extracting configuration information of the configuration file, extracting required configuration information by analyzing the obtained result, and storing the required configuration information in a proper data structure so as to be used in the process of generating the test case later.
The configuration file of the UI interface is parsed, the file name of the configuration file and the interface element definition of the corresponding interface, such as buttons, text boxes, drop-down lists, etc., can be obtained, and the information of the attribute, position, size, default value, etc. of the interface elements can be obtained by parsing the configuration file. In addition, the relative positions and the hierarchical relationship of each element in the interface can be known by analyzing the configuration file, so that the rendering and organization of the interface layout can be performed in the process of generating the test case. The configuration file may contain definitions of interaction behaviors of the interface elements, such as click events, input verification, etc., and trigger conditions and corresponding processing logic of the interaction behaviors may also be obtained in the process of parsing the configuration file, so as to implement interaction and function implementation between the interface elements.
It should be noted that, the configuration files with different formats have different grammar rules and parsing modes, and when the configuration files are parsed, the corresponding format files should be carefully read and understood, and parsing operation is performed according to the specification.
In this embodiment, the configuration file is parsed by using the parsing tool, so that definition and logic of the UI interface can be separated from the code, and in the process of subsequently generating the test case, development efficiency can be improved, and maintenance and modification of the interface are facilitated.
And step S30, creating a corresponding interface test case according to the file name and the file content corresponding to the configuration file.
In this embodiment, the test case may be further generated by the file name and the file content of the configuration file that are parsed before. Before the test case generating process is triggered, a certain triggering condition is needed, each configuration file has own version number, in order to prevent repeated testing, after the configuration file is obtained, whether the version number of the current configuration file is the same as the version number of the last configuration file or not is firstly judged, if the version numbers are different, the UI interface is proved to be changed, and the testing needs to be carried out again. And further, carrying out gray level release on the configuration file so as to trigger the generation process of the test case, so that the test platform builds a test task. Before gray level distribution, the requirements of gray level distribution, including time schedule, range and target user group, are defined, and one user subset with proper order of magnitude is divided and selected from the whole user group to be used as a user test group. The UI interface is updated and deployed into a gray scale environment, a testing environment similar to a production environment is created, new UI interfaces are gradually introduced into a user testing group, and the user testing group can select internal staff, partners or specific clients. After the initial setting is completed, the generation process of the test case of the gray level test task can be triggered based on the execution of the gray level release task, and the user experience, the problem report and the suggestion are collected by closely monitoring the system performance, the stability and the user feedback which are displayed by the UI interface during the gray level release based on the test case so as to be convenient to process in time. Further, referring to fig. 2, the step of creating a corresponding interface test case according to the file name and the file content corresponding to the configuration file includes the following steps:
and S31, setting a precondition in the test case template according to the function page corresponding to the file name.
And step S32, based on interface elements in the file content, inserting corresponding assertion and screenshot operations in the test case template.
And step S33, based on the jump information of the clickable event in the file content, inserting a corresponding jump test step and screenshot operation into the test case template.
And step S34, generating the test case based on the content in the test case template.
In this embodiment, firstly, a function page corresponding to a configuration file is obtained according to the name of the configuration file, and based on the function page, a precondition part is inserted into a test step of entering a test page in a test case template. And traversing the names of the elements in the configuration file, and inserting whether each element exists or not into the test case template according to the name information of the elements. And finally traversing the jump information of the clickable events in the configuration file, inserting the clicking operation of each clicking event in the test case template by the test execution part, asserting information of the page where the jump is located, and returning to the operation step of the tested page. In addition, a screenshot operation is added after each assertion in order to screen capture the results of the retention test.
When the assertion is inserted for the element, firstly, determining which interface elements need to be asserted according to the test target and the requirement, and selecting a proper assertion method according to the property and the expected result of the assertion object, such as judging whether the element exists or not, and judging whether the text content, the attribute value, the style and the like of the element accord with the expected or not. Further, corresponding assertion statements are written according to the selected assertion method. When the test of the jump step is involved, interface states and pre-conditions at the beginning of the test are determined, and the user is simulated to execute the operation of triggering the jump, such as clicking a button, a link or a menu item, and the step is inserted into a corresponding position. It should be noted that different jump scenarios, such as normal jumps, jumps in abnormal situations, multi-level jumps, etc., should be covered when designing the test cases, each test step should include explicit operation descriptions and expected results, and repeatability and maintainability of the test cases should be ensured. In addition, for data transfer or state transfer in the jump process, for example, transfer parameters are required when jumping from one page to another, whether the transferred parameter value meets expectations can be checked through an assertion or verification method, and comparison or consistency verification is performed with the data of the source page. Here authentication may be performed by accessing URL parameters, form fields, hidden fields, etc. And finally, generating a new test case through contents such as assertion, verification, screenshot operation and the like in the test case template.
In this embodiment, after the UI interface is changed, the file name and the file content that are parsed from the configuration file automatically generate a new test case, and the test case does not need to be manually re-maintained according to the configuration file, so that the test efficiency of the UI interface can be improved.
Further, referring to fig. 3, in a second embodiment of the method for generating an interface test case according to the present invention, after step S34, the method further includes the following steps:
and step S40, entering a test page of the interface based on the preconditions.
And step S50, executing the test task and recording a returned assertion result based on the assertion and jump test step in the test case.
And step S60, summarizing the assertion result and acquiring a corresponding test screenshot to generate an interface test report.
In this embodiment, the newly generated test example will test the UI interface after the previous gradation release. The preconditions define parameters of the test environment, states that the test data need to satisfy, and prerequisite steps that must be executed before testing, and when the preconditions are satisfied, the test page of the UI interface is entered. And then executing all the assertions in the test case, recording the returned assertion results, simultaneously carrying out screenshot on the response results after the jump step by screenshot operation, finally summarizing the test assertion results and the corresponding test screenshots, and compiling a test report.
After entering the target page, relevant test operations and assertions are performed, including filling out forms, submitting data, triggering other operations, or verifying specific page behaviors, according to test objectives and requirements. The assertion statement can be verified at a proper position, the test framework or tool can automatically execute the assertion statement, record the result of the assertion, and compare the result with the expected result so as to judge whether the test result is reasonable. And analyzing whether the test result meets the expectations according to the result of the assertion. If the assertion fails, indicating that the test case failed, further investigation and repair of the problem is required. For the test of the jump page, the test case can verify whether the jump target page or window is correctly opened after simulating the operation of the user. The correctness of the target page may be confirmed by looking at a URL (uniform resource locator ), title, page element, or other identification. If the original page needs to be returned or other jump operation is executed, the operation of the user is simulated again, corresponding steps are recorded, and whether the return or jump result meets the expectations is verified.
Further, after summarizing test assertion results and corresponding test screenshots, only if the test report shows that all asserted tests pass, the test passes is represented, and if any assertion failure exists, the test is judged not to pass. And sending the test report to related personnel, wherein the related personnel can make corresponding measures according to the test result of the test report, and when the test report shows that the test passes, the test platform can adjust the configuration file of the test from the gray level release state to full release. When full release is made, the new configuration file can be applied to all users or systems using the appropriate tools or methods. After full release, verification and testing is performed to ensure that the new configuration file works properly in all devices and environments, to check if the layout, style and functionality of the interface is performed as expected, and to address any problems or anomalies. Optionally, the user's usage, performance data, and user feedback may be monitored to evaluate the effect of the full release and prompt the staff to make adjustments or repairs when necessary.
It should be noted that, before the full release, the integrity and correctness of the configuration file needs to be checked to avoid potential problems and adverse effects. In addition, for important or sensitive configuration files, a backup and rollback mechanism may be employed, i.e., the configuration files are backed up, to quickly revert to a previous state when a problem arises.
Alternatively, in another possible implementation, the full-volume publishing may not be directly performed after confirming that the new UI interface is stable and reliable, but instead the progressively expanding publishing range, that is, progressively expanding the gray publishing range to a larger user population, may be selected. The manner of scaling up may be selected based on the actual situation, such as by geographic area, user role, or other criteria. After the UI interface is widely released, system performance and user feedback continue to be monitored, while rollback plans are formulated to address unforeseen issues, ensuring that a quick rollback to a previous stable version is enabled. Through the steps, the gray level release can reduce the influence range to the greatest extent, process the problems in time, collect user feedback, thereby improving the release quality and the user satisfaction degree, and finally carry out full release.
In this embodiment, the updated interface is tested by the test case, and according to the condition reflected by the test report, the execution result of the UI interface based on the test case can be clearly observed. And the testing efficiency of the UI interface is improved.
Further, referring to fig. 4, in a third embodiment of the method for generating an interface test case according to the present invention, after the step S60, the method further includes the following steps:
and step S70, acquiring a test abnormal task based on the interface test report when the interface test report shows that the test abnormal task fails.
And step S80, submitting the test abnormal task to a defect management platform.
Step S90, based on the defect management platform, the identification of the abnormal task is obtained.
And step S100, determining the abnormal type of the abnormal task based on the identification.
Step S110, prompting a worker to modify the configuration file based on the defect management platform and the abnormality type.
Step S120, a new version number is allocated for the modified configuration file.
In this embodiment, for the case where the test fails, an abnormal test task in the test report is obtained according to the interface test report, that is, the position and the reason of the occurrence of the test abnormality are determined. The method comprises the steps that a test abnormal task is submitted to a defect management platform, the defect management platform is used for further response processing, the defect management platform can read an identification of the test abnormal task, the abnormal type of the test abnormal task can be determined through the read abnormal identification, then corresponding staff is informed of modifying the abnormal position of a UI interface, a configuration file is correspondingly modified based on a configuration system, a new version number is allocated to the configuration file with a new modified version, and therefore, when the modified configuration file is tested again, the configuration file is convenient to directly obtain from the interface of the configuration file.
At the time of testing, key elements such as buttons, links, input fields, etc., may be lost or accidentally hidden from view on the UI interface. In addition, exception types such as incorrect or invalid element states, element layout and alignment issues, responsiveness and adaptability issues, display errors or format errors, and cross-browser compatibility issues may also be included. The identification of the abnormal task can uniquely represent the test type of the test abnormality, and in the previous test process, corresponding abnormal identification is given to interface elements or jump processes of the test abnormality, so that the type of the test abnormality can be directly determined directly according to the test identification later, and compared with the mode of manually intervening to analyze the cause of the test abnormality, the processing efficiency of a test abnormality scene can be improved.
In this embodiment, by using different identifiers for interface elements or jump steps of the test exception, and processing the exception problem of the configuration file through the defect management platform, the processing efficiency of the test exception scene can be improved.
In order to facilitate understanding of the overall execution flow of the present invention, the overall execution flow is explained below with reference to fig. 5, and when the UI interface is changed, modified or updated, the configuration file is correspondingly changed by the configuration system, the configuration file is subjected to gray release, and the test task is triggered to be started by the gray release, with reference to fig. 5. Then, the configuration file is analyzed, and corresponding test cases are generated based on the test case templates through file contents and file names analyzed from the configuration file. And then executing a test step in the gray level release process by using the test case, collecting the result of each assertion in the test case, simultaneously reserving the corresponding test result by using the screenshot operation, and finally compiling to obtain a test report. If the test report shows that the test result is successful, the configuration file is issued in full quantity or the gray level of the configuration file is issued continuously to a larger extent, and if the test report does not show success, the configuration file is submitted to a defect management platform, and relevant personnel process defects in the configuration file based on the defect management platform. When the UI interface is changed, the generating and executing steps of the test case are completed, the testing efficiency of the UI interface is improved, and the test case is not required to be manually maintained.
Referring to fig. 6, fig. 6 is a schematic diagram of a generating device structure of an interface test case of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 6, the generating device of the interface test case may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in FIG. 6 does not constitute a limitation of the generating device of the interface test case, and may include more or fewer components than illustrated, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 6, a memory 1005, which is a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and a generation program of an interface test case.
In the generating device of the interface test case shown in fig. 6, the network interface 1004 is mainly used for performing data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the generating device of the interface test case of the present invention may be disposed in the generating device of the interface test case, where the generating device of the interface test case invokes the generating program of the interface test case stored in the memory 1005 through the processor 1001, and performs the following steps:
when an interface is updated, acquiring a configuration file corresponding to the interface based on a configuration file interface;
analyzing the configuration file, and determining a file name and file content corresponding to the configuration file;
and creating a corresponding interface test case according to the file name and the file content corresponding to the configuration file.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
setting a precondition in a test case template according to the function page corresponding to the file name;
based on the interface elements in the file content, inserting corresponding assertion and screenshot operations in the test case template;
based on the jump information of the clickable event in the file content, inserting a corresponding jump test step and screenshot operation into the test case template;
and generating the test case based on the content in the test case template.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
entering a test page of the interface based on the preconditions;
based on the assertion and jump test step in the test case, executing the test task and recording the returned assertion result;
summarizing the assertion result and obtaining a corresponding test screenshot to generate an interface test report.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
when the interface test report shows that the test report fails, acquiring a test abnormal task based on the interface test report;
submitting the abnormal testing task to a defect management platform;
acquiring the identification of the test abnormal task based on the defect management platform;
determining an exception type of the test exception task based on the identification;
prompting a worker to modify the configuration file based on the defect management platform and the abnormality type;
and allocating a new version number for the modified configuration file.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
when the interface test report shows that the interface passes the test, checking the integrity and the correctness of the configuration file;
after the verification is passed, backing up the configuration file;
and publishing the configuration file on a corresponding server based on the publishing requirement of the configuration file.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
monitoring the running condition of the configuration file;
evaluating the release effect based on the returned monitoring result;
and determining whether to prompt a worker to correct the configuration file based on the release effect.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
calling the configuration file interface to acquire the configuration file based on a preset time interval;
judging whether the version number of the configuration file is the same as the version number released by the last test;
and when the version number of the configuration file is different from the version number released by the last test, carrying out gray release on the configuration file to trigger a process for analyzing the configuration file.
Further, the generating device of the interface test case calls, through the processor 1001, a generating program of the interface test case stored in the memory 1005, and further performs the following steps:
dividing and selecting user test groups based on the release requirements of the configuration files;
and deploying the configuration file to a server, and triggering the test case generation flow so as to test the interface corresponding to the configuration file by the user test group.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (5)

1. The method for generating the interface test case is characterized by comprising the following steps of:
calling a configuration file interface based on a preset time interval to acquire a configuration file corresponding to the interface;
judging whether the version number of the configuration file is the same as the version number released by the last test;
when the version number of the configuration file is different from the version number issued by the last test, performing gray level issue on the configuration file to trigger analysis of the configuration file, and determining a process of file names and file contents corresponding to the configuration file, wherein the file contents comprise interactive behavior definitions of interface elements, and analyzing the configuration file to acquire relative positions and hierarchical relations of all elements, triggering conditions of the interactive behaviors and processing logic;
according to the function page corresponding to the file name, inserting a testing step of entering the testing page into a pre-condition of the testing case template, wherein the pre-condition prescribes parameters of a testing environment, states required to be met by testing data and pre-requisite steps required to be executed before testing;
based on the interface element in the file content, inserting corresponding assertion and screenshot operation in the test case template, wherein the assertion is used for testing whether the interface element exists or not;
based on the jump information of the clickable event in the file content, inserting a corresponding jump test step and the screenshot operation into the test case template, wherein the jump test step is used for checking whether the transfer parameter accords with the expectation or not when the page jumps based on a verification method, the jump test step is covered with the scenes of normal jump, jump under the abnormal condition and multi-stage jump, each jump test step comprises an operation description and an expectation result, and the screenshot operation is used for reserving the test result;
creating a corresponding interface test case based on the content in the test case template;
when the precondition is met, entering a test page of the interface use case;
based on the assertion and jump test steps in the test case, executing a test task and recording a returned assertion result, wherein the test task comprises filling in a form, submitting data, triggering operation and verifying specific page behaviors;
summarizing the assertion result and obtaining a corresponding test screenshot to generate an interface test report;
when the interface test report shows that the interface test report fails, acquiring a test abnormal task based on the interface test report, submitting the test abnormal task to a defect management platform, acquiring an identification of the test abnormal task based on the defect management platform, determining an abnormal type of the test abnormal task based on the identification, prompting a worker to modify the configuration file based on the defect management platform and the abnormal type, and distributing a new version number for the modified configuration file;
when the interface test report shows that the functional page passes the test, checking the integrity and the correctness of the configuration file;
after the verification is passed, backing up the configuration file;
and publishing the configuration file on a corresponding server based on the publishing requirement of the configuration file.
2. The method for generating interface test cases according to claim 1, wherein after the step of publishing the configuration file on the corresponding server based on the publishing requirement of the configuration file, the method further comprises:
monitoring the running condition of the configuration file;
evaluating the release effect based on the returned monitoring result;
and determining whether to prompt a worker to correct the configuration file based on the release effect.
3. The method for generating an interface test case according to claim 1, wherein the step of gray-scale publishing the configuration file comprises:
dividing and selecting user test groups based on the release requirements of the configuration files;
and deploying the configuration file to a server, and triggering the test case generation flow so as to test the interface corresponding to the configuration file by the user test group.
4. The device for generating the interface test case is characterized by comprising the following components: a memory, a processor, and a generation program of interface test cases stored on the memory and executable on the processor, the generation program of interface test cases configured to implement the steps of the generation method of interface test cases according to any one of claims 1 to 3.
5. A computer-readable storage medium, wherein a program for generating an interface test case is stored on the storage medium, and the program for generating an interface test case, when executed by a processor, implements the steps of the method for generating an interface test case according to any one of claims 1 to 3.
CN202311183342.7A 2023-09-14 2023-09-14 Method and equipment for generating interface test case and computer readable storage medium Active CN116932414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311183342.7A CN116932414B (en) 2023-09-14 2023-09-14 Method and equipment for generating interface test case and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311183342.7A CN116932414B (en) 2023-09-14 2023-09-14 Method and equipment for generating interface test case and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN116932414A CN116932414A (en) 2023-10-24
CN116932414B true CN116932414B (en) 2024-01-05

Family

ID=88380890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311183342.7A Active CN116932414B (en) 2023-09-14 2023-09-14 Method and equipment for generating interface test case and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116932414B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914375A (en) * 2013-01-07 2014-07-09 百度国际科技(深圳)有限公司 Method and device for testing owner-drawing interface software
CN106383789A (en) * 2016-12-05 2017-02-08 广州唯品会信息科技有限公司 Software interface test method and software interface test system
CN109857668A (en) * 2019-02-03 2019-06-07 苏州市龙测智能科技有限公司 UI automated function test method, test device, test equipment and storage medium
CN112241361A (en) * 2019-07-19 2021-01-19 北京搜狗科技发展有限公司 Test case generation method and device and problem scene automatic reproduction method and device
CN115098126A (en) * 2022-06-06 2022-09-23 北京结慧科技有限公司 Configuration file management method, system, computer equipment and program product
CN115658496A (en) * 2022-10-21 2023-01-31 北京志凌海纳科技有限公司 Extensible Web automatic test method, system, equipment and storage medium
CN116204421A (en) * 2023-02-03 2023-06-02 深圳依时货拉拉科技有限公司 Test case generation method and device, storage medium and computer equipment
CN116599864A (en) * 2023-06-28 2023-08-15 南京南瑞继保电气有限公司 Communication test system, method, equipment and storage medium for automatic interface generation and use case modular development
CN116719736A (en) * 2023-06-20 2023-09-08 天津汇商共达科技有限责任公司 Test case generation method and device for testing software interface

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102028175B1 (en) * 2012-07-30 2019-10-04 삼성전자주식회사 Flexible device for providing bending interaction guide and control method thereof
IN2015DE01395A (en) * 2015-05-18 2015-06-26 Hcl Technologies Ltd

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914375A (en) * 2013-01-07 2014-07-09 百度国际科技(深圳)有限公司 Method and device for testing owner-drawing interface software
CN106383789A (en) * 2016-12-05 2017-02-08 广州唯品会信息科技有限公司 Software interface test method and software interface test system
CN109857668A (en) * 2019-02-03 2019-06-07 苏州市龙测智能科技有限公司 UI automated function test method, test device, test equipment and storage medium
CN112241361A (en) * 2019-07-19 2021-01-19 北京搜狗科技发展有限公司 Test case generation method and device and problem scene automatic reproduction method and device
CN115098126A (en) * 2022-06-06 2022-09-23 北京结慧科技有限公司 Configuration file management method, system, computer equipment and program product
CN115658496A (en) * 2022-10-21 2023-01-31 北京志凌海纳科技有限公司 Extensible Web automatic test method, system, equipment and storage medium
CN116204421A (en) * 2023-02-03 2023-06-02 深圳依时货拉拉科技有限公司 Test case generation method and device, storage medium and computer equipment
CN116719736A (en) * 2023-06-20 2023-09-08 天津汇商共达科技有限责任公司 Test case generation method and device for testing software interface
CN116599864A (en) * 2023-06-28 2023-08-15 南京南瑞继保电气有限公司 Communication test system, method, equipment and storage medium for automatic interface generation and use case modular development

Also Published As

Publication number Publication date
CN116932414A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
US9542303B2 (en) System and method for reversibility categories and characteristics of computer application functions
US9348617B1 (en) Method and system for automatic processing of failed test scenarios
CN105094783B (en) method and device for testing stability of android application
US8347267B2 (en) Automated software testing and validation system
US10127141B2 (en) Electronic technology resource evaluation system
CN101046767B (en) Method and system for automated testing of a graphic-based programming tool
US8549483B1 (en) Engine for scalable software testing
US20130326486A1 (en) Keyword based software testing system and method
CN109840206B (en) Data testing method, device, terminal and storage medium
US8881109B1 (en) Runtime documentation of software testing
US7451051B2 (en) Method and system to develop a process improvement methodology
Geiger et al. BPMN conformance in open source engines
US11074162B2 (en) System and a method for automated script generation for application testing
US9342439B2 (en) Command coverage analyzer
CN112241360A (en) Test case generation method, device, equipment and storage medium
US8661414B2 (en) Method and system for testing an order management system
CN103186463B (en) Determine the method and system of the test specification of software
US20150234732A1 (en) Executable software specification generation
US6427233B1 (en) Method for addressing the dynamic windows
CN116932414B (en) Method and equipment for generating interface test case and computer readable storage medium
CN113742215A (en) Method and system for automatically configuring and calling test tool to perform test analysis
CN111611173A (en) System and method applied to micro-service engineering interface document detection
US11894976B1 (en) Automated predictive change analytics
Di Ruscio et al. EVOSS: A tool for managing the evolution of free and open source software systems
CN115543807A (en) Automatic regression testing method and device, computer 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
GR01 Patent grant
GR01 Patent grant