Test processing method and device, electronic equipment and storage medium
By automatically generating and correcting test operation sequences, and combining model location and execution of test controls, the problems of high maintenance costs and low efficiency in UI automation testing are solved, achieving efficient and stable automation testing.
Patent Information
- Application Number
- CN202411189383.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2026-03-13
AI Technical Summary
Existing UI automation testing technologies suffer from high maintenance costs and low testing efficiency, while recording and playback testing technologies struggle to adapt to changes in the UI interface, resulting in non-standard test cases and low test success rates.
By acquiring the preset operation sequences of the current test case and the reference test case, the test operation sequence is automatically generated using the operation sequence generation model. Combined with the preset standard operation and the correction model, the test control is automatically located and executed, thus achieving automated testing.
It improved testing efficiency and success rate, reduced testing maintenance costs, ensured the accuracy and executability of operation execution information, and improved the stability and success rate of testing.
Smart Images

Figure CN121658356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing technology, and in particular to a test processing method, apparatus, electronic device and storage medium. Background Technology
[0002] With the advancement of internet technology, the testing needs of various applications are constantly increasing. Common application testing techniques mainly fall into two categories: UI (User Interface) automated testing and recording / playback testing. UI automated testing typically involves providing a pre-packaged underlying driver framework, relying on testers to write automated test scripts. However, with rapid iterations of product features and changes in requirements, testers are overwhelmed by the time spent maintaining and adjusting test scripts and test cases, resulting in high maintenance costs and low testing efficiency. Recording / playback testing generates corresponding operation scripts based on recording, reducing the barrier to script writing for testers. However, the workload for maintaining these scripts remains high, and they cannot effectively adapt to UI changes and adjustments. Furthermore, test cases are often non-standardized, and understanding and translating them into automated scripts is costly and prone to errors, leading to low test success rates and efficiency. Summary of the Invention
[0003] This application provides a test processing method, apparatus, equipment, storage medium, and computer program product that can realize automated testing, greatly improving test efficiency and success rate while significantly reducing test maintenance costs.
[0004] On the one hand, this application provides a test processing method, the method comprising:
[0005] Obtain the current test case, the reference test case corresponding to the current test case, and the preset test operation sequence corresponding to the reference test case;
[0006] The current test case, the reference test case, and the preset test operation sequence are input into the operation sequence generation model for operation sequence generation processing to obtain the current test operation sequence corresponding to the current test case. The current test operation sequence includes at least one set of test operation information. Any set of test operation information includes the operation description text of at least one test operation corresponding to the current test case, the operation execution information corresponding to the at least one test operation, and the expected execution result corresponding to the at least one test operation.
[0007] The operation execution information in the current test operation sequence is corrected to obtain a corrected test operation sequence;
[0008] During the testing process based on the modified test operation sequence, the current page information of the current test page corresponding to the current test operation in the modified test operation sequence is obtained;
[0009] The current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation are input into the test control positioning model for control positioning processing to determine the current test control corresponding to the current test operation;
[0010] The current test operation is automatically executed on the current test control to obtain the test result data corresponding to the current test operation.
[0011] On the other hand, a test processing apparatus is provided, the apparatus comprising:
[0012] The data acquisition module is configured to execute a preset test operation sequence to acquire the current test case, the reference test case corresponding to the current test case, and the reference test case.
[0013] The operation sequence generation module is configured to perform operation sequence generation processing by inputting the current test case, the reference test case, and the preset test operation sequence into the operation sequence generation model to obtain the current test operation sequence corresponding to the current test case. The current test operation sequence includes at least one set of test operation information. Any set of test operation information includes operation description text of at least one test operation corresponding to the current test case, operation execution information corresponding to the at least one test operation, and expected execution result corresponding to the at least one test operation.
[0014] The correction processing module is configured to perform correction processing on the operation execution information in the current test operation sequence to obtain a corrected test operation sequence.
[0015] The first page information acquisition module is configured to acquire the current page information of the current test page corresponding to the current test operation in the modified test operation sequence during the test process based on the modified test operation sequence.
[0016] The control positioning module is configured to perform control positioning processing by inputting the current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test control positioning model to determine the current test control corresponding to the current test operation.
[0017] The test execution module is configured to automatically perform the current test operation on the current test control and obtain the test result data corresponding to the current test operation.
[0018] On the other hand, an electronic device is provided, including: a processor;
[0019] Memory used to store the processor's executable instructions;
[0020] The processor is configured to execute the instructions to implement the test processing method described in any of the preceding claims.
[0021] On the other hand, a computer-readable storage medium is provided, which, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform any of the above-described test processing methods.
[0022] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the test processing methods provided in the various optional implementations described above.
[0023] The testing and processing method, apparatus, equipment, storage medium, and computer program product provided in this application have the following technical effects:
[0024] During testing, this application acquires the current test case, its corresponding reference test case, and the preset test operation sequence corresponding to the reference test case. These are then input into an operation sequence generation model for processing, resulting in the current test operation sequence corresponding to the current test case. This model can automatically generate test operation sequences for each test case. Furthermore, combining the reference test case and its corresponding preset test operation sequence helps the model better understand the specific intent and operation steps of the current test case. This improves both the efficiency and effectiveness of the generated test operation sequence. Additionally, the application corrects the operation execution information in the model's output current test operation sequence to obtain corrected test operations. The sequence effectively ensures the accuracy and executability of operation execution information, thereby improving the stability and success rate of testing. Next, during testing based on the corrected test operation sequence, the current page information corresponding to the current test page in the corrected test operation sequence is obtained. The current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation are input into the test control positioning model for control positioning processing to determine the current test control corresponding to the current test operation. The current test operation is automatically executed on the current test control to obtain the test result data corresponding to the current test operation. This enables automated testing without the need for manual understanding of test cases, significantly improving testing efficiency and success rate while greatly reducing test maintenance costs. Attached Figure Description
[0025] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of the application environment of a test processing method provided in an embodiment of this application;
[0027] Figure 2 This is a flowchart illustrating a testing process provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram illustrating an embodiment of the present application, in which the current test case, a reference test case, and a preset test operation sequence are input into an operation sequence generation model for operation sequence generation processing to obtain the current test operation sequence corresponding to the current test case;
[0029] Figure 4 This is a schematic diagram of a current test page provided in an embodiment of this application;
[0030] Figure 5 This is a partial schematic diagram of a test processing system provided in an embodiment of this application;
[0031] Figure 6 This is a partial schematic diagram of another test processing system provided in an embodiment of this application.
[0032] Figure 7 This is a schematic diagram of the structure of a test processing device provided in an embodiment of this application;
[0033] Figure 8 This is a block diagram of an electronic device for test processing provided in an embodiment of this application;
[0034] Figure 9 This is a block diagram of another electronic device for test processing provided in an embodiment of this application. Detailed Implementation
[0035] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0037] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0038] Please see Figure 1 , Figure 1 This is a schematic diagram of the application environment of a test processing method provided in an embodiment of this application. The application environment may include at least a server 100 and a test terminal 200.
[0039] In an optional embodiment, server 100 can be used to provide background services for the testing process of the test terminal. Specifically, the server can combine a pre-trained operation sequence generation model (large language model) to understand test cases and generate test operation sequences, and automatically execute test operations on the test terminal 200 by driving an automation engine. Furthermore, the server can record the test result data corresponding to the test operations by means of automatic screenshots or screen recording. Accordingly, users can record test result data according to actual needs. Specifically, server 100 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0040] In an optional embodiment, the test terminal 200 can run the application under test and perform test processing during the test. Specifically, the test terminal 200 may be, but is not limited to, electronic devices such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, in-vehicle terminals, and smart TVs; it may also be software running on the aforementioned electronic devices, such as applications or mini-programs. The operating system running on the electronic device in this embodiment may include, but is not limited to, Android, iOS, Linux, and Windows.
[0041] In addition, it should be noted that, Figure 1 The examples shown are merely one application environment for a test processing method, and the embodiments in this specification are not limited to the above.
[0042] In the embodiments described in this specification, the server 100 and the test terminal 200 can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this.
[0043] The following describes a test processing method of this application. Figure 2 This is a flowchart illustrating a testing process method provided in an embodiment of this application. This specification provides method operation steps as shown in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many, and does not represent the only execution order. In actual system or server product execution, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown... Figure 2 As shown, the method may include:
[0044] S201: Obtain the current test case, the reference test case corresponding to the current test case, and the preset test operation sequence corresponding to the reference test case.
[0045] In a specific embodiment, the current test case can be the current test case of the application under test. Specifically, the current test case can be test content described by natural language text. Specifically, the current test case can include entry description text, precondition description text, operation step description text, and expected result description text. Specifically, the entry description text can be the description text of the entry information corresponding to the current test page; the precondition description text can be the description text of the prerequisites for test execution; the operation step description text can be the description text of at least one test operation during test execution; and the expected result description text can be the expected execution result after executing the test operation. For example, the entry description text in the current test case can include: Homepage - Workbench - Leave Assistant; the precondition description text in the current test case can include: Execute in privacy mode; the operation step description text in the current test case can include: 1. Scroll to the bottom of the page; 2. Open Leave Management; 3. Initiate Leave Request; 4. Enter a leave reason exceeding 15 characters and submit; the expected result description text in the current test case can include: Normally enter the leave request page and successfully submit the leave reason.
[0046] In one specific embodiment, multiple preset test cases can be pre-set, along with their corresponding test case feature information and preset test operation sequences. Specifically, the test case feature information corresponding to the current test case can be obtained, and the similarity between the current test case feature information and the test case feature information corresponding to each of the multiple preset test cases can be determined. The preset test case with the highest similarity is used as the reference test case corresponding to the current test case. Specifically, the test case feature information can be obtained by performing feature extraction processing on the corresponding test cases using a pre-set feature extraction model. The similarity between test case feature information can include, but is not limited to, Euclidean distance, cosine distance, etc.
[0047] S203: Input the current test case, reference test case, and preset test operation sequence into the operation sequence generation model to process the operation sequence and obtain the current test operation sequence corresponding to the current test case.
[0048] In a specific embodiment, the operation sequence generation model can be a large language model used to generate operation sequences. The aforementioned current test operation sequence can include at least one set of test operation information. Any set of test operation information includes the operation description text of at least one test operation corresponding to the current test case, the operation execution information (step) corresponding to at least one test operation, and the expected execution result (assert) corresponding to at least one test operation. Specifically, the operation description text of at least one test operation in any set of test operation information can include the description text (origin_content) of that at least one test operation in the current test case. Optionally, because testers who write test cases have different expression habits, the original statements of test cases are usually difficult to standardize. Accordingly, during the operation sequence generation process, the operation sequence generation model can convert the original description text of the test operations in the test case (the description text in the current test case) into a general, human- and machine-understandable natural language description text. Correspondingly, the operation description text of at least one test operation in any set of test operation information can also include the description text (content) of that at least one test operation generated by the operation sequence generation model. In any set of test operation information, the execution information corresponding to at least one test operation can be the execution information of that at least one test operation; specifically, the execution information can include at least one test operation and the operation object corresponding to that at least one test operation; for example, <click, control 1>, where the test operation is click, and the operation object corresponding to the test operation is control 1. Specifically, the expected execution result corresponding to at least one test operation in any set of test operation information can be the expected execution result after that at least one test operation is executed.
[0049] In a specific embodiment, the relevant refinement of the preset test operation sequence can be found in the current test operation sequence described above, and will not be repeated here.
[0050] In a specific embodiment, such as Figure 3 As shown, Figure 3 This is a schematic diagram illustrating how an embodiment of this application inputs the current test case, a reference test case, and a preset test operation sequence into an operation sequence generation model for operation sequence generation processing to obtain the current test operation sequence corresponding to the current test case.
[0051] In the above embodiments, during the process of generating the current test operation sequence corresponding to the current test case by combining the operation sequence generation model, combining the reference test case and the preset test operation sequence corresponding to the reference test case can help the model better understand the specific intent and operation steps of the current test case. In this way, the effectiveness of the generated current test operation sequence can be improved on the basis of improving the efficiency of test operation sequence generation.
[0052] S205: Correct the operation execution information in the current test operation sequence to obtain a corrected test operation sequence.
[0053] In practical applications, test case writing may involve simplifying or omitting certain steps, or the operations themselves may be passive. This can lead to issues such as the model generating a test operation sequence that lacks necessary operations or fails to execute automatically. Optionally, the corresponding operation execution information can be corrected by combining it with the operation execution information corresponding to preset standard operations. Accordingly, the above-mentioned correction processing of the operation execution information in the current test operation sequence can yield a corrected test operation sequence that includes:
[0054] Obtain the operation feature information corresponding to each test operation in the current test operation sequence;
[0055] Based on the operation feature information corresponding to each test operation, the preset standard operation matching the first test operation is determined from the preset operation feature library;
[0056] Obtain the operation execution information corresponding to the preset standard operation matched by the first test operation;
[0057] Based on the operation execution information corresponding to the preset standard operation matched by the first test operation, update the operation execution information corresponding to the first test operation in the current test operation sequence to obtain the corrected test operation sequence.
[0058] In a specific embodiment, the operation feature information corresponding to each test operation can be obtained by combining a pre-set feature extraction model to extract features from the corresponding operation description text lines. Specifically, the preset operation feature library includes operation feature information corresponding to multiple preset standard operations; the first test operation is the test operation that matches the corresponding preset standard operation in the current test operation sequence; specifically, the similarity between the operation feature information corresponding to each test operation and the operation feature information corresponding to multiple preset standard operations can be determined, and the preset standard operation corresponding to the maximum similarity can be determined; if the maximum similarity is greater than a preset threshold, the preset standard operation corresponding to the maximum similarity can be used as the preset standard operation matching the corresponding test operation.
[0059] In one specific embodiment, the operation execution information corresponding to the preset standard operation can be pre-set. The operation execution information corresponding to the preset standard operation is standard and automatically executable operation information.
[0060] In an optional embodiment, updating the operation execution information corresponding to the first test operation in the current test operation sequence based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence may include:
[0061] If the preset standard operation matched by the first test operation belongs to the first type of preset standard operation, the operation execution information corresponding to the first test operation in the current test operation sequence is replaced based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence.
[0062] In a specific embodiment, the preset standard operation of the first type can be a fixed standard operation; correspondingly, the operation execution information corresponding to the first test operation in the current test operation sequence can be directly replaced based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence.
[0063] In a specific implementation, such as the test case of "making a voice call", the generated operation execution information could be <click, voice call>. However, the operation execution information corresponding to the preset standard operation we matched was <click, voice call>. We found that since the application is set to require a secondary selection of which type of call to make, we can replace the operation execution information <click, voice call> in the current test operation sequence with the matched operation execution information <click, voice call>.
[0064] In the above embodiments, when the preset standard operation matched by the first test operation belongs to the first type of preset standard operation, the operation execution information corresponding to the first test operation in the current test operation sequence is directly replaced based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain a corrected test operation sequence. This can translate the solidified natural language to action mapping into the existing operation sequence, effectively ensuring the accuracy and executability of the operation execution information of the first type of operation, thereby improving the stability and success rate of the test.
[0065] In an optional embodiment, updating the operation execution information corresponding to the first test operation in the current test operation sequence based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence may include:
[0066] If the preset standard operation matched by the first test operation belongs to the second type of preset standard operation, the operation execution information corresponding to the preset standard operation matched by the first test operation and the operation execution information corresponding to the first test operation are input into the first operation correction model for correction processing to obtain the corrected operation execution information corresponding to the first test operation.
[0067] Based on the corrected operation execution information, the operation execution information corresponding to the first test operation in the current test operation sequence is replaced to obtain the corrected test operation sequence.
[0068] In a specific embodiment, the second type of preset standard operation can be a passive preset standard operation. Correspondingly, in the first operation correction model, the operation execution information corresponding to the preset standard operation matched by the first test operation can be combined to correct the operation execution information corresponding to the first test operation, so as to obtain the corrected operation execution information corresponding to the first test operation.
[0069] In a specific embodiment, for example, "receiving a message", since receiving is a passive operation and cannot be directly automated. Therefore, the operation execution information in the current test operation sequence is <input, message bar ## message a><click, send>, and the operation execution information of the matched preset standard operation is {protocol_name: "<wk, receive message.content_type: text.msg_type: internal group chat.content: test>", action_name: "receive message"}. Therefore, <input, message bar ## message a><click, send> and {protocol_name: "<wk, receive message.content_type: text.msg_type: internal group chat.content: test>", action_name: "receive message"} can be input into the first operation correction model for correction processing, and the corrected operation execution information can be <wk, receive message.content_type: text.msg_type: internal group chat.content: test>, enabling the operation to be successfully executed.
[0070] In a specific embodiment, the first operation correction model can be a large language model used to combine the operation execution information corresponding to the matched preset standard operation for operation execution information correction.
[0071] In the above embodiment, when the preset standard operation matched by the first test operation belongs to the second type of preset standard operation, the operation execution information corresponding to the preset standard operation matched by the first test operation and the operation execution information corresponding to the first test operation are input into the first operation correction model for correction processing, and based on the corrected operation execution information corresponding to the first test operation, the operation execution information corresponding to the first test operation in the current test operation sequence is replaced. By combining the understanding and correction of the model, it can effectively ensure the accuracy and executability of the operation execution information of the second type of operation, thereby improving the stability and success rate of the test.
[0072] In the above embodiment, by determining the preset standard operation matched by the first test operation from the preset operation feature library and combining the operation execution information corresponding to the preset standard operation to correct the operation execution information in the current test operation sequence and the corresponding operation execution information, it can effectively ensure the accuracy and executability of the operation execution information, thereby improving the stability and success rate of the test.
[0073] In practical applications, for operations involving data such as numbers, times, ranges, etc., the operation execution information generated by the model often has problems such as insensitivity to boundary values. Optionally, the above method may further include:
[0074] Determine the second test operation of the target type in the current test operation sequence;
[0075] Correspondingly, the above-mentioned correction process for the operation execution information in the current test operation sequence to obtain the corrected test operation sequence may include:
[0076] Input the operation description text of the second test operation and the operation execution information corresponding to the second test operation into the second operation correction model for correction processing to obtain the corrected operation execution information corresponding to the second test operation;
[0077] Based on the corrected operation execution information corresponding to the second test operation, replace the operation execution information corresponding to the second test operation in the current test operation sequence to obtain the corrected test operation sequence.
[0078] In a specific embodiment, the target type may be an operation type involving numerical data such as numbers, time, ranges, etc. Specifically, the second operation correction model may be a large language model used to combine the operation description text for correcting the operation execution information.
[0079] In a specific embodiment, for example, "input the reason for leave exceeding 15 characters", usually according to the operation execution information in the current test operation sequence as <input, input box ## reason for leave exceeding 15 characters>. Optionally, rules need to be provided for the large language model to perform secondary understanding and creation. Finally, the output corrected operation execution information may be: <input, input box ## This is a reason for leave that exceeds 15 characters. I am taking leave because I am sick>.
[0080] In an optional embodiment, after combining the operation execution information corresponding to the preset standard operation to correct the corresponding operation execution information, further, correct the operation execution information corresponding to the second test operation of the target type; for example, "receive the mobile phone number sent in an internal one-on-one chat". The operation execution information corrected by combining the operation execution information corresponding to the preset standard operation may be <wk, receive message.content_type: text.msg_type: internal group chat.content: test>, but the specific parameters need to be further corrected in combination with the second operation correction model to obtain the corrected operation execution information as <wk, receive message.content_type: text.msg_type: internal one-on-one chat.content: 12345678>, so as to meet the final execution requirements of the test case.
[0081] In the above embodiments, after obtaining the current test operation sequence by combining the model, the operation execution information corresponding to the preset standard operation and the operation execution information corresponding to the second test operation for the target type are combined with the second operation correction model to perform correction and optimization in different dimensions, which can greatly improve the usability and stability of the test operation sequence and successfully improve the automation effect of test cases.
[0082] S207: During the testing process based on the modified test operation sequence, obtain the current page information of the current test page corresponding to the current test operation in the modified test operation sequence.
[0083] In a specific embodiment, during the testing process based on the modified test operation sequence, the current test operation information can be determined sequentially according to the order of each group of test operation information in the modified test operation sequence; specifically, the current test operation can be at least one test operation corresponding to the current test operation information.
[0084] In an optional embodiment, the current page information includes the target control description information corresponding to at least one test control in the current test page; optionally, obtaining the current page information of the current test page corresponding to the current test operation in the correction test operation sequence may include:
[0085] Get the control type, description information, and layout information of the original control in the current test page;
[0086] Based on control type and control layout information, at least one original text control and at least one original operation control in the current test page are aggregated to obtain target control description information corresponding to at least one test control.
[0087] In one specific embodiment, the current test page can be the page currently displayed during the testing of the application under test based on the current test case. Specifically, the control types mentioned above include operable control types (operable control types) and non-operable control types containing text (non-operable control types containing text). Specifically, the control type corresponding to the original control, the original control description information corresponding to the original control in the current test page, and the control layout information corresponding to the original control can be the preset page information of the current test page, which can be directly obtained.
[0088] In one specific embodiment, the original control description information can be attribute information describing the control, such as control type (class), text in the control (text), control identifier (ID), control meaning (content_desc), control orientation description information (bounds), etc. The control layout information can be the position information of the original control in the current test page, or the relative positional relationship between the original controls in the current test page, etc.
[0089] In a specific embodiment, the at least one original text control is a non-operational control type original control containing text, and the at least one original operation control is an operation control type original control; the at least one test control includes at least one aggregate control and at least one original operation control that is not aggregated with any original text control; the target control description information corresponding to any aggregate control is obtained by aggregating the original control description information of the two original controls corresponding to any aggregate control, and the two original controls include an original text control and an original operation control whose control layout information matches. The control layout information matching condition between an original text control and an original operation control can be set according to the actual application. For example, the control layout information of an original text control and an original operation control indicates that the original text control and the original operation control are on the same line, and accordingly, the control layout information matching between the original text control and the original operation control can be determined. Specifically, as shown in the example... Figure 4 As shown, Figure 4 This is a schematic diagram of a current test page provided in an embodiment of this application; combined with Figure 4 As can be seen, the original text control, which displays "Take a break" when notifying, matches the control layout information between it and the switch control on the right.
[0090] In one specific embodiment, in conjunction with the above... Figure 4As shown, assume that the original control description information of the original text control that displays "Take a break" when notified is: <text="Notify to display "Take a break"" class="RelativeLayout" id="common_item_right_container">; the original control description information of the switch control on the right side of the original text control is: <text="" class="RelativeLayout" id="common_item_switch" content_desc="false">; the target control description information of the switch control after aggregating the original text control that displays "Take a break" and the switch control can be <text="Switch that displays "Take a break" when notified, Status: Off" class="Switch" id="common_item_switch" content_desc="false">.
[0091] In the above embodiment, through the control type corresponding to the original control and the control layout information corresponding to the original control in the current test page, the aggregation processing is performed on at least one original text control and at least one original operation control in the current test page to obtain the target control description information corresponding to at least one test control. For the original control of the non-operation control type containing text, it can be allocated to the operable control by aggregation, achieving the effect of cleaning the non-operable control without losing the page text information, and reducing the subsequent data processing volume while ensuring the data validity.
[0092] In an optional embodiment, the above method may further include:
[0093] Obtain the page image of the current test page;
[0094] Based on the page image, perform positioning processing on at least one test control to obtain the control positioning information corresponding to at least one test control;
[0095] Update the control positioning information corresponding to at least one test control to the target control description information corresponding to at least one test control.
[0096] In a specific embodiment, the page image of the current test page can be obtained by screenshot or other means. Specifically, the control positioning information corresponding to any test control can be the orientation description information of the test control in the page image; for example, the page is divided into a 9-grid, and based on the control position information <x, y, height, width> (horizontal axis coordinates and the length and width of the control), it is converted into orientation description information such as upper left, lower left, upper, etc.
[0097] In one specific embodiment, updating the control positioning information corresponding to at least one test control to the target control description information corresponding to at least one test control can be done by adding control positioning information to the target control description information corresponding to at least one test control.
[0098] In the above embodiments, by using the page image of the current test page, at least one test control on the page is located to obtain the control location information corresponding to at least one test control, and the target control description information corresponding to at least one test control is updated. This can better enrich the description information of the control, greatly improve the subsequent understanding performance of the model on the control, more accurately locate the control that needs to be tested, and improve the accuracy and stability of the test.
[0099] In an optional embodiment, the above method may further include:
[0100] Get the image of the current test page;
[0101] Obtain the control image corresponding to at least one test control from the page image;
[0102] Based on the preset mapping information and the control image corresponding to at least one test control, determine the meaning of the preset control corresponding to at least one target test control;
[0103] Based on the preset control meanings, update the target control description information corresponding to at least one target test control.
[0104] In one specific embodiment, control images can be extracted from page images. In practical applications, during the application development phase, a mapping relationship between preset control images used in the development process and the preset control meanings corresponding to the preset control images can be established in advance to obtain the aforementioned preset mapping information. Specifically, the aforementioned preset mapping information consists of at least one preset control image in the current test page and the preset control meaning corresponding to each preset control image. The aforementioned at least one target test control is an aggregated control in which at least one test control has a corresponding preset control image. Specifically, the control image corresponding to at least one test control can be matched with at least one preset control image in the preset mapping information. If the control image corresponding to any test control is matched with a corresponding preset control image in the preset mapping information, the test control is the target test control, and the preset control meaning corresponding to the matched preset control image is updated to the target control description information corresponding to the target test control.
[0105] In the above embodiments, by obtaining the control image corresponding to at least one test control from the page image of the current test page, and combining the preset mapping information including at least one preset control image in the current test page and the preset control meaning corresponding to each preset control image, and the control image corresponding to at least one test control, the preset control meaning corresponding to at least one target test control is determined. Based on the preset control meaning, the target control description information corresponding to at least one target test control is updated. This can better enrich the description information of the control, greatly improve the subsequent model's understanding performance of the control, more accurately locate the control that needs to be tested, and improve the accuracy and stability of the test.
[0106] In an optional embodiment, before performing layout analysis on the original controls in the current test page based on the page image to obtain the control layout information corresponding to the original controls in the current test page, the method further includes:
[0107] Get the image of the current test page;
[0108] Perform text recognition on the page image to obtain at least one recognized text control;
[0109] Compare at least one recognized text control with at least one original text control to obtain the comparison result;
[0110] If the comparison result indicates that at least one text control exists that is not included in at least one original text control, update at least one original text control based on the newly added text control;
[0111] In one specific embodiment, text recognition technology can be used to perform text recognition on the page image to obtain at least one recognized text control. Specifically, the recognized text control can be a non-operational control containing text on the current test page, as determined by text recognition; that is, the control type of the recognized text control is a non-operational type containing text. Furthermore, at least one recognized text control can be compared with at least one original text control, and then the missing text control can be supplemented based on the comparison results. Specifically, the newly added text control is at least one text control that is not included in at least one original text control.
[0112] In a specific embodiment, updating at least one original text control based on a newly added text control may include: obtaining the control layout information corresponding to the newly added text control, and updating the control layout information corresponding to the newly added text control to the control layout information corresponding to at least one original text control; correspondingly, aggregating at least one original text control and at least one original operation control in the current test page based on the control type and control layout information to obtain target control description information corresponding to at least one test control may include: aggregating text controls and operation controls in the current test page based on the control type and control layout information corresponding to the updated control to obtain target control description information corresponding to at least one test control; wherein, the updated control includes at least one original text control, a newly added text control, and at least one original operation control.
[0113] In the above embodiments, text recognition is performed on the page image of the current test page to obtain at least one recognized text control. The at least one recognized text control is then compared with at least one original text control in the current test page to obtain a comparison result. The comparison result can then be used to supplement missing text controls, improve the comprehensiveness of controls in the page, better improve the subsequent model's understanding of the page, more accurately locate the controls that need to be tested, and improve the accuracy and stability of the test.
[0114] In an optional embodiment, the above method further includes:
[0115] Obtain a historical directed cycle graph, in which page identifiers are nodes, and the edge between any two nodes is the starting node of the edge, which corresponds to the target operation control and the target operation corresponding to the target operation control in the starting page, and the page to which the edge points is the page after the target operation is performed on the target operation control in the starting page;
[0116] Determine the current node corresponding to the current test page in the historical directed acyclic graph;
[0117] Based on the target edge and the node to which the target edge is pointed in the current node in the historical directed cyclic graph, determine at least one target filter control in the test control.
[0118] Filter the target control description information corresponding to the target filter control in the current page information.
[0119] In one specific embodiment, the historical directed cyclic graph can be generated by combining page navigation information during the historical usage or testing process of the application under test. Page identifiers can be used to distinguish pages with differences; specifically, the current node corresponding to the current test page in the historical directed cyclic graph can be determined by combining the current page identifier of the current test page.
[0120] In a specific embodiment, determining the target filtering control among at least one test control based on the target edge starting from the current node and the corresponding pointed-to node in the historical directed cyclic graph may include: inputting the current page information corresponding to the current node, the target edge starting from the current node, and the page information corresponding to the pointed-to node of the target edge into a preset control matching model for control matching, obtaining the matching result between at least one test control in the current page information and the control corresponding to the target edge; based on the matching result, selecting the test controls among at least one test controls that do not match the control corresponding to the target edge as target filtering controls. Specifically, the matching result may indicate whether each test control has a matching control corresponding to the target edge.
[0121] In a specific embodiment, during the control matching process of the preset control matching model, the page information of the page to which the edge jumps (the page of the node pointed to by the edge) can be combined to allow the model to better understand the control corresponding to the edge based on the jump relationship. In this way, it can know which edge corresponds to which test control and determine the target filter control that will not cause page change (page jump). Specifically, the preset control matching model can be a large language model used for control matching.
[0122] In the above embodiments, by combining the historical directed acyclic graph to filter out target filtering controls that will not cause page changes (page jumps), the amount of subsequent data processing can be reduced. Furthermore, by filtering out invalid data, the effectiveness of page information can be improved, thereby enhancing the subsequent model's understanding of controls on the page, more accurately locating the controls that need to be tested, and improving the accuracy and stability of the test.
[0123] In an optional embodiment, the current page information may further include page description information of the current test page; specifically, the page description information may be information describing the current test page, such as the page name of the current test page, the title of the current page, etc.
[0124] S209: Input the current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test control positioning model for control positioning processing to determine the current test control corresponding to the current test operation.
[0125] In a specific embodiment, the test control positioning model can be a large language model for control positioning. Exemplarily, assume that the operation description text "content" corresponding to the current test operation is: In the new group announcement page, upload a local file and save it. The operation execution information "step" corresponding to the current test operation is: <Click, upload a local file to publish a group announcement>; the expected execution result "assert" corresponding to the current test operation is that the file is successfully uploaded and return to the announcement publishing page. The page description information in the current page information is: xxxxx (page name) and Group Announcement (page title); there are at least three test controls in the current page information, and the target control description information of the three test controls is as follows:
[0126] index0: <text = "" class = "TextView" id = "top_bar_left_button1" bounds = "upper left corner">
[0127] index1: <text = "Edit" class = "TextView" id = "top_bar_right_button0" bounds = "upper right corner">
[0128] index2: <text = "" class = "WebView" id = "" inner_text1 = "; 44444413768; Just now; Avatar / Personal Information;" inner_text2 = "Group Announcement;;">
[0129] Furthermore, the current test operation can be a click, and the current test control corresponding to the current test operation determined by the test control positioning model can be the control with "Edit".
[0130] In an alternative embodiment, an execution agent can be set to run the test control positioning model for control positioning processing. Optionally, the test control positioning model can also output the selection reason corresponding to the current test control. For example, the selection reason corresponding to the above example can be that the current page is the group announcement editing page, and a local file needs to be uploaded and saved. According to the page control list, the following operations can be performed: 1. Click the Edit control at index1, perform the CLICK operation, and enter the file upload page. According to the expected operation content, the file needs to be uploaded first and then saved. Therefore, select to click the control with "Edit" and perform the CLICK operation.
[0131] S211: Automatically execute the current test operation on the current test control to obtain the test result data corresponding to the current test operation.
[0132] In one specific embodiment, when the current test control corresponding to the current test operation is determined, the current test operation can be automatically executed on the current test control, and the test result data corresponding to the current test operation can be recorded by means of automatic screenshot or screen recording; specifically, the test result data may include data reflecting the execution result of the current test operation, such as the page image after the current test operation is executed on the current test control.
[0133] In an optional embodiment, to verify whether the automatically executed test operations have been completed, the above method may further include:
[0134] Get the page information after the operation is executed. The page after the operation is executed is the page after the current test operation is performed on the current test control.
[0135] Input the current page information, the page information after execution, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test verification model for test verification, and determine the test verification result corresponding to the current test operation.
[0136] In a specific embodiment, the detailed process of obtaining the page information after execution can be found in the detailed process of obtaining the current page information described above, and will not be repeated here.
[0137] In a specific context, the test verification model can be a large language model used to verify whether the current test operation has been completed; correspondingly, the test verification result is used to indicate whether the current test operation has been completed. Specifically, incomplete execution can include execution failure and continued execution.
[0138] In one specific embodiment, if the test verification result indicates that the current test operation has been completed, the current test operation can be redefined and the test processing can continue; if the test verification result indicates that the current test operation has failed, the reset function can be called to return to the current test page and the test processing corresponding to the current test operation can be performed again; if the test verification result indicates that the current test operation should continue, the test verification model can also output a prompt message to continue execution.
[0139] In a specific embodiment, the test verification model can also output a reason for obtaining the test verification result. For example, in the example above where a local file is uploaded and saved on the new group announcement page, the test verification result continues to execute. The reason could be that, according to the operation display, the edit button was clicked on the group announcement editing page, which redirects to the group announcement editing page. It can be inferred that the user has not yet completed the file upload and the return to the announcement publishing page. Therefore, the goal has not been achieved, and execution continues. Correspondingly, the prompt message for continuing execution could be that the user should click the add file button on the group announcement editing page, select the local file and upload it, and then click the return button to complete the file upload and return to the announcement publishing page.
[0140] In an optional embodiment, a verification agent can be configured to verify whether the automated test operations have been completed.
[0141] In the above embodiments, after the test is automatically executed, the test verification model is input with the current page information, the page information after execution, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation. This can verify whether the automatically executed test operation has been completed, realize automatic test verification, and greatly improve the efficiency and convenience of verification in the application testing process.
[0142] In a specific embodiment, such as Figure 5 As shown, Figure 5 This is a partial schematic diagram of a test processing system provided in an embodiment of this application; specifically, in conjunction with... Figure 5As can be seen, this test processing system may include a test case-level understanding module, an action-level understanding module, a dataset understanding module, a preset test case feature library, a preset operation sequence library, a business logic feature library, a preset operation feature library, a preset operation execution library, and an operation API (Application Programming Interface). The test case library and test database consist of a pre-defined test case feature library, a pre-defined operation sequence library, and a business logic feature library. The pre-defined operation sequence library includes the feature information of multiple pre-defined test cases and their corresponding test case features. The business logic feature library includes the feature information of multiple pre-defined business logic information corresponding to the test scenario. The test case level understanding module includes a test case parser, an association logic parser, and an operation sequence generation model. The test case parser combines the feature information of each written test case (the current test case) with the feature information of multiple pre-defined test cases to determine the reference test case corresponding to the current test case, and then determines the pre-defined test operation sequence corresponding to the reference test case from the pre-defined operation sequence library. Next, the operation sequence generation model combines the current test case, the reference test case, and the pre-defined test operation sequence corresponding to the reference test case to generate the current test operation sequence corresponding to the current test case. Furthermore, to better understand the test cases, the association logic parser can be used to combine the feature information of the current test case with the feature information of multiple pre-defined business logic information to determine the reference business logic information corresponding to the current test case, and input this information into the operation sequence generation model for operation sequence generation. Specifically, the preset operation feature library can include operation feature information corresponding to multiple preset standard operations; the preset operation execution library can include operation execution information corresponding to multiple preset standard operations; further, the action-level understanding module can include a similar action parser, a first operation correction model, and a standard operation completion and replacement module; the similar action parser can combine the operation feature information corresponding to each test operation in the current test operation sequence to determine the preset standard operation (similar preset standard operation) matching the test operation from the preset operation feature library, and then combine the operation execution information corresponding to the similar preset standard operation and the operation execution information corresponding to the test operation to input the first operation correction model for correction processing; in addition, the standard operation completion and replacement module can also combine the operation execution information corresponding to the similar preset standard operation to directly replace the operation execution information corresponding to the test operation to correct the operation execution information; in addition, during the test, the corresponding API can be called to execute the test operation by combining the interface information of the API in the operation API library, and the action library can be completed by combining the execution results, and a corresponding historical directed graph can be constructed during the test.Furthermore, the dataset understanding module may include a second operation correction model, specifically, it can correct the operation execution information of test operations involving numbers, time, ranges, and other data in the current test operation sequence; furthermore, the corrected operation execution information can be stored in the test database. Further still, the written test cases can be manually checked and corrected in conjunction with the corrected test operation sequence, and a corresponding corrected test operation sequence can be generated based on the corrected test cases and the scheme provided in the embodiments of this application; further still, referring to the corrected test operation sequence, a full set of test cases can be written and reviewed to obtain more comprehensive and complete test cases.
[0143] In a specific embodiment, such as Figure 6 As shown, Figure 6 This is a partial schematic diagram of another test processing system provided in the embodiments of this application; specifically, in conjunction with... Figure 6 As can be seen, this test processing system can include: an operation sequence generation module, a page understanding module, an intelligent execution module, an automated verification module, and an automatic data generation module. Specifically, the operation sequence generation module can include a test case-level understanding module, an action-level understanding module, and a data-level understanding module. Specifically, the operation sequence generation module can be used to generate operation sequences, as detailed above. The page understanding module combines a control aggregation model, a text recognition module, and historical directed graphs to obtain the current page information corresponding to the current test page. Furthermore, the automatic data generation module can be used to generate test accounts with different attributes corresponding to the test scenario, and combine them with the test operation sequence in the intelligent execution model. During the execution of tests, corresponding APIs are called to perform test operations. Specifically, the intelligent execution module can include an execution agent and a verification agent. The execution agent runs the test control positioning model to perform control positioning processing and executes the corresponding tests. During test execution, it can call the corresponding APIs in conjunction with the system execution driver. The verification agent verifies whether the automated test operations have been completed. Specifically, during the verification process, the verification agent can combine the model's input prompts and input the current page information, the page information after execution, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test verification model for automatic verification. When using any large language model, it can be combined with a large language model framework for its use.
[0144] As can be seen from the technical solutions provided in the embodiments of this specification above, during the testing process, this specification obtains the current test case, the corresponding reference test case, and the preset test operation sequence corresponding to the reference test case. The current test case, the reference test case, and the preset test operation sequence are then input into an operation sequence generation model for operation sequence generation processing to obtain the current test operation sequence corresponding to the current test case. This model can automatically generate the test operation sequence corresponding to the test case. Furthermore, combining the reference test case and the preset test operation sequence corresponding to the reference test case helps the model better understand the specific intent and operation steps of the current test case. Therefore, it can improve the efficiency of test operation sequence generation, enhance the effectiveness of the generated current test operation sequence, and correct the operation execution information in the current test operation sequence output by the model. The process involves refining the test operation sequence to ensure the accuracy and executability of the operation execution information, thereby improving test stability and success rate. Next, during testing based on the refined test operation sequence, the current page information corresponding to the current test operation is obtained. This current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation are input into the test control positioning model for control positioning processing to determine the current test control corresponding to the current test operation. The current test operation is automatically executed on the current test control to obtain the corresponding test result data. This enables automated testing, eliminating the need for manual understanding of test cases and significantly improving testing efficiency and success rate while greatly reducing test maintenance costs.
[0145] Based on the testing method provided in this application embodiment, during the application testing process in the application to be tested, 86 test cases are used for testing, of which 82 test cases are successful, that is, the test success rate can reach 95%.
[0146] This application also provides a test processing device, such as... Figure 7 As shown, the above-mentioned device includes:
[0147] The data acquisition module 710 is configured to execute a preset test operation sequence to acquire the current test case, the reference test case corresponding to the current test case, and the reference test case.
[0148] The operation sequence generation module 720 is configured to perform operation sequence generation processing by inputting the current test case, the reference test case, and the preset test operation sequence into the operation sequence generation model to obtain the current test operation sequence corresponding to the current test case. The current test operation sequence includes at least one set of test operation information. Any set of test operation information includes operation description text of at least one test operation corresponding to the current test case, operation execution information corresponding to the at least one test operation, and expected execution result corresponding to the at least one test operation.
[0149] The correction processing module 730 is configured to perform correction processing on the operation execution information in the current test operation sequence to obtain a corrected test operation sequence;
[0150] The first page information acquisition module 740 is configured to acquire the current page information of the current test page corresponding to the current test operation in the modified test operation sequence during the test process based on the modified test operation sequence.
[0151] The control positioning module 750 is configured to perform control positioning processing by inputting the current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test control positioning model, thereby determining the current test control corresponding to the current test operation.
[0152] The test execution module 760 is configured to automatically perform the current test operation on the current test control and obtain the test result data corresponding to the current test operation.
[0153] In an optional embodiment, the correction processing module 730 includes:
[0154] The operation feature information acquisition unit is configured to acquire the operation feature information corresponding to each test operation in the current test operation sequence;
[0155] The operation matching unit is configured to perform an operation feature analysis based on the operation feature information corresponding to each test operation, and determine a preset standard operation that matches the first test operation from a preset operation feature library. The preset operation feature library includes operation feature information corresponding to multiple preset standard operations. The first test operation is the test operation that matches the corresponding preset standard operation in the current test operation sequence.
[0156] The execution information matching unit is configured to obtain the operation execution information corresponding to the preset standard operation matched by the first test operation;
[0157] The first execution information update unit is configured to update the operation execution information corresponding to the first test operation in the current test operation sequence by performing an operation execution information update based on the operation execution information corresponding to the preset standard operation matched by the first test operation, thereby obtaining the corrected test operation sequence.
[0158] In an optional embodiment, the first execution information update unit includes:
[0159] The second execution information update unit is configured to, when the preset standard operation matched by the first test operation belongs to the first type of preset standard operation, replace the operation execution information corresponding to the first test operation in the current test operation sequence with the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence.
[0160] In an optional embodiment, the first execution information update unit includes:
[0161] The first correction processing unit is configured to perform the following when the preset standard operation matched by the first test operation belongs to the second type of preset standard operation: input the operation execution information corresponding to the preset standard operation matched by the first test operation and the operation execution information corresponding to the first test operation into the first operation correction model for correction processing to obtain the corrected operation execution information corresponding to the first test operation.
[0162] The third execution information update unit is configured to replace the operation execution information corresponding to the first test operation in the current test operation sequence with the modified operation execution information to obtain the modified test operation sequence.
[0163] In an optional embodiment, the apparatus further includes:
[0164] The test operation determination module is configured to execute a second test operation that determines the target type in the current test operation sequence;
[0165] The correction processing module 730 includes:
[0166] The second correction processing unit is configured to input the operation description text of the second test operation and the operation execution information corresponding to the second test operation into the second operation correction model for correction processing, so as to obtain the corrected operation execution information corresponding to the second test operation.
[0167] The fourth execution information update unit is configured to execute the corrected operation execution information based on the second test operation, replace the operation execution information corresponding to the second test operation in the current test operation sequence, and obtain the corrected test operation sequence.
[0168] In an optional embodiment, the current page information includes target control description information corresponding to at least one test control in the current test page; the first page information acquisition module 740 includes:
[0169] The information acquisition unit is configured to acquire the control type corresponding to the original control in the current test page, the original control description information corresponding to the original control in the current test page, and the control layout information corresponding to the original control in the current test page. The control type includes an operation control type and a non-operation control type containing text.
[0170] The aggregation processing unit is configured to perform aggregation processing on at least one original text control and at least one original operation control in the current test page based on the control type and the control layout information, so as to obtain target control description information corresponding to at least one test control.
[0171] Wherein, the at least one original text control is an original control of a non-operational control type containing text, and the at least one original operation control is an original control of an operation control type; the at least one test control includes at least one aggregate control and an original operation control among the at least one original operation controls that is not aggregated with any original text control; the target control description information corresponding to any aggregate control is obtained by aggregating the original control description information of the two original controls corresponding to the any aggregate control, and the two original controls include an original text control and an original operation control whose control layout information is matched.
[0172] In an optional embodiment, the apparatus further includes:
[0173] The first page image acquisition module is configured to acquire the page image of the current test page;
[0174] The positioning processing module is configured to perform positioning processing on the at least one test control based on the page image to obtain the control positioning information corresponding to the at least one test control.
[0175] The first control description information update module is configured to update the control positioning information corresponding to the at least one test control to the target control description information corresponding to the at least one test control.
[0176] In an optional embodiment, the apparatus further includes:
[0177] The second page image acquisition module is configured to acquire the page image of the current test page;
[0178] The control image acquisition module is configured to acquire the control image corresponding to the at least one test control from the page image;
[0179] The preset control meaning determination module is configured to determine the preset control meaning corresponding to at least one target test control based on preset mapping information and control images corresponding to the at least one test control; the preset mapping information is at least one preset control image in the current test page and the preset control meaning corresponding to each preset control image; the at least one target test control is an aggregated control in the at least one test control that has a corresponding preset control image.
[0180] The second control description information update module is configured to update the target control description information corresponding to the at least one target test control based on the preset control meaning.
[0181] In an optional embodiment, the apparatus further includes:
[0182] The third page image acquisition module is configured to acquire the page image of the current test page;
[0183] The text recognition module is configured to perform text recognition on the page image before performing layout analysis on the original controls in the current test page based on the page image to obtain the control layout information corresponding to the original controls in the current test page, and to obtain at least one recognized text control.
[0184] The text control comparison module is configured to perform a comparison between the at least one identified text control and the at least one original text control to obtain a comparison result;
[0185] The text control update module is configured to update the at least one original text control based on the newly added text control if the comparison result indicates that the at least one text control contains a control not included in the at least one original text control;
[0186] The newly added text control is a control that is not included in the at least one original text control.
[0187] In an optional embodiment, the apparatus further includes:
[0188] The historical directed cycle graph acquisition module is configured to acquire a historical directed cycle graph, wherein the historical directed cycle graph uses page identifiers as nodes, and the edge between any two nodes is the target operation control in the starting page corresponding to the starting node of the edge and the target operation corresponding to the target operation control, and the page corresponding to the node to which the edge is pointed is the page after the target operation is performed on the target operation control in the starting page;
[0189] The node determination module is configured to determine the current node corresponding to the current test page in the historical directed acyclic graph.
[0190] The filter control determination module is configured to determine the target filter control in the at least one test control based on the target edge starting from the current node and the node pointed to by the target edge in the historical directed acyclic graph.
[0191] The control description information filtering module is configured to filter the target control description information corresponding to the target filter control in the current page information.
[0192] In an optional embodiment, the apparatus further includes:
[0193] The second page information acquisition module is configured to acquire the page information after the operation is performed, wherein the page after the operation is performed on the current test control;
[0194] The test verification module is configured to perform test verification by inputting the current page information, the page information after execution, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test verification model, and determine the test verification result corresponding to the current test operation.
[0195] The test verification result is used to indicate whether the current test operation has been completed.
[0196] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0197] Figure 8 This is a block diagram of an electronic device for test processing provided in an embodiment of this application. The electronic device can be a terminal, and its internal structure diagram can be as follows. Figure 8As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a test processing method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0198] Figure 9 This is a block diagram of another electronic device for test processing provided in an embodiment of this application. The electronic device can be a server, and its internal structure diagram can be as follows: Figure 9 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a test processing method.
[0199] Those skilled in the art will understand that Figure 8 or Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0200] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the test processing method as described in the embodiments of this disclosure.
[0201] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the test processing method in the embodiments of this disclosure.
[0202] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the test processing methods provided in the various optional implementations described above.
[0203] It is understood that in the specific implementation of this application, user-related data is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0204] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), modified SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0205] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0206] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A test processing method, characterized in that, The method includes: Obtain the current test case, the reference test case corresponding to the current test case, and the preset test operation sequence corresponding to the reference test case; The current test case, the reference test case, and the preset test operation sequence are input into the operation sequence generation model for operation sequence generation processing to obtain the current test operation sequence corresponding to the current test case. The current test operation sequence includes at least one set of test operation information. Any set of test operation information includes the operation description text of at least one test operation corresponding to the current test case, the operation execution information corresponding to the at least one test operation, and the expected execution result corresponding to the at least one test operation. The operation execution information in the current test operation sequence is corrected to obtain a corrected test operation sequence; During the testing process based on the modified test operation sequence, the current page information of the current test page corresponding to the current test operation in the modified test operation sequence is obtained; The current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation are input into the test control positioning model for control positioning processing to determine the current test control corresponding to the current test operation; The current test operation is automatically executed on the current test control to obtain the test result data corresponding to the current test operation.
2. The method according to claim 1, characterized in that, The step of correcting the operation execution information in the current test operation sequence to obtain the corrected test operation sequence includes: Obtain the operation feature information corresponding to each test operation in the current test operation sequence; Based on the operation feature information corresponding to each test operation, a preset standard operation matching the first test operation is determined from a preset operation feature library. The preset operation feature library includes operation feature information corresponding to multiple preset standard operations. The first test operation is the test operation that matches the corresponding preset standard operation in the current test operation sequence. Obtain the operation execution information corresponding to the preset standard operation matched by the first test operation; The operation execution information corresponding to the first test operation in the current test operation sequence is updated based on the operation execution information corresponding to the preset standard operation matched by the first test operation, so as to obtain the corrected test operation sequence.
3. The method according to claim 2, characterized in that, The step of updating the operation execution information corresponding to the first test operation in the current test operation sequence based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence includes: If the preset standard operation matched by the first test operation belongs to the first type of preset standard operation, the operation execution information corresponding to the first test operation in the current test operation sequence is replaced based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence.
4. The method according to claim 2, characterized in that, The step of updating the operation execution information corresponding to the first test operation in the current test operation sequence based on the operation execution information corresponding to the preset standard operation matched by the first test operation to obtain the corrected test operation sequence includes: If the preset standard operation matched by the first test operation belongs to the second type of preset standard operation, the operation execution information corresponding to the preset standard operation matched by the first test operation and the operation execution information corresponding to the first test operation are input into the first operation correction model for correction processing to obtain the corrected operation execution information corresponding to the first test operation. Based on the corrected operation execution information, the operation execution information corresponding to the first test operation in the current test operation sequence is replaced to obtain the corrected test operation sequence.
5. The method according to claim 1, characterized in that, The method further includes: Determine the second test operation of the target type in the current test operation sequence; The step of correcting the operation execution information in the current test operation sequence to obtain the corrected test operation sequence includes: The operation description text of the second test operation and the operation execution information corresponding to the second test operation are input into the second operation correction model for correction processing to obtain the corrected operation execution information corresponding to the second test operation. Based on the corrected operation execution information corresponding to the second test operation, the operation execution information corresponding to the second test operation in the current test operation sequence is replaced to obtain the corrected test operation sequence.
6. The method according to any one of claims 1 to 5, characterized in that, The current page information includes the target control description information corresponding to at least one test control in the current test page; The step of obtaining the current page information corresponding to the current test page in the corrected test operation sequence includes: Obtain the control type corresponding to the original control in the current test page, the original control description information corresponding to the original control in the current test page, and the control layout information corresponding to the original control in the current test page. The control type includes operation control type and non-operation control type containing text. Based on the control type and the control layout information, at least one original text control and at least one original operation control in the current test page are aggregated to obtain target control description information corresponding to at least one test control. Wherein, the at least one original text control is an original control of a non-operational control type containing text, and the at least one original operation control is an original control of an operation control type; the at least one test control includes at least one aggregate control and an original operation control among the at least one original operation controls that is not aggregated with any original text control; the target control description information corresponding to any aggregate control is obtained by aggregating the original control description information of the two original controls corresponding to the any aggregate control, and the two original controls include an original text control and an original operation control whose control layout information is matched.
7. The method according to claim 6, characterized in that, The method further includes: Obtain the page image of the current test page; Based on the page image, the location of the at least one test control is performed to obtain the control location information corresponding to the at least one test control; Update the control positioning information corresponding to the at least one test control to the target control description information corresponding to the at least one test control.
8. The method according to claim 6, characterized in that, The method further includes: Obtain the page image of the current test page; Obtain the control image corresponding to the at least one test control from the page image; Based on the preset mapping information and the control image corresponding to the at least one test control, the preset control meaning corresponding to the at least one target test control is determined; the preset mapping information is at least one preset control image in the current test page and the preset control meaning corresponding to each preset control image; the at least one target test control is an aggregated control in the at least one test control that has a corresponding preset control image. Based on the meaning of the preset control, update the target control description information corresponding to the at least one target test control.
9. The method according to claim 6, characterized in that, The method further includes: Obtain the page image of the current test page; Perform text recognition on the page image to obtain at least one recognized text control; The at least one recognized text control is compared with the at least one original text control to obtain a comparison result; If the comparison result indicates that the at least one text control contains a control that is not included in the at least one original text control, the at least one original text control is updated based on the newly added text control; The newly added text control is a control that is not included in the at least one original text control.
10. The method according to claim 6, characterized in that, The method further includes: Obtain a historical directed cycle graph, wherein the historical directed cycle graph uses page identifiers as nodes, and the edge between any two nodes is the target operation control in the starting page corresponding to the starting node of the edge and the target operation corresponding to the target operation control, and the page corresponding to the node to which the edge is pointed is the page after the target operation is performed on the target operation control in the starting page; Determine the current node corresponding to the current test page in the historical directed acyclic graph; Based on the target edge with the current node as the starting node and the node pointed to by the target edge in the historical directed cyclic graph, the target filtering control in the at least one test control is determined; Filter the target control description information corresponding to the target filter control in the current page information.
11. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Obtain the post-operation page information, where the post-operation page is the page after the current test operation is performed on the current test control; The current page information, the page information after execution, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation are input into the test verification model for test verification to determine the test verification result corresponding to the current test operation. The test verification result is used to indicate whether the current test operation has been completed.
12. A test processing apparatus, characterized in that, The device includes: The data acquisition module is configured to execute a preset test operation sequence to acquire the current test case, the reference test case corresponding to the current test case, and the reference test case. The operation sequence generation module is configured to perform operation sequence generation processing by inputting the current test case, the reference test case, and the preset test operation sequence into the operation sequence generation model to obtain the current test operation sequence corresponding to the current test case. The current test operation sequence includes at least one set of test operation information. Any set of test operation information includes operation description text of at least one test operation corresponding to the current test case, operation execution information corresponding to the at least one test operation, and expected execution result corresponding to the at least one test operation. The correction processing module is configured to perform correction processing on the operation execution information in the current test operation sequence to obtain a corrected test operation sequence. The first page information acquisition module is configured to acquire the current page information of the current test page corresponding to the current test operation in the modified test operation sequence during the test process based on the modified test operation sequence. The control positioning module is configured to perform control positioning processing by inputting the current page information, the operation execution information corresponding to the current test operation, the operation description text corresponding to the current test operation, and the expected execution result corresponding to the current test operation into the test control positioning model to determine the current test control corresponding to the current test operation. The test execution module is configured to automatically perform the current test operation on the current test control and obtain the test result data corresponding to the current test operation.
13. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the test processing method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the test processing method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the test processing method as described in any one of claims 1 to 11.