Test method, apparatus, and device

CN116340131BActive Publication Date: 2026-10-20DOUYIN VISION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111590405.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2026-10-20
Estimated Expiration
2041-12-23

AI Technical Summary

Benefits of technology

[0018]本公开实施例提供了一种测试方法、装置及设备,该方法包括:获取第一版本的目标软件的操作记录,该操作记录中包括用户在至少一个第一界面中执行的操作信息,该操作信息中包括对第一控件执行的第一操作,第一界面是第一版本的目标软件中的界面;从第二版本的目标软件中获取与第一界面匹配的第二界面,作为当前界面;若当前界面中存在第二控件,则对第二控件执行第二操作,第二操作用于对第二版本的目标软件中的该第二控件进行测试,第二控件与用户在第一界面中执行的操作信息中的第一控件匹配,第二操作与用户在第一界面中执行的操作信息中的第一操作一致。该第二控件是操作记录中存在的操作控件,也就是用户曾经真实操作过的控件。如此,可以保证第二操作与用户的真实操作一致,有助于提高测试的有效性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340131B_ABST
    Figure CN116340131B_ABST
Patent Text Reader

Abstract

The embodiment of the disclosure provides a test method, device and equipment, and relates to the technical field of automation testing. The method comprises the following steps: obtaining operation records of a target software of a first version, wherein the operation records comprise operation information of a user in at least one first interface, and the operation information comprises a first operation performed on a first control; obtaining a second interface matched with the first interface from a target software of a second version as a current interface; if the second control exists in the current interface, performing a second operation on the second control, the second operation is used for testing the second control in the target software of the second version, the second control is matched with the first control, and the second operation is consistent with the first operation. The second control is an operation control existing in the operation records, that is, a control that has been actually operated by the user. In this way, the second operation can be ensured to be consistent with the actual operation of the user, and the effectiveness of the test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of automated testing technology, and in particular to a testing method, apparatus, and device. Background Technology

[0002] In the field of computer software technology, software needs to be tested before release to ensure it functions correctly. For example, before an application is released, its installation, startup, and operation processes need to be thoroughly tested to ensure that users can use the application normally.

[0003] In the software testing process described above, if the testing process is consistent with the user's experience of using the software, then the test is considered highly effective. Therefore, improving the effectiveness of testing is a pressing issue that needs to be addressed. Summary of the Invention

[0004] This disclosure provides a testing method, apparatus, and device that can improve the effectiveness of testing.

[0005] In a first aspect, embodiments of this disclosure provide a testing method, the method comprising:

[0006] Obtain the operation record of the first version of the target software, the operation record including operation information performed by the user in at least one first interface, the operation information including a first operation performed on a first control, the first interface being the interface in the first version of the target software;

[0007] Obtain a second interface that matches the first interface from the second version of the target software, and use it as the current interface;

[0008] If a second control exists in the current interface, a second operation is performed on the second control. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface.

[0009] Secondly, embodiments of this disclosure provide a testing apparatus, the apparatus comprising:

[0010] An operation record acquisition module is used to acquire operation records of the first version of the target software. The operation records include operation information performed by the user in at least one first interface. The operation information includes a first operation performed on a first control. The first interface is an interface in the first version of the target software.

[0011] The current interface acquisition module is used to acquire a second interface that matches the first interface from the target software of the second version, and use it as the current interface;

[0012] The test execution module is used to perform a second operation on the second control if a second control exists in the current interface. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface.

[0013] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory;

[0014] The memory stores computer-executed instructions;

[0015] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in the first aspect.

