Data processing method and device, electronic equipment and storage medium
By analyzing and matching test instructions, automatically determining and updating UI automated test cases, solving the problems of cumbersome operation and low flexibility in traditional test case creation methods, and improving testing efficiency and flexibility.
Patent Information
- Application Number
- CN202411936034.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The traditional UI automation test case creation method is cumbersome and has low flexibility, resulting in low testing efficiency, especially when functional changes require manual reassembly of the test case.
By responding to test cases, generating instructions, obtaining instruction information and calling preset analysis model for analysis, identifying process keywords and querying matching test cases from the data dictionary, extracting the page function list and matching text information, determining the target test case, running and comparing the page elements and element sequences in the target test case, updating element information, and generating a new test case.
It improves the generation efficiency and testing efficiency of test cases, reduces manual operations, and enhances the flexibility and adaptability of test cases.
Smart Images

Figure CN119759782A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] The creation of test cases is an important part of testing. In the traditional way, the UI automation test case creation method is that business personnel operate and run on the tested system step by step according to the test steps to complete the assembly of UI automation test cases after the operation. However, this method is not only cumbersome to operate, but also has low flexibility when executing cases. The created UI automation cases can only be played back for steady-state functions, and when new functions appear, it is necessary to manually operate the test process again to assemble the corresponding UI automation cases, which leads to low testing efficiency. Summary of the invention
[0003] In view of this, embodiments of the present invention provide a data processing method, device, electronic device and storage medium, which can solve the problem that the test case creation method has low flexibility and leads to low test efficiency.
[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for data processing is provided.
[0005] A data processing method according to an embodiment of the present invention comprises: in response to a test case generation instruction, obtaining instruction information corresponding to the generation instruction, calling a preset parsing model to parse the instruction information and obtain corresponding text information; identifying a process keyword in the text information, and querying a matching test case set from a data dictionary based on the keyword; for each test case in the test case set, extracting a page function list of the test case to match it with the text information, and determining a target test case according to the matching result; extracting an element sequence of each page based on the text information, running the target test case, and comparing each page element in the target test case with the element sequence in turn according to the running order of the target test case to obtain a comparison result; in response to the comparison result being different, updating the page element in the target test case to the corresponding element in the element sequence;
[0006] In response to the target test case being completed, a new test case is generated based on the completed test case.
[0007] In one embodiment, updating the elements of the page in the target test case to the corresponding elements in the element sequence includes: obtaining a set of functional sub-elements corresponding to the page elements in the element sequence, obtaining component information associated with each of the functional sub-elements, and updating the component information to the elements of the page in the target test case.
[0008] In another embodiment, component information associated with each of the functional sub-elements is obtained to update the component information to the elements of the page in the target test case, including: obtaining the component type associated with each of the functional sub-elements to match the elements of the corresponding page in the target test case; in response to a successful match, obtaining the component attribute value associated with the functional sub-element to update the elements of the corresponding page in the target test case based on the attribute value; in response to an unsuccessful match, obtaining the component associated with the functional sub-element to update the elements of the corresponding page in the target test case based on the component.
[0009] In another embodiment, each page element in the target test case is compared with an element sequence to obtain a comparison result, including: in response to a program corresponding to the page element being called, obtaining an element identifier and input data of the program, querying a corresponding target element from the element sequence based on the element identifier, and obtaining configuration parameters of the target element to compare the input data with the configuration parameters to obtain a comparison result.
[0010] In another embodiment, a page function list of the test case is extracted to match the text information to determine a target test case based on the matching result, including: extracting the page function list of the test case, obtaining corresponding function description features, identifying the function description features from the text information, and obtaining a recognition result; in response to the recognition result satisfying a preset condition, determining the test case as a target test case.
[0011] In another embodiment, a preset parsing model is called to parse the instruction information to obtain corresponding text information, including: calling a preset parsing model to convert the instruction information into a text format, splitting the instruction information in the text format into text segments based on preset identifiers; generating a text sequence based on the splitting order and the text segments to determine the text information corresponding to the instruction information.
[0012] To achieve the above objective, according to another aspect of an embodiment of the present invention, a data processing device is provided.
[0013] A data processing device according to an embodiment of the present invention includes: a parsing unit, which is used to respond to a test case generation instruction, obtain instruction information corresponding to the generation instruction, call a preset parsing model to parse the instruction information, and obtain corresponding text information; a matching unit, which is used to identify process keywords in the text information, and query a matching test case set from a data dictionary based on the keywords; a determination unit, which is used to extract a page function list of the test case for each test case in the test case set to match it with the text information, so as to determine a target test case according to the matching result; a comparison unit, which is used to extract an element sequence of each page based on the text information, run the target test case, and compare each page element in the target test case with the element sequence in turn according to the running order of the target test case to obtain a comparison result; an updating unit, which is used to update the elements of the page in the target test case to the corresponding elements in the element sequence in response to the comparison result being different; and a determination unit, which is used to generate a new test case based on the test case that has been run and has been run, in response to the target test case being run to be completed.
[0014] In one embodiment, the updating unit is specifically used to: obtain a set of functional sub-elements corresponding to the page elements in the element sequence, obtain component information associated with each of the functional sub-elements, and update the component information to the elements of the page in the target test case.
[0015] In another embodiment, the updating unit is specifically used to: obtain the component type associated with each of the functional sub-elements to match the elements of the corresponding page in the target test case; in response to a successful match, obtain the component attribute value associated with the functional sub-element to update it to the element of the corresponding page in the target test case based on the attribute value; in response to an unsuccessful match, obtain the component associated with the functional sub-element to update it to the element of the corresponding page in the target test case based on the component.
[0016] In another embodiment, the comparison unit is specifically used to: in response to the program corresponding to the page element being called, obtain the element identifier and input data of the program, query the corresponding target element from the element sequence based on the element identifier, and obtain the configuration parameters of the target element to compare the input data and the configuration parameters to obtain a comparison result.
[0017] In another embodiment, the matching unit is specifically used to: extract the page function list of the test case, obtain corresponding function description features, identify the function description features from the text information, and obtain a recognition result; in response to the recognition result satisfying a preset condition, determine the test case as a target test case.
[0018] In another embodiment, the parsing unit is specifically used to: call a preset parsing model to convert the instruction information into a text format, split the instruction information in the text format into various text segments based on preset identifiers; generate a text sequence based on the splitting order and the various text segments to determine the text information corresponding to the instruction information.
[0019] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0020] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided by the embodiment of the present invention.
[0021] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0022] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the data processing method provided by the embodiment of the present invention is implemented.
[0023] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer program product is provided.
[0024] A computer program product according to an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the data processing method provided by the embodiment of the present invention is implemented.
[0025] One embodiment of the above invention has the following advantages or beneficial effects:
[0026] In an embodiment of the present invention, in response to a test case generation instruction, instruction information corresponding to the generation instruction can be first obtained, and a preset parsing model can be called to parse the instruction information to obtain corresponding text information; then, process keywords in the text information are identified, and a matching test case set is queried from a data dictionary based on the keywords, that is, a stored test case that is close to the generation instruction is queried; for each test case in the test case set, a page function list of the test case can be extracted to match the text information, and a target test case is determined based on the matching result, that is, a test case that best matches the generation instruction, so as to extract an element sequence of each page based on the text information, run the target test case, and compare each page element in the target test case with the element sequence in turn according to the running order of the target test case to obtain a comparison result; in response to the comparison result being different, the elements of the page in the target test case are updated to the corresponding elements in the element sequence; when the target test case is run, the test case that has ended is determined to be the target test case. In this way, in an embodiment of the present invention, a target test case can be determined from the generated test cases according to the generation instructions, and the differences from the test cases required by the generation instructions can be determined by running the target test case, and then it can be updated in time, so that the test case to be generated can be obtained after the running of the target test case is completed, thereby improving the test case generation efficiency and testing efficiency.
[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Figure 1 is a schematic diagram of a main flow of a data processing method according to an embodiment of the present invention; Figure 2 is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention; Figure 3 is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention; Figure 4 is a schematic diagram of main units of a data processing apparatus according to an embodiment of the present invention; Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied; Figure 6 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0030] It should be pointed out that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict. The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. In the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, which should be considered as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0031] An embodiment of the present invention provides a data processing system, which can be used in a scenario of test case generation.
[0032] The embodiment of the present invention provides a data processing method, which can be executed by a data processing system. Figure 1 As shown, the method includes the following steps.
[0033] S101: In response to a test case generation instruction, obtain instruction information corresponding to the generation instruction, call a preset parsing model to parse the instruction information, and obtain corresponding text information.
[0034] Among them, the test case represents the case to be generated, and the generation instruction can be sent by an external system, which includes the requirements for the test case to be generated, so that the test case can be generated based on the requirements. The instruction information represents the specific requirements for generating the test case, which can be reflected by a variety of information, such as voice, text, etc. In the embodiment of the present invention, the instruction information can be obtained from the generation instruction, so as to convert it into text information by parsing the instruction information. The parsing model can be set and trained according to the requirements, for example, it can include a machine learning model, which parses the instruction information and can convert the requirements for generating the test case into text information.
[0035] Specifically, in the embodiment of the present invention, key information is extracted from the instruction information through a parsing model, such as extracting key words or keywords, to obtain key text information representing the test case to be generated.
[0036] In one embodiment, this step can be specifically performed as follows: calling a preset parsing model to convert the instruction information into a text format, splitting the instruction information in the text format based on preset identifiers, and waiting for each text segment; generating a text sequence based on the splitting order and each text segment to determine the text information corresponding to the instruction information.
[0037] The parsing model can first convert the instruction information into a text format, and then split the instruction information in the text format by parsing the text content to obtain various text segments, and then extract key information from each text segment to obtain the text information corresponding to each text segment, so that the text information corresponding to each text segment can be arranged in the splitting order to obtain a text sequence.
[0038] For example, the generated instruction can be specifically a voice instruction, such as "I want to test whether the process of generating business approval is normal, where the saleable product is domestic factoring, the nature of the business is general business, and the declaration process mode is the green channel mode." The instruction information that can be output in advance includes: "Business approval process, the saleable product is domestic factoring, the nature of the business is general business, and the declaration process mode is the green channel mode." Then, after parsing through the parsing model, the text information that can be obtained includes: "Business approval process, domestic factoring, general business, green channel mode."
[0039] It should be noted that, in the embodiment of the present invention, in order to make the generated test case more accurate, more relevant requirement information of the test case can be input when inputting the generation instruction, so that more information of the test case can be included in the text information, thereby improving the accuracy of the generated test case. In this step, the text information can store the required information in the form of key-value pairs, such as the key is the process and the corresponding value is the business approval, the key is the saleable product and the corresponding value is domestic factoring, so as to facilitate subsequent processing.
[0040] In an embodiment of the present invention, in order to facilitate subsequent test case generation, the generation instructions may also include a description of the test function requirements, so the text information may also include features corresponding to the test function, such as descriptive features of the test function, which may specifically be a function number, function identifier, or function text description, etc.; further, the generation instructions may also include detailed information of the page corresponding to the function to be tested, such as element information in the corresponding page, so the text information may also include detailed information of the page corresponding to the function to be tested.
[0041] S102: Identify process keywords in the text information, and query a matching test case set from a data dictionary based on the keywords.
[0042] The text information includes information about the test case to be generated, from which a process keyword can be identified. The process keyword represents key information about the business process to which the test case to be generated belongs, so as to match the test case of the corresponding business process. The data dictionary can be pre-established, specifically based on the attribute information of each generated test case. The attribute information can include process keywords, so it can be used for matching test cases. The test case set can include at least one generated test case.
[0043] It should be noted that in the embodiment of the present invention, the process keyword may include one or more process keywords, which may be set according to the requirements. For example, the process keyword may include the value corresponding to the process in the text information, that is, the business approval, or may include the process and the saleable products in the text information, that is, the business approval and domestic factoring. If the test case set obtained in this step does not include the generated test case, it means that the test case matching is unsuccessful, and the required test case can be directly created at this time.
[0044] S103: For each test case in the test case set, extract the page function list of the test case to match it with the text information, and determine the target test case according to the matching result.
[0045] The page function list may include a list of functions implemented by each page in the test case, which may represent the functions of each tested page in the test case. The page function list is matched with the text information to determine whether the generated test case includes the function page required this time, and then the target test case may be determined therefrom. The matching result may include a matching degree, which is the matching degree between the page function list and the text information in the test case.
[0046] Specifically, determining the target test case in this step can be performed as follows: extracting the page function list of the test case, obtaining the corresponding function description features, identifying the function description features from the text information, and obtaining the recognition result; in response to the recognition result meeting the preset conditions, determining the test case as the target test case.
[0047] For each page in the test case, the page function can be described through the description information, so in this step, the corresponding functional description features in the page function list can be obtained, and then the functional description features can be identified from the text information. The recognition result is equivalent to the matching result between the page function list and the text information. Generally, the higher the recognition result, the more the functional description features can meet the requirements of generating the test case, that is, the higher the matching degree. The preset condition can be set according to the requirements, for example, the recognition result can be greater than the preset threshold, and the preset threshold is preset.
[0048] It should be noted that, in the embodiment of the present invention, if multiple target test cases are determined for the test cases in the test case set, the test case with the best matching result may be selected as the target test case.
[0049] S104: extracting the element sequence of each page based on the text information, running the target test case, and comparing each page element in the target test case with the element sequence in turn according to the running order of the target test case to obtain a comparison result.
[0050] After determining the target test case, the target test case can be run. During the running, the target test case will call the elements of the corresponding page in sequence according to the arrangement order and display the update process of the page by calling the elements of the page, thereby showing the test process of the target test case. In the embodiment of the present invention, the element sequence of the test case to be generated can be extracted in advance, and then during the running process of the target test case, the called page elements are compared with the element sequence according to the running order to determine whether they are consistent, so as to obtain a comparison result.
[0051] It should be noted that the element sequence of each page can be extracted from the text information, or can be obtained based on the text information. For example, in the embodiment of the present invention, the element sequence of each page can be extracted based on the test function script corresponding to the test case to be generated. The test function script can be pre-set, so the calling elements and calling order of each page can be directly determined based on the test function, and the corresponding element sequence can be determined; or the text information can include detailed information of the page corresponding to the function to be tested to generate the corresponding element sequence.
[0052] In another embodiment, the comparison result obtained in this step can be specifically executed as follows: in response to the program corresponding to the page element being called, the element identifier and input data of the program are obtained, the corresponding target element is queried from the element sequence based on the element identifier, and the configuration parameters of the target element are obtained to compare the input data and the configuration parameters to obtain a comparison result.
[0053] When an element is called in a page, an element identifier and input data are usually used. The element identifier indicates which element is called, and the input data indicates the data that needs to be input when the element is displayed on the page. This input data can be determined according to the scenario. When no input data is required, the input data obtained can be empty. Therefore, in this step, after obtaining the element identifier, the corresponding target element can be queried in the element sequence, that is, the target element that is consistent with the called element, and then the configuration parameters of the target element are obtained, that is, the input parameters of the target element, and the input data and configuration parameters are compared. If the comparison result is consistent, it can be said that the called element is consistent with the corresponding element in the element sequence, and no changes are required, and subsequent operations can be continued; if the comparison result is inconsistent, it can be said that the called element is inconsistent with the corresponding element in the element sequence, and changes are required to meet the requirements of the test case to be generated.
[0054] S105: In response to the comparison result being different, updating the elements of the page in the target test case to corresponding elements in the element sequence.
[0055] The comparison result is different, and the called element needs to be updated to the target element. Therefore, in this step, the elements of the page in the target test case are updated to the corresponding elements in the element sequence.
[0056] Specifically, this step can be performed as follows: obtaining a set of functional sub-elements corresponding to the page elements in the element sequence, obtaining component information associated with each functional sub-element, and updating the component information to the elements of the page in the target test case.
[0057] Since the elements in the page are usually implemented through components, the functional sub-element set corresponding to the page elements can be obtained in this step, that is, the element set corresponding to each sub-function included in the page element, and then the component information associated with each functional sub-element can be determined to update the components to the corresponding page elements in the target test case in sequence.
[0058] For example, if a page element called during the target test case does not exist in the element sequence, the page element can be directly deleted; when a page element is called during the target test case, an additional element function is added to the element sequence, such as an additional radio button for "Whether to add credit limit", the element list corresponding to the radio button can be obtained, and the element corresponding to the text "Whether to add credit limit" and the child element corresponding to the "Yes" element, that is, the radio button (radio-button), can be found from this child element. Then, the corresponding radio button with the text "Yes", that is, the clickable element, can be found, and combined with the "click" action, the component information of the additional element can be determined, and then updated to the page element corresponding to the target test case.
[0059] It should be noted that, since it is found through comparison in step S104 that the corresponding page elements in the target test case need to be updated, the associated component information corresponding to the page element can be obtained in this step to directly update the corresponding page elements in the target test case. In this way, the target test case can be run again to implement the test function of the test case in the embodiment of the present invention.
[0060] In another embodiment, in this step, the component type associated with each functional sub-element can be obtained to match the element of the corresponding page in the target test case; in response to a successful match, the component attribute value associated with the functional sub-element is obtained to update the element to the corresponding page in the target test case based on the attribute value; in response to an unsuccessful match, the component associated with the functional sub-element is obtained to update the element to the corresponding page in the target test case based on the component.
[0061] Match the component type associated with each functional sub-element with the element of the corresponding page in the target test case to determine whether the two are consistent; if the two are consistent, it means that the component types are the same, and the attribute values of the components can be directly adjusted; if the two are inconsistent, it means that the component types are different, and the component completion content needs to be updated, that is, the component associated with the functional sub-element is obtained, and it is updated to the element of the corresponding page in the target test case based on the component.
[0062] It should be noted that after this step is completed, the updated target test case can continue to be run. Since the elements in the page are updated, the updated functions can be displayed after running, thereby meeting the requirements for generating test cases.
[0063] S106: In response to the target test case being completed, generating a new test case based on the completed test case.
[0064] After the target test case is finished running, it means that the test case has been run based on the requirements of the generated instructions. This running process is the updated running process completed based on the target test case, so the test case that has finished running is the generated new test case.
[0065] In an embodiment of the present invention, a target test case can be determined from the generated test cases according to the generation instructions, and the differences from the test cases required by the generation instructions can be determined by running the target test case, and then it can be updated in time, so that the test case to be generated can be obtained after the running of the target test case is completed, thereby improving the generation efficiency and testing efficiency of the test cases.
[0066] Combine the following Figure 1 The embodiment shown in the figure specifically describes the method for data processing in the embodiment of the present invention. Figure 2 As shown, the method includes the following steps.
[0067] S201: In response to a test case generation instruction, obtain instruction information corresponding to the generation instruction.
[0068] S202: calling a preset parsing model to convert the instruction information into a text format, and splitting the instruction information in the text format into various text segments based on preset identifiers.
[0069] S203: Generate a text sequence based on the splitting order and each text segment to determine the text information corresponding to the instruction information.
[0070] S204: Identify process keywords in the text information, and query a matching test case set from a data dictionary based on the keywords.
[0071] S205: For each test case in the test case set, extract the page function list of the test case, obtain the corresponding function description features, and identify the function description features from the text information to obtain the identification result.
[0072] S206: In response to the recognition result satisfying a preset condition, determining the test case as a target test case.
[0073] S207: extracting the element sequence of each page based on the text information, running the target test case, and comparing each page element in the target test case with the element sequence in turn according to the running order of the target test case to obtain a comparison result.
[0074] S208: In response to the comparison result being different, updating the elements of the page in the target test case to corresponding elements in the element sequence.
[0075] S209: In response to the target test case being completed, generating a new test case based on the completed test case.
[0076] It should be noted that the data processing principle in the embodiment of the present invention is the same as Figure 1 The corresponding data processing principles in the illustrated embodiments are the same and will not be described in detail here.
[0077] Combine the following Figure 1 The embodiment shown in the figure specifically describes the method for data processing in the embodiment of the present invention. Figure 3 As shown, the method includes the following steps.
[0078] S301: In response to a test case generation instruction, obtain instruction information corresponding to the generation instruction, call a preset parsing model to parse the instruction information, and obtain corresponding text information.
[0079] S302: Identify process keywords in the text information, and query a matching test case set from a data dictionary based on the keywords.
[0080] S303: For each test case in the test case set, extract the page function list of the test case to match it with the text information, and determine the target test case according to the matching result.
[0081] S304: Extracting element sequences of each page from the text information and running target test cases.
[0082] S305: In response to the program corresponding to the page element being called, the element identifier and input data of the program are obtained, the corresponding target element is searched from the element sequence based on the element identifier, and the configuration parameters of the target element are obtained to compare the input data and the configuration parameters to obtain a comparison result.
[0083] S306: In response to the comparison result being different, updating the elements of the page in the target test case to corresponding elements in the element sequence.
[0084] S307: In response to the target test case being completed, generating a new test case based on the completed test case.
[0085] It should be noted that the data processing principle in the embodiment of the present invention is the same as Figure 1 The corresponding data processing principles in the illustrated embodiments are the same and will not be described in detail here.
[0086] In order to solve the problems existing in the prior art, the embodiment of the present invention provides a device 400 for storing data blackcurrants, such as Figure 4 As shown, the device 400 includes: a parsing unit 401, which is used to respond to the generation instruction of the test case, obtain the instruction information corresponding to the generation instruction, call the preset parsing model to parse the instruction information, and obtain the corresponding text information; a matching unit 402, which is used to identify the process keywords in the text information, and query the matching test case set from the data dictionary based on the keywords; a determination unit 403, which is used to extract the page function list of the test case for each test case in the test case set to match with the text information, so as to determine the target test case according to the matching result; a comparison unit 404, which is used to extract the element sequence of each page based on the text information, run the target test case, and compare each page element in the target test case with the element sequence in turn according to the running order of the target test case to obtain a comparison result; an updating unit 405, which is used to update the elements of the page in the target test case to the corresponding elements in the element sequence in response to the comparison result being different; the determination unit 403 is also used to generate a new test case based on the test case that has been run and finished in response to the target test case.
[0087] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 The method of the illustrated embodiment is the same and will not be repeated here.
[0088] In one embodiment, the updating unit is specifically used to: obtain a set of functional sub-elements corresponding to the page elements in the element sequence, obtain component information associated with each of the functional sub-elements, and update the component information to the elements of the page in the target test case.
[0089] In another embodiment, the updating unit is specifically used to: obtain the component type associated with each of the functional sub-elements to match the elements of the corresponding page in the target test case; in response to a successful match, obtain the component attribute value associated with the functional sub-element to update it to the element of the corresponding page in the target test case based on the attribute value; in response to an unsuccessful match, obtain the component associated with the functional sub-element to update it to the element of the corresponding page in the target test case based on the component.
[0090] In another embodiment, the comparison unit is specifically used to: in response to the program corresponding to the page element being called, obtain the element identifier and input data of the program, query the corresponding target element from the element sequence based on the element identifier, and obtain the configuration parameters of the target element to compare the input data and the configuration parameters to obtain a comparison result.
[0091] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 , 2 , and 3 are the same as the embodiments shown in FIG. 3 and will not be described again here.
[0092] In an embodiment of the present invention, a target test case can be determined from the generated test cases according to the generation instructions, and the differences from the test cases required by the generation instructions can be determined by running the target test case, and then it can be updated in time, so that the test case to be generated can be obtained after the running of the target test case is completed, thereby improving the generation efficiency and testing efficiency of the test cases.
[0093] According to an embodiment of the present invention, the embodiment of the present invention further provides an electronic device and a readable storage medium.
[0094] The electronic device of an embodiment of the present invention comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the data processing method provided by the embodiment of the present invention.
[0095] Figure 5 An exemplary system architecture 500 is shown to which the data processing method or data processing apparatus according to the embodiment of the present invention can be applied.
[0096] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0097] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various client applications can be installed on the terminal devices 501, 502, 503.
[0098] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0099] The server 505 may be a server that provides various services. The server may analyze and process the received data such as the product information query request, and feed back the processing result (such as product information - just an example) to the terminal device.
[0100] It should be noted that the data processing method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the data processing device is generally set in the server 505 .
[0101] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0102] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 suitable for implementing an embodiment of the present invention. Figure 6 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0103] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0104] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0105] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0106] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0107] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a parsing unit, a matching unit, a determination unit, a comparison unit, and an update unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the parsing unit may also be described as a "unit of the function of the parsing unit".
[0109] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the data processing method provided by the present invention.
[0110] As another aspect, the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the data processing method provided by an embodiment of the present invention.
[0111] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for data processing, characterized in that: include: In response to a test case generation instruction, obtaining instruction information corresponding to the generation instruction, calling a preset parsing model to parse the instruction information to obtain corresponding text information; Identify process keywords in the text information, and query a matching test case set from a data dictionary based on the keywords; For each test case in the test case set, extracting a page function list of the test case to match with the text information, so as to determine a target test case according to the matching result; Extracting the element sequence of each page from the text information, running the target test case, and comparing each page element in the target test case with the element sequence in sequence according to the running order of the target test case to obtain a comparison result; In response to the comparison result being different, updating the elements of the page in the target test case to corresponding elements in the element sequence; In response to the target test case being completed, a new test case is generated based on the completed test case.
2. The method according to claim 1, characterized in that Updating the elements of the page in the target test case to corresponding elements in the element sequence includes: A set of functional sub-elements corresponding to the page elements in the element sequence is obtained, and component information associated with each of the functional sub-elements is obtained, so as to update the component information to the elements of the page in the target test case.
3. The method according to claim 2, characterized in that Obtaining component information associated with each of the functional sub-elements to update the component information to the elements of the page in the target test case, including: Obtaining a component type associated with each of the functional sub-elements to match an element of a corresponding page in the target test case; In response to a successful match, the component attribute value associated with the functional sub-element is obtained, and updated to the element of the corresponding page in the target test case based on the attribute value; in response to an unsuccessful match, the component associated with the functional sub-element is obtained, and updated to the element of the corresponding page in the target test case based on the component.
4. The method according to claim 1, characterized in that: Compare each page element in the target test case with the element sequence to obtain a comparison result, including: In response to the program corresponding to the page element being called, the element identifier and input data of the program are obtained, the corresponding target element is queried from the element sequence based on the element identifier, and the configuration parameters of the target element are obtained to compare the input data with the configuration parameters to obtain a comparison result.
5. The method according to claim 1, characterized in that Extracting a page function list of the test case to match with the text information, and determining a target test case according to the matching result, including: Extracting a page function list of the test case, obtaining corresponding function description features, identifying the function description features from the text information, and obtaining a recognition result; In response to the recognition result satisfying a preset condition, the test case is determined as a target test case.
6. The method according to claim 1, characterized in that Calling a preset parsing model to parse the instruction information to obtain corresponding text information, including: Calling a preset parsing model to convert the instruction information into a text format, and splitting the instruction information in the text format into various text segments based on preset identifiers; A text sequence is generated based on the splitting order and the text segments to determine the text information corresponding to the instruction information.
7. A data processing device, characterized in that: include: A parsing unit, configured to, in response to a test case generation instruction, obtain instruction information corresponding to the generation instruction, and call a preset parsing model to parse the instruction information to obtain corresponding text information; A matching unit, configured to identify a process keyword in the text information, and query a matching test case set from a data dictionary based on the keyword; A determination unit, configured to extract, for each test case in the test case set, a page function list of the test case to match with the text information, and determine a target test case according to the matching result; A comparison unit, configured to extract an element sequence of each page based on the text information, and to run the target test case, so as to compare each page element in the target test case with the element sequence in sequence according to the running order of the target test case, and obtain a comparison result; an updating unit, configured to update the elements of the page in the target test case to corresponding elements in the element sequence in response to the comparison result being different; The determining unit is configured to generate a new test case based on the test case that has been completed in response to the target test case being completed.
8. The device according to claim 7, characterized in that The updating unit is specifically used for: A set of functional sub-elements corresponding to the page elements in the element sequence is obtained, and component information associated with each of the functional sub-elements is obtained, so as to update the component information to the elements of the page in the target test case.
9. The device according to claim 8, characterized in that The updating unit is specifically used for: Obtaining a component type associated with each of the functional sub-elements to match an element of a corresponding page in the target test case; In response to a successful match, obtaining a component attribute value associated with the functional sub-element, so as to update the component attribute value to an element of a corresponding page in the target test case based on the attribute value; In response to a match failure, a component associated with the functional sub-element is obtained, so as to update the component to an element of a corresponding page in the target test case.
10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for generating automatic test codes
CN108710571A
Test case generation method and device
CN113360405A
Code-free page automatic test method and device, electronic equipment and medium
CN115292187A
Automatic case testing method, automatic case testing device and storage medium
CN115658532A
Test case processing method and device, computer equipment and storage medium
CN115729822A