Automatic testing method, device, electronic device and storage medium for password control
By identifying and processing password controls in automated testing and using password control execution logic to perform assignment operations, the testing difficulties of password controls under ActiveX encapsulation are solved, testing efficiency is improved, and maintenance workload is reduced.
Patent Information
- Application Number
- CN202210121530.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-02-09
AI Technical Summary
It is difficult to effectively carry out automated testing of ActiveX-encapsulated password controls with existing technologies. Commonly used keyboard simulation methods are intercepted, making it difficult to carry out the test smoothly.
The control type is determined by locating information based on the atomic test step. If it is a password control, the password control execution logic is used to perform the assignment operation, including splitting the input password into single characters and matching the keyboard scan code, and calling the keyboard interface for assignment.
It realizes the automated testing of password controls, reduces the workload of testers in case maintenance, and improves testing efficiency.
Smart Images

Figure CN114461529B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of automated testing technology, and in particular to an automated testing method, device, electronic device, and storage medium for password controls. Background Art
[0002] With the rapid development and widespread use of the internet, network information security issues are becoming increasingly prominent. To enhance the security of their applications, many financial systems are encapsulating password controls with ActiveX. For these password controls, standard value assignments often fail, and even forcibly changing the control's readonly attribute still doesn't work. Furthermore, common keyboard simulation methods (such as Type and SendKeys) are detected and intercepted by ActiveX, making automated testing of these controls difficult.
[0003] Therefore, how to solve the problem of automated testing of ActiveX-encapsulated password controls is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0004] The embodiments of the present invention provide an automated testing method, device, electronic device and storage medium for password controls, which automatically implement different assignment methods for different control types, solve the problem of automated testing of password controls, and greatly reduce the workload of testers in maintaining cases.
[0005] In a first aspect, an embodiment of the present invention provides an automated testing method for a password control, comprising:
[0006] Determine the control type to which the current atomic test step belongs based on the atomic test step location information;
[0007] If the control type of the current atomic test step is a password control, the password control execution logic is used to assign a value to the current password control to implement automated testing;
[0008] Query the current atomic test step status to determine whether to start the next atomic test step.
[0009] In a second aspect, an embodiment of the present invention further provides an automated testing device for a password control, comprising:
[0010] The current atomic test step control type determination module is used to determine the control type of the current atomic test step according to the atomic test step location information;
[0011] The current password control assignment operation module is used to use the password control execution logic to perform an assignment operation on the current password control to achieve automated testing if the control type to which the current atomic test step belongs is a password control;
[0012] The next atomic test step starting module is used to query the current atomic test step status and determine whether to start the next atomic test step.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the automated testing method for the password control described in any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the automated testing method for the password control described in any embodiment of the present invention.
[0018] The embodiment of the present invention provides an automated testing method, device, electronic device and storage medium for password controls, which determines the control type to which the current atomic test step belongs based on the atomic test step positioning information; if the control type to which the current atomic test step belongs is a password control, the password control execution logic is used to perform an assignment operation on the current password control to implement automated testing; and the current atomic test step status is queried to determine whether to start the next atomic test step. Through the technical solution of the embodiment of the present invention, when processing password controls, the system unifies the specifications with other control types, and automatically implements different assignment methods for different controls based on factors such as the framework type and object positioning information, thereby solving the problem of automated testing of password controls and greatly reducing the workload of testers in maintaining cases. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Other features, objects, and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered as limiting the present invention. Like reference characters are used throughout the drawings to denote like parts. In the drawings:
[0020] Figure 1A This is a flow chart of an automated testing method for a password control provided in Example 1 of the present invention;
[0021] Figure 1B This is a schematic diagram of an automated test case structure provided in an embodiment of the present invention;
[0022] Figure 1C This is a flowchart of a method for processing password controls for different automated testing tools provided in an embodiment of the present invention;
[0023] Figure 2A A flowchart of an automated testing method for a password control provided in the second embodiment of the present invention;
[0024] Figure 2B This is a flow chart of a method for determining whether an atomic test step is a password control provided in an embodiment of the present invention;
[0025] Figure 2C This is a schematic diagram of automated test object positioning information provided in an embodiment of the present invention;
[0026] Figure 3A This is a flowchart of an automated testing method for a password control provided in Example 3 of the present invention;
[0027] Figure 3B This is a processing method flow for automated testing of password controls provided in an embodiment of the present invention;
[0028] Figure 4 This is a schematic diagram of the structure of an automated testing device for a password control provided in a fourth embodiment of the present invention;
[0029] Figure 5 This is a structural diagram of an electronic device provided in Example 5 of the present application. DETAILED DESCRIPTION
[0030] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0031] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0032] With the deepening of digital transformation, the iteration speed of products is constantly increasing, and the use cases of interface automation testing are also constantly enriching. At present, many financial customer service systems have adopted the security measure of password controls. While effectively improving the security protection level of the system, it also prevents automated testing tools from assigning values to password controls. The commonly used simulation keyboard method also becomes ineffective. If it is commented out during the test process, there may be a risk that the test is normal but the password control is added and put into production abnormally. For the method of executing password controls in interface-level test cases, there are currently two main technical solutions:
[0033] To bypass this, developers can comment out the password control when packaging the app, or replace it with an unencrypted control. However, this method requires code changes, which carries the risk of testing successfully but experiencing issues after adding the password control. There's also the risk of releasing a test version to production due to human error.
[0034] Forced assignment: For password controls that block the value assignment operation of automated testing tools, the commonly used forced assignment methods are:
[0035] (1) Enter the password in another place where input is allowed, and then use the copy function to copy the password into the password control. If the password control is developed without the paste function, this method will not work.
[0036] (2) Set the focus on the password control and use the common simulated keyboard method to enter the password. The password control will be intercepted after being encapsulated with ActiveX and will not take effect.
[0037] Therefore, an embodiment of the present invention provides an automated testing method for a password control.
[0038] Example 1
[0039] Figure 1A This is a flowchart of a method for automated testing of password controls, provided in Example 1 of the present invention. This embodiment is applicable to automated testing of password controls. The method of this embodiment can be performed by an automated testing device for password controls, which can be implemented using hardware and / or software. The device can be configured in a server for automated testing of password controls. The method specifically includes the following steps:
[0040] S110. Determine the control type to which the current atomic test step belongs based on the atomic test step location information.
[0041] The atomic test step refers to the smallest operation step in a test case, and the test case is divided into at least two atomic test steps. The atomic test step components include but are not limited to atomic objects, operation methods, and input data. Figure 1BThis is a schematic diagram of an automated test case structure provided in an embodiment of the present invention, see Figure 1B ,Atomic test step 1 and atomic test step 2 constitute a test case, in which the user's login is completed by entering the user name and password.
[0042] Positioning information can refer to attribute information based on an atomic test step, such as element attribute information and framework structure of an atomic object. The positioning information of the atomic test step is determined based on the atomic object information currently being automated tested. The atomic test step positioning information and the atomic object encapsulation format are matched to determine the control type to which the current atomic test step belongs.
[0043] The system implements a unified encapsulation method for different automated testing tools such as QTP and Selenium. When the test case executes the atomic test step, it determines whether the object of the current atomic test step is a password control. Figure 1C This is a flowchart of a method for processing password controls for different automated testing tools provided in an embodiment of the present invention. Figure 1C If the object of the current atomic test step is a password control, it is executed according to the password control execution method. If it is other types of controls, different control execution methods are called respectively to execute the case steps of its automated testing tool.
[0044] S120: If the control type to which the current atomic test step belongs is a password control, the password control execution logic is used to perform a value assignment operation on the current password control to implement automated testing.
[0045] A password control refers to a program that each website develops based on its needs. When a user logs into the website, the password control activates, encrypting key data to prevent account and password theft by Trojans or viruses, effectively preventing Trojans from intercepting and logging keystrokes. For example, online banking and online trading platforms of various banks are vulnerable to exploitation by criminals, resulting in financial losses for their customers. Therefore, most banks use password controls to protect customer account and password information.
[0046] The password control execution logic may refer to performing a value assignment operation on the password control using the corresponding password control execution method. For example, if the current atomic test step is a password control, the test input password of the current atomic test step is split into at least two individual characters, and the at least two individual characters are matched with corresponding keyboard scan codes; and the keyboard interface is called based on the keyboard scan codes to perform a value assignment operation to implement automated testing.
[0047] S130: Query the current atomic test step status to determine whether to start the next atomic test step.
[0048] Among them, querying the status of the current atomic test step can refer to querying whether the current atomic test step has been executed. If it has been executed, starting the next atomic test step, determining whether the next atomic test step is a password control and querying the status of the next atomic test step.
[0049] The embodiment of the present invention provides an automated testing method for a password control, which determines the type of control to which the current atomic test step belongs based on the atomic test step positioning information; if the control type to which the current atomic test step belongs is a password control, the password control execution logic is used to perform an assignment operation on the current password control to achieve automated testing; the current atomic test step status is queried to determine whether to start the next atomic test step. Using the technical solution of the embodiment of the present invention, whether the current atomic test step is a password control is determined based on the atomic test step positioning information. When processing the password control, the system automatically implements a corresponding assignment method for the password control based on factors such as the framework type and the atomic object positioning information; the next atomic test step is started after the current atomic test step is completed, which solves the problem of automated testing of password controls and greatly reduces the workload of testers in maintaining cases.
[0050] Example 2
[0051] Figure 2A This is a flow chart of an automated testing method for a password control provided in the second embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 2A As shown, the automated testing method for the password control provided in the embodiment of the present invention may include the following steps:
[0052] S210: Determine the current atomic test step location information based on the atomic object information currently being automatically tested.
[0053] in, Figure 2B This is a flow chart of a method for determining whether an atomic test step is a password control provided in an embodiment of the present invention, see Figure 2B When the test case is being executed, the case steps are parsed into at least two atomic test steps, and a single atomic test step is polled to determine whether the current atomic test step is a password control; determine whether the current atomic test step is a password control, and use the password control execution method to perform an assignment operation on the atomic test step of the password control to which it belongs; use other types of control operation methods to assign values to other types of password controls; until the assignment operation is completed on the last atomic test step.
[0054] Optionally, when the test case is executed, the atomic test steps are parsed in sequence, and the execution method of the current atomic test step is determined based on factors such as different framework types and object location information of the atomic test step. For example, the current atomic test step is uniformly encapsulated using ActiveX and automated testing is performed using the QTP automated testing tool. Figure 1B Step 2 (POB / login.password+input+***), the QTP location information of the regular matching object. Figure 2C This is a schematic diagram of an automated test object positioning information provided in an embodiment of the present invention, see Figure 2C Check whether the QTP location information for the current atomic test step is ActiveX(...).WinEditor(...). Different packaging formats and automated testing tools display different location information.
[0055] S220: Match the current atomic test step location information with the current encapsulation format to determine the control type to which the current atomic test step belongs.
[0056] The control types include but are not limited to password controls and other types of controls.
[0057] Optionally, matching the current atomic test step location information with the current encapsulation format to determine the control type to which the current atomic test step belongs includes:
[0058] If the current atomic test step location information successfully matches the current encapsulation format, determining that the control type to which the current atomic test step belongs is a password control;
[0059] If the current atomic test step location information fails to match the current packaging format, it is determined that the control type to which the current atomic test step belongs is other types of controls.
[0060] Among them, see Figure 1B Step 2 (POB / login.password+input+***), enter the user's password information and the location information of the regular expression matching object. Figure 2C , check whether the location information of the current atomic test step is ActiveX(...).WinEditor(...). If the match is successful, the current atomic test step is determined to be a password control, and the password control is called to execute logic for assignment; if the match is unsuccessful, the current atomic test step is determined to be another type of control.
[0061] According to the technical solution of the embodiment of the present invention, the tester only needs to change the positioning information of the control to an ActiveX control, and then call the password control execution method to assign a value to the control without modifying the case step information, thereby minimizing the coupling degree of the case design and reducing the case maintenance cost.
[0062] S230: If the control type to which the current atomic test step belongs is a password control, the password control execution logic is used to perform a value assignment operation on the current password control to implement automated testing.
[0063] S240: Query the current atomic test step status to determine whether to start the next atomic test step.
[0064] An embodiment of the present invention provides an automated testing method for a password control. The method determines the current atomic test step location information based on the atomic object information currently being automated tested; matches the current atomic test step location information with the current encapsulation format to determine the control type to which the current atomic test step belongs; if the control type to which the current atomic test step belongs is a password control, the password control execution logic is used to assign a value to the current password control to implement automated testing; and the current atomic test step status is queried to determine whether to start the next atomic test step. Using the technical solution of the embodiment of the present invention, the test case step is parsed into at least two atomic test steps, and a single atomic test step is polled to determine whether the current atomic test step is a password control; after determining whether the current atomic test step is a password control, the password control execution method is used to assign a value to the atomic test step of the password control. The tester only needs to change the control location information to an ActiveX control to call the password control execution method to assign a value to the control without modifying the case step information, thereby minimizing the coupling degree of the case design and reducing the case maintenance cost.
[0065] Example 3
[0066] Figure 3A This is a flow chart of an automated testing method for a password control provided by the third embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 3A As shown, the automated testing method for the password control provided in the embodiment of the present invention may include the following steps:
[0067] S310. Unify and package different automated testing tools.
[0068] S320. Determine the control type to which the current atomic test step belongs based on the atomic test step location information.
[0069] S330: If the control type to which the current atomic test step belongs is a password control, the password control execution logic is used to perform a value assignment operation on the current password control to implement automated testing.
[0070] Optionally, the use of password control execution logic to perform an assignment operation on the current password control to implement automated testing includes:
[0071] Change the current automated test system to test mode;
[0072] Splitting the test input password into at least two single characters and matching corresponding keyboard scan codes for the at least two single characters;
[0073] The keyboard interface is called according to the keyboard scan code to perform an assignment operation to realize automated testing.
[0074] Optionally, calling a keyboard interface to perform an assignment operation according to the keyboard scan code to implement automated testing includes:
[0075] Matching the single character with a corresponding virtual key code, and mapping the virtual key code to a keyboard scan code according to an operating system file;
[0076] Calling the keyboard interface, writing the keyboard scan code to perform the assignment operation;
[0077] Query the current single character status to determine whether to assign a value to the next single character.
[0078] in, Figure 3B This is a processing method flow for automated testing of password controls provided in an embodiment of the present invention. Figure 3B When the password control is executed, the system is first switched to test mode. The background automatically splits the password into individual characters, matches the character's virtual key code, and then maps the virtual key code to a keyboard scan code based on the user32.dll file in the Windows operating system. The keyboard interface is called to write the corresponding keyboard scan code until the last single character is called. During this execution, the password control's input method is invisible to the user.
[0079] S340: Query the current atomic test step status to determine whether to start the next atomic test step.
[0080] An embodiment of the present invention provides an automated testing method for a password control, which unifies different automated testing tools. The method determines the control type of the current atomic test step based on atomic test step location information. If the control type of the current atomic test step is a password control, the password control execution logic is used to assign a value to the current password control to implement automated testing. The current atomic test step status is then queried to determine whether to initiate the next atomic test step. Using the technical solution of the embodiment of the present invention, the atomic test step of the password control is split into at least two individual characters. The individual characters are polled, their virtual key codes are matched, and the virtual key codes are mapped to keyboard scan codes based on operating system files. The keyboard interface is called to write the keyboard scan code until the last character is written, completing the execution of the password control. When using the method, testers do not need to distinguish whether the input box is a password control; they can directly use a recording tool to generate it. This allows testers to conveniently and efficiently design cases without having to manually write case steps or manually collect object location information, significantly reducing workload. The automated testing method for password controls based on operating system event response proposed in the embodiment of the present invention can normally execute even for controls that cannot be assigned a value, cannot be input using the simulated keyboard method, or are prohibited from pasting.
[0081] Example 4
[0082] Figure 4 This is a schematic diagram of the structure of an automated test device for a password control provided by a fourth embodiment of the present invention. The device includes: a current atomic test step control type determination module 410, a current password control value assignment operation module 420, and a next atomic test step initiation module 430. Among them:
[0083] The current atomic test step control type determination module 410 is used to determine the control type of the current atomic test step according to the atomic test step location information;
[0084] The current password control assignment operation module 420 is configured to, if the control type of the current atomic test step is a password control, use the password control execution logic to perform an assignment operation on the current password control to implement automated testing;
[0085] The next atomic test step starting module 430 is used to query the current atomic test step status and determine whether to start the next atomic test step.
[0086] Based on the above embodiment, optionally, the current atomic test step control type determination module includes:
[0087] Determine the current atomic test step location information based on the atomic object information of the automated test at the current moment;
[0088] The current atomic test step location information is matched with the current encapsulation format to determine the control type to which the current atomic test step belongs.
[0089] Based on the above embodiment, optionally, the current atomic test step control type determination module further includes:
[0090] If the current atomic test step location information successfully matches the current encapsulation format, determining that the control type to which the current atomic test step belongs is a password control;
[0091] If the current atomic test step location information fails to match the current packaging format, it is determined that the control type to which the current atomic test step belongs is other types of controls.
[0092] Based on the above embodiment, optionally, the current password control assignment operation module includes:
[0093] Change the current automated test system to test mode;
[0094] Splitting the test input password into at least two single characters and matching corresponding keyboard scan codes for the at least two single characters;
[0095] The keyboard interface is called according to the keyboard scan code to perform an assignment operation to realize automated testing.
[0096] Based on the above embodiment, optionally, the current password control assignment operation module includes:
[0097] Matching the single character with a corresponding virtual key code, and mapping the virtual key code to a keyboard scan code according to an operating system file;
[0098] Calling the keyboard interface, writing the keyboard scan code to perform the assignment operation;
[0099] Query the current single character status to determine whether to assign a value to the next single character.
[0100] Based on the above embodiment, optionally, the device further includes:
[0101] The unified encapsulation module is used to unify the encapsulation of different automated testing tools.
[0102] The above-mentioned device can execute the automatic testing method of the password control provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the automatic testing method of the password control.
[0103] Example 5
[0104] Figure 5This is a structural diagram of an electronic device provided in Example 5 of the present application. This embodiment of the present application provides an electronic device, in which the interactive device for automated testing of the password control provided in the embodiment of the present application can be integrated. Figure 5 As shown, this embodiment provides an electronic device 500, which includes: one or more processors 520; a storage device 510 for storing one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the automated testing method for the password control provided in the embodiment of the present application. The method includes:
[0105] Determine the control type to which the current atomic test step belongs based on the atomic test step location information;
[0106] If the control type of the current atomic test step is a password control, the password control execution logic is used to assign a value to the current password control to implement automated testing;
[0107] Query the current atomic test step status to determine whether to start the next atomic test step.
[0108] Of course, those skilled in the art will understand that the processor 520 also implements the technical solution of the automated testing method for password controls provided in any embodiment of the present application.
[0109] Figure 5 The electronic device 500 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0110] like Figure 5 As shown, the electronic device 500 includes a processor 520, a storage device 510, an input device 530, and an output device 540; the number of processors 520 in the electronic device can be one or more. Figure 5 In the figure, a processor 520 is used as an example; the processor 520, the storage device 510, the input device 530 and the output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The connection via bus 550 is taken as an example.
[0111] The storage device 510, as a computer-readable storage medium, can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the automated testing method for password controls in the embodiment of the present application.
[0112] The storage device 510 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, the storage device 510 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, the storage device 510 may further include a memory remotely located relative to the processor 520, and these remote memories may be connected via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0113] The input device 530 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include electronic devices such as a display screen and a speaker.
[0114] The electronic device provided in the embodiment of the present application can achieve the technical effect of effectively solving the problem of automated testing of password controls and greatly reducing the workload of testers in maintaining cases.
[0115] Example 6
[0116] Embodiment 6 of the present invention further provides a storage medium containing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to perform an automated testing method for a password control, the method comprising:
[0117] Determine the control type to which the current atomic test step belongs based on the atomic test step location information;
[0118] If the control type of the current atomic test step is a password control, the password control execution logic is used to assign a value to the current password control to implement automated testing;
[0119] Query the current atomic test step status to determine whether to start the next atomic test step.
[0120] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination thereof. The computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0121] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0122] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0123] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0124] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0125] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. An automated testing method for a password control, characterized in that: The method comprises: Determine the control type to which the current atomic test step belongs based on the atomic test step location information; If the control type of the current atomic test step is a password control, the password control execution logic is used to assign a value to the current password control to implement automated testing; Query the current atomic test step status to determine whether to start the next atomic test step; The step of determining the control type to which the current atomic test step belongs based on the atomic test step location information includes: Determine the current atomic test step location information based on the atomic object information of the automated test at the current moment; match the current atomic test step location information with the current encapsulation format to determine the control type to which the current atomic test step belongs; Among them, the password control execution logic is used to assign the current password control to achieve automated testing, including: Change the current automated test system to test mode; split the test input password into at least two single characters, and match the corresponding keyboard scan codes for the at least two single characters; match the single characters with the corresponding virtual key codes, and map the virtual key codes to keyboard scan codes based on the operating system files; call the keyboard interface, write the keyboard scan codes to perform assignment operations; query the current single character status, and determine whether to perform assignment operations for the next single character.
2. The method according to claim 1, characterized in that The matching of the current atomic test step location information with the current encapsulation format to determine the control type to which the current atomic test step belongs includes: If the current atomic test step location information successfully matches the current encapsulation format, determining that the control type to which the current atomic test step belongs is a password control; If the current atomic test step location information fails to match the current packaging format, it is determined that the control type to which the current atomic test step belongs is other types of controls.
3. The method according to claim 1, characterized in that Before determining the control type to which the current atomic test step belongs according to the atomic test step location information, the method further includes: uniformly packaging different automated test tools.
4. An automated testing device for a password control, characterized in that: The device comprises: The current atomic test step control type determination module is used to determine the control type of the current atomic test step according to the atomic test step location information; The current password control assignment operation module is used to use the password control execution logic to perform an assignment operation on the current password control to achieve automated testing if the control type to which the current atomic test step belongs is a password control; The next atomic test step starting module is used to query the current atomic test step status and determine whether to start the next atomic test step; The current atomic test step control type determination module is specifically configured to: Determine the current atomic test step location information based on the atomic object information of the automated test at the current moment; match the current atomic test step location information with the current encapsulation format to determine the control type to which the current atomic test step belongs; The current password control assignment operation module is specifically used to: Change the current automated test system to test mode; split the test input password into at least two single characters, and match the corresponding keyboard scan codes for the at least two single characters; match the single characters with the corresponding virtual key codes, and map the virtual key codes to keyboard scan codes based on the operating system files; call the keyboard interface, write the keyboard scan codes to perform assignment operations; query the current single character status, and determine whether to perform assignment operations for the next single character.
5. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the automated testing method for the password control described in any one of claims 1-3.
6. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the automated testing method for the password control as described in any one of claims 1 to 3.
Citation Information
Patent Citations
User interface automatic test method, electronic equipment and storage medium
CN112199301A
Automatic test method and device for user interface provided with security control
CN112597053A