[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in the first aspect.

[0017] Fifthly, embodiments of this disclosure provide a computer program for implementing the method as described in the first aspect.

[0018] This disclosure provides a testing method, apparatus, and device. The method includes: acquiring operation records of a first version of target software, the operation records including operation information performed by a user in at least one first interface, the operation information including a first operation performed on a first control, the first interface being an interface in the first version of the target software; acquiring a second interface matching the first interface from a second version of the target software, as the current interface; if a second control exists in the current interface, performing a second operation on the second control, the second operation being used to test the second control in the second version of the target software, the second control matching the first control in the operation information performed by the user in the first interface, and the second operation being consistent with the first operation in the operation information performed by the user in the first interface. The second control is an operation control existing in the operation records, that is, a control that the user has actually operated. This ensures that the second operation is consistent with the user's actual operation, helping to improve the effectiveness of the test. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram illustrating the relationship between the testing process and the development process to which this invention applies;

[0021] Figure 2 This is a flowchart of the steps of a testing method provided in an embodiment of this disclosure;

[0022] Figure 3 This is a schematic diagram of a tree structure of an interface provided in an embodiment of this disclosure;

[0023] Figure 4 This is a detailed process diagram of the testing method provided in the embodiments of this disclosure;

[0024] Figure 5 This is a structural block diagram of a testing device provided in an embodiment of this disclosure;

[0025] Figure 6 These are structural block diagrams of two electronic devices provided in embodiments of this disclosure. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0027] The embodiments disclosed herein can be applied to automated software testing scenarios. Automated software testing is typically performed after the software has been developed. In practice, the development process is usually carried out in multiple iterations or in parallel. Figure 1 This is a schematic diagram illustrating the relationship between the testing and development processes applicable to embodiments of the present invention. (Refer to...) Figure 1As shown, software module S1 and software module S2 are two independent modules. In actual development, they can be developed independently, with S1 undergoing test process T1 and S2 undergoing test process T2. Test processes T1 and T2 can also be independent. After software modules S1 and S2 pass the tests, they can be merged and tested in process T3. After test T3 passes, the software resulting from the merged modules S1 and S2 can be released.

[0028] This invention can be applied to any of the above-described testing processes. In these processes, it is typically necessary to generate test operations for testing. The generation strategy for these test operations can include both random and fixed methods. Randomly generated test operations are without a pattern, while test operations generated using a fixed strategy have inherent relationships. This inherent strategy tests all functions of the target software once.

[0029] However, the above two processes for generating test operations cannot accurately reflect the user's actual actions. Even if the test operation is executed to complete the test, in real-world applications, users may not perform the same actions as in the test, rendering the test ineffective and reducing its validity. For example, users frequently swipe up to refresh a video, but rarely set interface properties. However, the above random strategy randomly selects swipe-up and property setting operations, while the above inherent strategy tests these operations sequentially according to a preset order, without favoring swipe-up.

[0030] To address the aforementioned issues, embodiments of this disclosure can determine the test operation based on the user's actual operations. Specifically, the second control corresponding to the second operation to be performed can be obtained from the user's operation log, and the second operation can be executed on the second control to test it. This second control is an operation control existing in the operation log, that is, a control that the user has actually operated on. This ensures that the second operation is consistent with the user's actual operation, thus improving the effectiveness of the test.

[0031] The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present disclosure will now be described with reference to the accompanying drawings.

[0032] Figure 2 This is a flowchart of the steps of a testing method provided in an embodiment of this disclosure. Figure 2 The method shown can be applied to electronic devices. (See reference...) Figure 2 As shown, the test method includes:

[0033] S101: Obtain the operation record of the first version of the target software, which includes operation information performed by the user in at least one first interface, including a first operation performed on a first control, wherein the first interface is an interface in the first version of the target software.

[0034] The target software can be any software that needs to be tested, including but not limited to: applications and web pages.

[0035] Operation logs are the actual operation records of any user on the first version of the target software, and these operation logs can be captured online. A single operation log may include multiple operation information entries, some or all of which may have been performed on the same first interface or on different first interfaces.

[0036] The above-mentioned operation information can be sequential. For example, the operation record may include: {P1, AT1}->{P2, AT2}->{P1, AT3}->{P3, AT4}, where {P1, AT1} represents the operation information AT1 performed by the user in the first interface P1, {P1, AT1} represents the operation information AT2 performed by the user in the first interface P2, {P1, AT3} represents the operation information AT3 performed by the user in the first interface P1, and {P3, AT4} represents the operation information AT4 performed by the user in the first interface P3.

[0037] As can be seen, AT1, AT2, AT3, and AT4 are four operation information items arranged sequentially in the operation log, used to indicate the order of the user's first operation on the target software.

[0038] S102: Obtain the second interface that matches the first interface from the target software of the second version, and use it as the current interface.

[0039] The first interface and the second interface are the same interface, that is, the interface identifier of the first interface is the same as the interface identifier of the second interface.

[0040] It's understandable that the second and first versions are different versions of the same target software during the iterative development process. Therefore, the second and first versions typically share the same interface and controls.

[0041] S103: If a second control exists in the current interface, then a second operation is performed on the second control. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface, and the second operation is consistent with the first operation in the operation information performed by the user in the first interface.

[0042] The matching of the second control and the first control can be understood as the second control and the first control belonging to the same control. The difference is that the second control is the control in the current interface during the test process, while the first control is the control in the first interface in the operation record.

[0043] The second operation being identical to the first operation can include the second operation and the first operation having the same operation type. For example, both are click operations, or both are long press operations, or both are drag operations, etc.

[0044] Since the second control and the first control belong to the same control, the second operation is consistent with the first operation. Therefore, performing the second operation on the second control in the current interface is equivalent to performing the first operation on the first control in the first interface. The second operation is the test operation during the testing process, while the first operation is the user's actual operation. This ensures the consistency between the test operation and the real operation, which helps to improve the effectiveness of the test.

[0045] The aforementioned second control is the object to be performed on the second operation, and therefore needs to be determined before performing the second operation. Specifically, if the identification information of the third control in the current interface matches the identification information of the first control in the first interface, then the third control is determined as the second control. If the identification information of all controls in the current interface does not match the identification information of the first control in the first interface, then a fourth control that matches the attribute information of the first control in the first interface is determined from the current interface, and this fourth control is determined as the second control.

[0046] The third control is any control in the current interface whose identification information matches that of the first control. This identification information is a unique identifier for the control in the interface. For example, the interface can be understood as a tree structure, and this identification information can be the XPath path of the control in the tree structure. Figure 3 This is a schematic diagram of a tree structure of an interface provided in an embodiment of this disclosure. (Refer to...) Figure 3 As shown, the root node can be understood as the interface. The path of each control in this tree structure refers to the nodes that must be traversed to reach the control from the root node. For example, for control BT11, reaching control BT11 from the root node requires passing through "root node", "page element N1", and "control BT11" in sequence. Therefore, its path can be "root node" - "page element N1" - "control BT11".

[0047] Similarly, the path of control BT12 in the tree structure can be "root node" - "page element N1" - "control BT12". The path of control BT21 in the tree structure can be "root node" - "page element N2" - "control BT21". The path of control BT22 in the tree structure can be "root node" - "page element N2" - "control BT22". The path of control BT31 in the tree structure can be "root node" - "page element N3" - "control BT31". The path of control BT32 in the tree structure can be "root node" - "page element N3" - "control BT32".

[0048] The attribute information mentioned above includes at least one of the following: resource identifier and type. For example, the resource identifier can be resource-id, and the type can be classname. Attribute information cannot uniquely represent a control.

[0049] In practical applications, when identifying the second control, precise matching is first performed using the identifier information. If precise matching fails, meaning the third control does not exist, fuzzy matching is performed using the attribute information. This allows the second control to be identified even when its identifier information changes, improving the success rate of second control identification.

[0050] In the process of fuzzy matching based on attribute information, matching can be performed simultaneously based on resource identifier and type to obtain the fourth control. Since the fourth control, which matches both resource identifier and type, has a higher probability of belonging to the same control as the first control, when using the fourth control as the second control, priority can be given to ensuring the matching degree between the second control and the first control.

[0051] Based on this, if no fourth control matches both the resource identifier and type, then a further matching based on either the resource identifier or type is performed to obtain a fourth control that matches either the resource identifier or type. This further improves the matching success rate and avoids situations where testing is impossible due to the inability to match the second control.

[0052] When there is only one fourth control identified through attribute information, the fourth control can be used as the second control. However, when there are at least two fourth controls, one of them needs to be selected as the second control.

[0053] In the conventional approach, one of the fourth controls can be randomly selected as the second control. However, this method may result in a low degree of matching between the second and first controls; that is, the resulting second control may not belong to the same control as the first.

[0054] To improve the matching degree between the second control and the first control, the fourth control whose aspect ratio matches that of the first control can be identified as the second control from at least two fourth controls. Since the size of the same control may vary on different display devices, but its aspect ratio is usually fixed, the second control can be identified by its aspect ratio to ensure that the second control and the first control belong to the same control, thus improving the matching degree between the second control and the first control.

[0055] The aspect ratio refers to the ratio of the length to the width of a rectangular control. For example, if a control is 10 centimeters long and 5 centimeters wide, and needs to be enlarged for display on different devices, then both the length and width need to be enlarged proportionally, and the aspect ratio will still be 2:1. Therefore, we can determine whether two controls belong to the same control by their aspect ratio.

[0056] In practical applications, since the shape of a control is also fixed—meaning it remains unchanged when zoomed in or out—the shape can be used to determine the second control, thereby improving the matching degree between the second and first controls. Specifically, the second control is determined from at least two fourth controls whose shape is identical to that of the first control.

[0057] Of course, the shape and aspect ratio can also be combined for judgment. That is, among at least two fourth controls, the one whose aspect ratio matches that of the first control and whose shape is the same as that of the first control is identified as the second control. In this way, if there are at least two fourth controls whose aspect ratio matches that of the first control, or at least two fourth controls whose shape is the same as that of the first control, the second control can be identified more accurately by combining aspect ratio and shape, which helps to improve the accuracy of the second control.

[0058] Figure 4 This is a detailed process diagram of the testing method provided in the embodiments of this disclosure. (Refer to...) Figure 4 As shown, before performing the second operation on the second control, it is necessary to determine whether a second interface exists. If the second interface does not exist in the target software of the second version, step S101 can be entered to obtain a different operation record and proceed accordingly. Figure 4 Continue testing in the same manner. Repeat this process until all operation records have been matched.

[0059] It should be noted that if there are few operation records, the above loop can be used to execute all operation records once. This allows for testing of all possible first operations online, improving test coverage. However, when there are many operation records, testing all operation records will take a long time, resulting in high testing costs. To reduce testing costs, multiple operation records can be pre-filtered to select a subset of operation records for methods S101 to S103.

[0060] High test coverage requires more test cases, while low test cost allows for fewer test cases. Therefore, a balance must be struck between achieving both. Based on this consideration, when filtering operation records, redundant records can be removed according to their similarity, leaving only the remaining records for selection. Specifically, for multiple operation records with a similarity greater than or equal to a preset similarity threshold, only one needs to be retained.

[0061] The similarity between operation records can be represented by the quantity or proportion of identical operation information included in the operation records. Identical operation information refers to the operation information of the same operation for the same interface and the same control. The proportion of identical operation information can be the ratio of the quantity of identical operation information to the total quantity of operation information included in the two operation records.

[0062] In this embodiment of the disclosure, the process of determining the current interface and performing the second operation based on the operation record can be understood as replaying the operation record. Therefore, when a problem is discovered through an operation record test, the operation record can be replayed to reproduce the problem found during the test. This can assist in resolving the problem, avoiding delays in problem resolution due to the inability to reproduce the problem, and improving problem-solving efficiency.

[0063] Reference Figure 4 As shown, when a second interface exists in the target software of the second version, it is also necessary to determine whether a second control exists in the current interface.

[0064] If a second control exists, proceed to step S103 to test a second control on the current interface.

[0065] If the second control does not exist, it is also necessary to determine whether the first interface is the last interface in the operation record.

[0066] If it is the last screen, then proceed to step S101 to obtain a different operation record, and repeat the subsequent steps. This embodiment of the disclosure can traverse different operation records for testing, avoiding omissions of some operation records, thereby ensuring high test coverage.

[0067] If it is not the last screen, the first screen is updated to the next screen in the operation record, and the process proceeds to step S102 to obtain the next second screen as the current screen, and the subsequent steps are repeated. This embodiment of the disclosure can perform testing based on each first screen in the operation record, avoiding omissions of some first screens, thereby ensuring high test coverage.

[0068] Reference Figure 4 As shown, after performing the second operation on the second control, it is also necessary to determine whether the first interface is the last interface in the operation record.

[0069] If so, proceed to step S101 to obtain a different operation record.

[0070] If not, proceed to S104: Update the current interface of the target software according to the second operation, update the first interface to the next interface in the operation record, and determine whether the second control exists in the current interface. It is understandable that after performing the second operation, the target software jumps from interface P1 to interface P2. Before the jump, interface P1 is the current interface; after the jump, interface P2 is updated to the current interface. Thus, testing of interface B continues. This can be continued according to the operation record until the last interface of the test record is reached and the test is completed. Therefore, the actual test path is the same as the interface jump path in the test record. For example, if the interface jump path in the test record is: operate on control BT1 in the first interface P1 to jump to the first interface P2, operate on control BT2 in the first interface P2 to jump to the first interface P3, operate on control BT3 in the first interface P3 to jump to the first interface P4, then the actual test path is usually also the above interface jump path.

[0071] This embodiment of the disclosure achieves loop testing by performing tests based on the next first interface after the target software navigates to a new interface. This allows testing to be performed according to each interface of the target software in the operation log, avoiding omissions of interfaces in the operation log and helping to improve test coverage.

[0072] In the above Figure 4 During the test, if no operation record can be obtained through S101, or if no different operation record can be obtained, then the test ends.

[0073] Of course, you can also set a preset number of operation records, and the test will end when all operation records have been tested.

[0074] Corresponding to the test method in the above embodiments, Figure 5This is a structural block diagram of a testing apparatus provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 5 The aforementioned testing device 200 includes: an operation record acquisition module 201, a current interface acquisition module 202, and a test execution module 203.

[0075] The operation record acquisition module 201 is used to acquire the operation record of the first version of the target software. The operation record includes operation information performed by the user in at least one first interface. The operation information includes a first operation performed on a first control. The first interface is an interface in the first version of the target software.

[0076] The current interface acquisition module 202 is used to acquire a second interface that matches the first interface from the target software of the second version, and use it as the current interface.

[0077] The test execution module 203 is used to perform a second operation on the second control if a second control exists in the current interface. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface.

[0078] Optionally, the device further includes:

[0079] The first matching module is used to determine the third control as the second control if the identification information of the third control in the current interface matches the identification information of the first control in the first interface before performing the second operation on the second control.

[0080] The second matching module is used to determine a fourth control from the current interface that matches the attribute information of the first control in the first interface if the identification information of each control in the current interface does not match the identification information of the first control in the first interface, and to identify the fourth control as the second control.

[0081] Optionally, the identification information includes a path.

[0082] Optionally, the attribute information includes at least one of the following: resource identifier and type.

[0083] Optionally, when the number of the fourth controls is at least two, the second matching module is further configured to:

[0084] When the fourth control is determined as the second control, the fourth control whose aspect ratio matches that of the first control is determined as the second control from at least two fourth controls.

[0085] Optionally, the device further includes:

[0086] The first loop module is configured to, after performing the second operation on the second control, if the first interface is not the last interface in the operation record, update the current interface of the target software according to the second operation, update the first interface to the next interface in the operation record, and proceed to the step of performing the second operation on the second control if the second control exists in the current interface.

[0087] The second loop module is used to, after the second operation is performed on the second control, if the first interface is the last interface in the operation record, proceed to the step of obtaining the operation record of the first version of the target software to obtain a different operation record.

[0088] Optionally, the device further includes:

[0089] The third loop module is used to update the first interface to the next interface in the operation record if the second control does not exist in the current interface and the first interface is not the last interface in the operation record, and to enter the step of obtaining a second interface matching the first interface from the target software of the second version as the current interface, so as to obtain the next second interface as the current interface.

[0090] Optionally, the device further includes:

[0091] The fourth loop module is used to obtain a different operation record if the second control is not present in the current interface and the first interface is the last interface in the operation record.

[0092] The testing apparatus provided in this embodiment can be used to perform the above-described test. Figure 2 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.

[0093] Figure 6 This is a structural block diagram of an electronic device 600 provided in an embodiment of the present disclosure. The electronic device 600 includes a memory 602 and at least one processor 601.

[0094] Among them, memory 602 stores computer-executed instructions.

[0095] At least one processor 601 executes computer execution instructions stored in memory 602, causing electronic device 601 to perform the aforementioned functions. Figure 2 The method in the middle.

[0096] In addition, the electronic device may also include a receiver 603 and a transmitter 604, wherein the receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601, and the transmitter 604 is used to send information to other devices or equipment.

[0097] In a first example of the first aspect, this disclosure provides a testing method, the method comprising:

[0098] Obtain the operation record of the first version of the target software, the operation record including operation information performed by the user in at least one first interface, the operation information including a first operation performed on a first control, the first interface being the interface in the first version of the target software;

[0099] Obtain a second interface that matches the first interface from the second version of the target software, and use it as the current interface;

[0100] If a second control exists in the current interface, a second operation is performed on the second control. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface.

[0101] Based on the first example of the first aspect, in the second example of the first aspect, before performing the second operation on the second control if a second control exists in the current interface, the method further includes:

[0102] If the identification information of the third control in the current interface matches the identification information of the first control in the first interface, then the third control is identified as the second control.

[0103] If the identification information of each control in the current interface does not match the identification information of the first control in the first interface, then a fourth control that matches the attribute information of the first control in the first interface is determined from the current interface, and the fourth control is determined as the second control.

[0104] Based on the second example of the first aspect, in the third example of the first aspect, the identification information includes a path.

[0105] Based on the second example of the first aspect, in the fourth example of the first aspect, the attribute information includes at least one of the following: resource identifier and type.

[0106] Based on the second example of the first aspect, in the fifth example of the first aspect, when the number of the fourth controls is at least two, determining the fourth control as the second control includes:

[0107] The fourth control whose aspect ratio matches that of the first control is identified as the second control among at least two fourth controls.

[0108] Based on any one of the first to fifth examples of the first aspect, in the sixth example of the first aspect, after performing the second operation on the second control, it further includes:

[0109] If the first interface is not the last interface in the operation record, then the current interface of the target software is updated according to the second operation, and the first interface is updated to the next interface in the operation record, and then the step of performing the second operation on the second control if there is a second control in the current interface is entered.

[0110] If the first interface is the last interface in the operation record, then proceed to the step of obtaining the operation record of the first version of the target software to obtain a different operation record.

[0111] Based on the sixth example of the first aspect, in the seventh example of the first aspect, the method further includes:

[0112] If the second control does not exist in the current interface, and the first interface is not the last interface in the operation record, then the first interface is updated to the next interface in the operation record, and the process proceeds to the step of obtaining a second interface matching the first interface from the target software of the second version as the current interface, so as to obtain the next second interface as the current interface.

[0113] Based on the first example of the first aspect, in the eighth example of the first aspect, the method further includes:

[0114] If the second control is not present in the current interface, and the first interface is the last interface in the operation record, then proceed to the step of obtaining the operation record of the first version of the target software to obtain a different operation record.

[0115] In a first example of the second aspect, a testing apparatus is provided, the apparatus comprising:

[0116] An operation record acquisition module is used to acquire operation records of the first version of the target software. The operation records include operation information performed by the user in at least one first interface. The operation information includes a first operation performed on a first control. The first interface is an interface in the first version of the target software.

[0117] The current interface acquisition module is used to acquire a second interface that matches the first interface from the target software of the second version, and use it as the current interface;

[0118] The test execution module is used to perform a second operation on the second control if a second control exists in the current interface. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface.

[0119] Based on the first example of the second aspect, in the second example of the second aspect, the device further includes:

[0120] The first matching module is used to determine the third control as the second control if the identification information of the third control in the current interface matches the identification information of the first control in the first interface before performing the second operation on the second control.

[0121] The second matching module is used to determine a fourth control from the current interface that matches the attribute information of the first control in the first interface if the identification information of each control in the current interface does not match the identification information of the first control in the first interface, and to identify the fourth control as the second control.

[0122] Based on the second example of the second aspect, in the third example of the second aspect, the identification information includes a path.

[0123] Based on the second example of the second aspect, in the fourth example of the second aspect, the attribute information includes at least one of the following: resource identifier and type.

[0124] Based on the second example of the second aspect, in the fifth example of the second aspect, when the number of the fourth controls is at least two, the second matching module is further configured to:

[0125] When the fourth control is determined as the second control, the fourth control whose aspect ratio matches that of the first control is determined as the second control from at least two fourth controls.

[0126] Based on any one of the first to fifth examples of the second aspect, in the sixth example of the second aspect, the device further includes:

[0127] The first loop module is used to perform a second operation on the second control, and if the first interface is not the last interface in the operation record, update the current interface of the target software according to the second operation, update the first interface to the next interface in the operation record, and proceed to the step of performing a second operation on the second control if there is a second control in the current interface.

[0128] The second loop module is used to perform a second operation on the second control, and if the first interface is the last interface in the operation record, then proceed to the step of obtaining the operation record of the first version of the target software to obtain a different operation record.

[0129] Based on the sixth example of the second aspect, in the seventh example of the second aspect, the device further includes:

[0130] The third loop module is used to update the first interface to the next interface in the operation record if the second control does not exist in the current interface and the first interface is not the last interface in the operation record, and to enter the step of obtaining a second interface matching the first interface from the target software of the second version as the current interface, so as to obtain the next second interface as the current interface.

[0131] Based on the first example of the second aspect, in the eighth example of the second aspect, the device further includes:

[0132] The fourth loop module is used to obtain a different operation record if the second control is not present in the current interface and the first interface is the last interface in the operation record.

[0133] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0134] The memory stores computer-executed instructions;

[0135] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to implement the method described in any of the first aspects.

[0136] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in any one of the first aspects.

[0137] Fifthly, according to one or more embodiments of the present disclosure, a computer program is provided for implementing the method described in any of the first aspects.

[0138] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0139] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0140] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A testing method, characterized in that, The method includes: Obtain the operation record of the first version of the target software, the operation record including operation information performed by the user in at least one first interface, the operation information including a first operation performed on a first control, the first interface being the interface in the first version of the target software; Obtain a second interface that matches the first interface from the second version of the target software, and use it as the current interface; If a second control exists in the current interface, a second operation is performed on the second control. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface. If the first interface is not the last interface in the operation record, then the current interface of the target software is updated according to the second operation, and the first interface is updated to the next interface in the operation record, and then the step of performing the second operation on the second control if there is a second control in the current interface is entered.

2. The method according to claim 1, characterized in that, If a second control exists in the current interface, before performing the second operation on the second control, the method further includes: If the identification information of the third control in the current interface matches the identification information of the first control in the first interface, then the third control is identified as the second control. If the identification information of each control in the current interface does not match the identification information of the first control in the first interface, then a fourth control that matches the attribute information of the first control in the first interface is determined from the current interface, and the fourth control is determined as the second control.

3. The method according to claim 2, characterized in that, The identification information includes the path of the control in the interface.

4. The method according to claim 2, characterized in that, The attribute information includes at least one of the following: resource identifier and type.

5. The method according to claim 2, characterized in that, When the number of the fourth controls is at least two, determining the fourth control as the second control includes: The fourth control whose aspect ratio matches that of the first control is identified as the second control among at least two fourth controls.

6. The method according to any one of claims 1 to 5, characterized in that, Also includes: If the first interface is the last interface in the operation record, then proceed to the step of obtaining the operation record of the first version of the target software to obtain a different operation record.

7. The method according to claim 6, characterized in that, The method further includes: If the second control does not exist in the current interface, and the first interface is not the last interface in the operation record, then the first interface is updated to the next interface in the operation record, and the process proceeds to the step of obtaining a second interface matching the first interface from the target software of the second version as the current interface, so as to obtain the next second interface as the current interface.

8. The method according to claim 6, characterized in that, The method further includes: If the second control is not present in the current interface, and the first interface is the last interface in the operation record, then proceed to the step of obtaining the operation record of the first version of the target software to obtain a different operation record.

9. A testing device, characterized in that, The device includes: An operation record acquisition module is used to acquire operation records of the first version of the target software. The operation records include operation information performed by the user in at least one first interface. The operation information includes a first operation performed on a first control. The first interface is an interface in the first version of the target software. The current interface acquisition module is used to acquire a second interface that matches the first interface from the target software of the second version, and use it as the current interface; The test execution module is used to perform a second operation on the second control if a second control exists in the current interface. The second operation is used to test the second control in the target software of the second version. The second control matches the first control in the operation information performed by the user in the first interface. The second operation is consistent with the first operation in the operation information performed by the user in the first interface. The first loop module is configured to update the current interface of the target software according to the second operation if the first interface is not the last interface in the operation record, and update the first interface to the next interface in the operation record, and proceed to the step of performing the second operation on the second control if there is a second control in the current interface.

10. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, cause a computing device to implement the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and device for testing user interface

    CN108710574A

  • Recording and playback test method and related device

    CN109857674A

  • Operation interface test method and device, terminal and storage medium

    CN113641587A