CN114860613A - Automatic testing method and device - Google Patents

Automatic testing method and device Download PDF

Info

Publication number
CN114860613A
CN114860613A CN202210615188.5A CN202210615188A CN114860613A CN 114860613 A CN114860613 A CN 114860613A CN 202210615188 A CN202210615188 A CN 202210615188A CN 114860613 A CN114860613 A CN 114860613A
Authority
CN
China
Prior art keywords
port
equipment
character string
list
devices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210615188.5A
Other languages
Chinese (zh)
Inventor
李艳
周育彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202210615188.5A priority Critical patent/CN114860613A/en
Publication of CN114860613A publication Critical patent/CN114860613A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides an automatic testing method and a testing device, and solves the problems that a traditional testing tool can only be operated manually, the time consumption is high, and the accuracy is low. The automatic test method comprises the following steps: acquiring a port equipment list, wherein the port equipment list comprises ports of all connected equipment; traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port; scanning all the devices to obtain second device information; and performing consistency check based on the first equipment information and the second equipment information.

Description

Automatic testing method and device
Technical Field
The invention relates to the technical field of automatic testing, in particular to an automatic testing method and a testing device.
Background
Traditional testing tool can only log in manually one by one, click detection option and scanning equipment button, wait workstation APP (Application ) to scan, and whether the artificial observation scanning result is correct, this kind of test mode has consumed a large amount of time, and work load is loaded down with trivial details, leads to easy eye fatigue of operating personnel and produces the error, influences and detects the accuracy.
Disclosure of Invention
In view of the above, the invention provides an automatic testing method and a testing device, which solve the problems that the traditional testing tool can only be operated manually, and is large in time consumption and low in accuracy.
An automated testing method provided by an embodiment of the present invention includes: acquiring a port equipment list, wherein the port equipment list comprises ports of all connected equipment; traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port; scanning all the devices to obtain second device information; and performing consistency check based on the first equipment information and the second equipment information.
In one embodiment, the obtaining the port device list includes: and calling a software development kit preset by an operating system to acquire the port list.
In an embodiment, the traversing all the ports based on the port device list to obtain first device information corresponding to each port includes: sending a command prompt character string provided by the first equipment in the configuration file to a first port in the port equipment list for inquiry; receiving a first character string returned by the first equipment, and comparing the first character string with a confirmation character string of the first equipment in a configuration file; if the first character string is matched with the confirmation character string, determining first equipment information corresponding to the first port; and if the first character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the device information connected with the first port is confirmed or the inquiry of all devices in the configuration file is completed.
In one embodiment, the scanning all devices to obtain the second device information includes: automatically inputting an administrator account and a password corresponding to a pre-generated test script into a login window to login a target account; and scanning all the devices to obtain second device information under the condition that the target account is successfully logged in.
In one embodiment, the step of scanning all devices to obtain the second device information comprises: check if port is open: if the port is opened, sending a command prompt character string provided by the second equipment in the configuration file to the second port in the port equipment list for inquiry; receiving a second character string returned by the second equipment, and comparing the second character string with a confirmation character string of the second equipment in a configuration file; if the second character string is matched with the confirmation character string, determining second equipment information corresponding to the second port; and if the second character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the information of the second device connected with the second port is determined or the inquiry of all devices in the configuration file is completed.
In one embodiment, the step of scanning all devices to obtain the second device information includes: if the port cannot be opened, checking the configuration file, and judging whether the second equipment supports a second connection mode; if the second device supports the second connection mode, connecting the second device through the second connection mode; and receiving the second device information sent by the second device through the second connection mode.
In one embodiment, the method further comprises: if a second character string returned by the second equipment is not received within preset time, repeatedly sending a command prompt character string provided by the second equipment in a configuration file to a second port, and waiting for the preset time; and if the second character string returned by the second equipment is still not received after the command prompt character string provided by the second equipment is sent for the preset times, the second equipment information of the second port fails to be scanned.
In one embodiment, the method further comprises: receiving a starting instruction sent by a preset timing task; and under the condition of receiving the starting instruction, executing the step of acquiring the port equipment list.
In one embodiment, before obtaining the port device list, the method further includes: and starting or forbidding part of ports to realize the test scene of connection of different devices.
In one embodiment, the method further comprises: designing a test scene, compiling a corresponding automatic script, and debugging the compiled automatic script to generate the test script.
In one embodiment, the method further comprises: after the test is completed, exit is made to the login window and the cache is cleared.
An automated testing apparatus provided in an embodiment of the present invention includes: the serial port configuration debugging unit is used for acquiring a port equipment list, wherein the port equipment list comprises ports of all connected equipment; traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port; the workstation application software operation simulation unit is used for scanning all the devices to obtain second device information; and the checking unit is used for carrying out consistency checking on the basis of the first equipment information and the second equipment information.
In an embodiment, the serial port configuration debugging unit is further configured to enable or disable a specific port to implement a scenario of connection of different devices.
An embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory is used to store one or more computer instructions, and the one or more computer instructions, when executed by the processor, implement the automated testing method as described above.
An embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program is used for implementing the automated testing method as described above when being executed by one or more processors.
According to the automatic testing method and device provided by the embodiment of the invention, the first equipment information is automatically called, the workstation application software is automatically started and logged in, the equipment is automatically scanned to obtain the second equipment information, and the first equipment information and the second equipment information are automatically corrected, so that the automatic testing is realized. The manual operation time can be saved, the human resource cost and the time cost of manual connection verification test are reduced, the verification of the test result is more accurate, and the working efficiency and quality are improved.
Drawings
Fig. 1 is a schematic flow chart illustrating an automated testing method according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart illustrating a process of acquiring first device information according to an embodiment of the present invention.
Fig. 3 is a schematic flow chart illustrating a process of acquiring information of a second device according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an automated testing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present embodiment provides an automatic testing method, which is implemented based on an automatic testing apparatus, as shown in fig. 1, and includes:
step 01, obtaining a port equipment list, wherein the port equipment list comprises ports of all connected equipment.
The automatic testing device receives a starting instruction, and acquires a port device list by calling a Software Development Kit (SDK) preset by an operating system; the available port list can be viewed through my computer- > management- > device manager- > port, and the port device list is the port information of all connected devices.
And 02, traversing all the ports based on the port equipment list to obtain first equipment information corresponding to each port.
The manufacturer of each device provides a device command corresponding to the device, and the device command is used for confirming whether the device is normally connected. As shown in fig. 2, traversing all ports based on the port device list to obtain first device information corresponding to each port, including:
step 021, sending a command prompt character string provided by the first equipment in the configuration file to a first port in the port equipment list for inquiry;
022, receiving a first character string returned by the first device, and comparing the first character string with a confirmation character string of the first device in the configuration file;
023, if the first character string is matched with the confirmation character string, determining first device information corresponding to the first port;
and 024, if the first character string is not matched with the confirmation character string, continuing to send a command prompt character string of the next device in the configuration file to inquire until the device information connected with the first port is confirmed or the inquiry of all devices in the configuration file is completed.
If we start to traverse the first port (first port) in the port device list, first send a command prompt (cmd) character string provided by the electrocardiograph (first device) in the configuration file, the first device will return a character string (first character string), compare the character string returned by the device connected to the first interface with an ack confirmation character (ack) string provided by the electrocardiograph manufacturer, and if the character string returned by the device connected to the first interface is inconsistent with the ack confirmation character (ack) string provided by the electrocardiograph manufacturer, the device connected to the port is considered to be not the electrocardiograph; the next device in the configuration file is taken in turn for an inquiry, and if the return instruction is consistent with that provided by the sphygmomanometer manufacturer, we confirm that the port is connected to the sphygmomanometer device (the first port connected device). Recording information of the first port connected with the sphygmomanometer into first equipment information, optionally, recording in a format of: com port 1-sphygmomanometer-model, and storing the device information corresponding to the port to the local for verification.
And step 03, scanning all the devices to obtain second device information.
Calling application software of the workstation, and automatically inputting an administrator account and a password corresponding to a pre-generated test script in a login window to login a target account; and under the condition that the target account is successfully logged in, scanning all the devices to obtain second device information, optionally, automatically selecting health detection to enter a scanning device page after the target account is successfully logged in, and clicking a scanning device button to start scanning. Optionally, the preset login procedure is 5 minutes.
As shown in fig. 3, the step of scanning all devices to obtain the second device information includes:
in step 031, it is checked whether the port is open. The port device list is obtained by calling a Software Development Kit (SDK) preset by an operating system, and then whether a port is opened is checked. Optionally, the port is checked for open by calling the open function of the system.
Step 032, if the port is opened, sending a command prompt character string provided by the second device in the configuration file to the second port in the port device list for query.
If the port can be opened normally, it indicates that the port is not occupied, at this time, a device instruction can be sent to the port according to the device information configured by the configuration file, wherein the device instruction is a command prompt character string provided by the device.
Step 033, receiving a second character string returned by the second device, and comparing the second character string with a confirmation character string of the second device in a configuration file;
and if the second character string is matched with the confirmation character string, determining second equipment information corresponding to the second port. And if the returned second character string is consistent with the confirmation character string of the second equipment in the configuration file, confirming the second equipment corresponding to the second port, and successfully scanning the second equipment information of the second port.
And if the second character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the information of the second device connected with the second port is determined or the inquiry of all devices in the configuration file is completed.
Step 034, if the port cannot be opened, checking the configuration file, and determining whether the second device supports the second connection mode; if the second equipment supports the second connection mode, the second equipment is connected through the second connection mode; and receiving second device information sent by the second device through the second connection mode. It is to be understood that step 034 is not a step after step 033 and that the reference numerals are merely representative and do not represent the order of execution.
If the device supports two connection modes in the configuration file information, such as serial connection and Bluetooth connection, the device and the test device are connected through a Bluetooth device. And starting the Bluetooth function to establish Bluetooth connection with the equipment. Based on the wireless communication technology, the test equipment receives and analyzes the message broadcasted by the Bluetooth equipment, obtains equipment information such as equipment type, equipment model and the like from the analyzed message, and the workstation application software sends a Bluetooth control message corresponding to the control information to control the Bluetooth equipment.
When the workstation application software checks the port and calls a system open function to return to be abnormal and cannot be opened, the port is indicated to be in an occupied state, the port cannot be scanned by sending a command possibly because other equipment is not released after being disconnected, at the moment, the workstation application software checks the configuration file to judge whether the equipment supports a second connection mode, and if the second connection mode is supported, the equipment is also connected through the second connection mode; if the second mode is not supported, the port scanning fails, and the failure reason is recorded, optionally, the mode of recording the port scanning failure reason may be: port X is already in the occupied state.
And 04, performing consistency check based on the first equipment information and the second equipment information. After traversing the port list, obtaining first equipment information, and transmitting the first equipment information to a checking tool; and after the application program of the workstation scans the port connection equipment, the second equipment information is obtained, the first equipment information and the second equipment information are sent to a verification tool, and finally the consistency of the first equipment information and the second equipment information is verified by the verification tool.
And comparing the port lists one by one to determine whether the port lists are consistent, for example: whether the port numbers are consistent, whether the device name character strings are consistent, whether the device model character strings are consistent and the like, whether the character string selection is a full matching principle is determined, if the attributes are matched successfully, the scanning result of the workstation is considered to be correct, the check is consistent, the check is passed, and the test of the device is marked to be passed.
If at least one attribute check is inconsistent, the check is not passed, and the test failure of the equipment test case is marked. The condition that the attributes are inconsistent comprises the scenes that serial port numbers are inconsistent, device types are inconsistent, device models are not returned and the like, if any one of the serial port numbers is inconsistent, the workstation considers that the scanning of the device by the workstation fails, and failure description is recorded, wherein the failure description refers to NULL (NULL) if the device model is not consistent. Optionally, for the bluetooth connected device, only the device type and the device model are checked, and the serial number is not checked. And after the test is finished, forming a test report by using the test result list and sending the test report to a related test developer.
In an embodiment of the present invention, the automated testing method further includes: if the second character string returned by the second equipment is not received within the preset time, the command prompt character string provided by the second equipment in the configuration file is repeatedly sent to the second port, and the preset time is waited; and if the second character string returned by the second equipment is still not received after the command prompt character string provided by the second equipment for the preset times is sent, the second equipment information scanning of the second port fails.
Defining the time for the receiving device to return the instruction, if the time is out, resending the instruction for confirmation, and if the time exceeds a preset number, resending the instruction, considering that the connection is abnormal, the scanning fails, and the recording fails, and optionally, the method for recording the reason for the failure of the scanning port may be: the connection times out.
In an embodiment of the present invention, the automated testing method further includes: receiving a starting instruction sent by a preset timing task; and executing the step of acquiring the port equipment list under the condition of receiving the starting instruction. The Windows timing task can realize timing execution of the script, Windows adds the timing task, timing execution of the batch processing file, and compiling of the batch processing file to command execution of the executable file of the automatic script, so that timing starting test is realized. And receiving a starting instruction sent by the windows in a set time period, and starting to execute the steps 01 to 04.
In an embodiment of the present invention, before acquiring the port device list, the method further includes: and starting or forbidding part of ports to realize the test scene of connection of different devices.
Scenarios where different devices are connected by enabling and disabling specific ports, for example, a test scenario where only 3 devices are connected includes: firstly, only a port 1 is tested to be connected with a device I, and a system SDK is called to disable a port 2 and a port 3, so that whether the device is correctly scanned and identified is verified; only the test port 2 is connected with the second equipment, and the second equipment is verified whether the second equipment is correctly scanned and identified by calling the system SDK to forbid the port 1 and the port 3; only testing the third port 3 connected with the third equipment, and disabling the port 1 and the port 2 by calling the system SDK to verify whether the third equipment is correctly scanned and identified; testing the port 1 and the port 2 to be connected with the equipment at the same time, and verifying whether the first equipment and the second equipment are scanned and identified correctly by calling the system SDK to disable the port 3; testing that the port 1 and the port 3 are connected with the equipment at the same time, and disabling the port 2 by calling a system SDK (software development kit), and verifying whether the equipment I and the equipment III are scanned and identified correctly; testing the simultaneous connection of the port 2 and the port 3 to the equipment, disabling the port 1 by calling the system SDK, and verifying whether the equipment II and the equipment III are correctly scanned and identified; and testing that the 3 ports are connected with the equipment at the same time, starting all the ports by calling a system SDK, and verifying whether the equipment I, the equipment II and the equipment III are all scanned and identified correctly. Through the test of the whole scene, the single connection and the simultaneous connection of different equipment are ensured not to influence each other, and the scanning identification of stock equipment is not influenced by the access of new equipment. Seven scenes are needed for three devices, when more new devices are connected, the three devices are combined with old devices for testing, more test scenes can be designed, and labor and time can be greatly saved due to application automation.
In an embodiment of the present invention, the automated testing method further includes: designing a test scene, compiling a corresponding automatic script, and debugging the compiled automatic script to generate the test script.
In an embodiment of the present invention, the automated testing method further includes: after the test is completed, exit to the login window and flush the cache. And after one test flow is finished, the initial state is recovered, namely the workstation returns to the last login page, exits the current scanning result, and clears the cache so as not to influence the scanning of the next scene.
In an embodiment of the present invention, before starting the automated test, the test equipment needs to be connected to the USB hub extended serial port, and all the test equipment needs to be connected manually, and all the test equipment needs to be started, so as to build a test environment.
As shown in fig. 4, the automatic test apparatus 100 according to this embodiment includes a serial port configuration debugging unit 10, a workstation application software operation simulation unit 20, and a verification unit 3.
Wherein:
the serial port configuration debugging unit 10 is configured to obtain a port device list, where the port device list includes ports of all connected devices; traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port;
the workstation application software operates the simulation unit 20 for scanning all the devices to obtain the second device information;
the checking unit 30 is configured to perform consistency checking based on the first device information and the second device information.
Further, the serial port configuration debugging unit 10 is configured to call a software development kit preset by the operating system to obtain the port list. The serial port configuration debugging unit 10 is configured to send a command prompt string provided by the first device in the configuration file to the first port in the port device list for inquiry; receiving a first character string returned by the first equipment, and comparing the first character string with a confirmation character string of the first equipment in a configuration file; if the first character string is matched with the confirmation character string, determining first equipment information corresponding to the first port; and if the first character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the device information connected with the first port is confirmed or the inquiry of all devices in the configuration file is completed.
Further, the workstation application software operation simulation unit 20 is configured to automatically input an administrator account and a password corresponding to a pre-generated test script into a login window to log in a target account; and scanning all the devices to obtain second device information under the condition that the target account is successfully logged in.
The workstation application software operates the simulation unit 20 also to check whether the port is open: if the port is opened, sending a command prompt character string provided by the second equipment in the configuration file to the second port in the port equipment list for inquiry; receiving a second character string returned by the second equipment, and comparing the second character string with a confirmation character string of the second equipment in a configuration file; if the second character string is matched with the confirmation character string, determining second equipment information corresponding to the second port; and if the second character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the information of the second device connected with the second port is determined or the inquiry of all devices in the configuration file is completed. If the port cannot be opened, checking the configuration file, and judging whether the second equipment supports a second connection mode; if the second device supports the second connection mode, connecting the second device through the second connection mode; and receiving the second device information sent by the second device through the second connection mode.
The serial port configuration debugging unit 20 is further configured to enable or disable a specific port, so as to implement a scenario of connection of different devices.
The embodiment provides an electronic device, which may be a mobile phone, a computer, a tablet computer, or the like, and includes a memory and a processor, where the memory stores a computer program, and the computer program is executed by the processor to implement the automated testing method as described in the embodiment. It is to be appreciated that the electronic device can also include input/output (I/O) interfaces, as well as communication components.
Wherein the processor is adapted to perform all or part of the steps of the automated testing method as in the embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in the electronic device, as well as application-related data.
The Processor may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, and is configured to execute the automated testing method in the above embodiments.
The Memory may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk.
The present embodiment provides a computer-readable storage medium. Each functional unit in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
And the aforementioned storage medium includes: flash memory, hard disk, multimedia card, card type memory (e.g., SD or DX memory, etc.), Random Access Memory (RAM), Static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, server, APP application mall, etc., various media that can store program check codes, on which computer programs are stored, which when executed by a processor can implement the following method steps:
step 01, acquiring a port equipment list, wherein the port equipment list comprises ports of all connected equipment;
step 02, traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port;
step 03, scanning all the devices to obtain second device information;
and 04, performing consistency check based on the first equipment information and the second equipment information.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The foregoing describes the general principles of the present application in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present application are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present application. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the foregoing disclosure is not intended to be exhaustive or to limit the disclosure to the precise details disclosed.
The block diagrams of devices, apparatuses, systems referred to in this application are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art.
It should also be noted that in the devices, apparatuses, and methods of the present application, the components or steps may be decomposed and/or recombined. These decompositions and/or recombinations are to be considered as equivalents of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise. All directional indicators in the embodiments of the present application (such as upper, lower, left, right, front, rear, top, bottom … …) are only used to explain the relative positional relationship between the components, the movement, etc. in a particular posture (as shown in the drawings), and if the particular posture is changed, the directional indicator is changed accordingly. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Furthermore, reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and the like that are within the spirit and principle of the present invention are included in the present invention.

Claims (15)

1. An automated testing method, comprising:
acquiring a port equipment list, wherein the port equipment list comprises ports of all connected equipment;
traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port;
scanning all the devices to obtain second device information;
and performing consistency check based on the first equipment information and the second equipment information.
2. The method of claim 1, wherein obtaining the port device list comprises: and calling a software development kit preset by an operating system to acquire the port list.
3. The automated testing method of claim 1, wherein traversing all ports based on the port device list to obtain first device information corresponding to each port comprises:
sending a command prompt character string provided by the first equipment in the configuration file to a first port in the port equipment list for inquiry;
receiving a first character string returned by the first equipment, and comparing the first character string with a confirmation character string of the first equipment in a configuration file;
if the first character string is matched with the confirmation character string, determining first equipment information corresponding to the first port;
and if the first character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the device information connected with the first port is confirmed or the inquiry of all devices in the configuration file is completed.
4. The method of claim 1, wherein scanning all devices for second device information comprises:
automatically inputting an administrator account and a password corresponding to a pre-generated test script into a login window to login a target account;
and scanning all the devices to obtain second device information under the condition that the target account is successfully logged in.
5. The automated testing method of claim 4, wherein the step of scanning all devices for second device information comprises:
check if port is open:
if the port is opened, sending a command prompt character string provided by the second equipment in the configuration file to the second port in the port equipment list for inquiry;
receiving a second character string returned by the second equipment, and comparing the second character string with a confirmation character string of the second equipment in a configuration file;
if the second character string is matched with the confirmation character string, determining second equipment information corresponding to the second port;
and if the second character string is not matched with the confirmation character string, continuously sending a command prompt character string of the next device in the configuration file to inquire until the information of the second device connected with the second port is determined or the inquiry of all devices in the configuration file is completed.
6. The automated testing method of claim 5, wherein the step of scanning all devices for second device information comprises:
if the port cannot be opened, checking the configuration file, and judging whether the second equipment supports a second connection mode;
if the second device supports the second connection mode, connecting the second device through the second connection mode;
and receiving the second device information sent by the second device through the second connection mode.
7. The automated testing method of claim 5, further comprising: if a second character string returned by the second equipment is not received within preset time, repeatedly sending a command prompt character string provided by the second equipment in a configuration file to a second port, and waiting for the preset time; and if the second character string returned by the second equipment is still not received after the command prompt character string provided by the second equipment is sent for the preset times, the second equipment information of the second port fails to be scanned.
8. The automated testing method of claim 1, further comprising:
receiving a starting instruction sent by a preset timing task;
and executing the step of acquiring the port equipment list under the condition of receiving the starting instruction.
9. The automated testing method of claim 1, further comprising, prior to obtaining the list of port devices:
and starting or forbidding part of ports to realize the test scene of connection of different devices.
10. The automated testing method of claim 4, further comprising:
designing a test scene, compiling a corresponding automatic script, and debugging the compiled automatic script to generate the test script.
11. The automated testing method of claim 4, further comprising: after the test is completed, exit to the login window and flush the cache.
12. An automated testing apparatus, comprising:
the serial port configuration debugging unit is used for acquiring a port equipment list, wherein the port equipment list comprises ports of all connected equipment; traversing all ports based on the port equipment list to obtain first equipment information corresponding to each port;
the workstation application software operation simulation unit is used for scanning all the devices to obtain second device information;
and the checking unit is used for carrying out consistency checking on the basis of the first equipment information and the second equipment information.
13. The automated testing apparatus of claim 12, wherein the serial port configuration debugging unit is further configured to enable or disable a specific port to implement a scenario of connection of different devices.
14. An electronic device comprising a memory and a processor, the memory configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the automated testing method of any of claims 1-11.
15. A computer-readable storage medium, in which a computer program is stored which, when executed by one or more processors, is adapted to implement the automated testing method according to any one of claims 1-11.
CN202210615188.5A 2022-05-31 2022-05-31 Automatic testing method and device Pending CN114860613A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210615188.5A CN114860613A (en) 2022-05-31 2022-05-31 Automatic testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210615188.5A CN114860613A (en) 2022-05-31 2022-05-31 Automatic testing method and device

Publications (1)

Publication Number Publication Date
CN114860613A true CN114860613A (en) 2022-08-05

Family

ID=82641171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210615188.5A Pending CN114860613A (en) 2022-05-31 2022-05-31 Automatic testing method and device

Country Status (1)

Country Link
CN (1) CN114860613A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115426286A (en) * 2022-08-30 2022-12-02 歌尔科技有限公司 Automatic product testing method, device, equipment and computer readable storage medium
CN116483751A (en) * 2023-04-06 2023-07-25 河南翔宇医疗设备股份有限公司 Method, device and medium for identifying serial numbers

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115426286A (en) * 2022-08-30 2022-12-02 歌尔科技有限公司 Automatic product testing method, device, equipment and computer readable storage medium
CN116483751A (en) * 2023-04-06 2023-07-25 河南翔宇医疗设备股份有限公司 Method, device and medium for identifying serial numbers

Similar Documents

Publication Publication Date Title
CN114860613A (en) Automatic testing method and device
CN110908909B (en) Automatic test method, device, storage medium and equipment
CN111124919A (en) User interface testing method, device, equipment and storage medium
CN109408375B (en) Method and device for generating interface document
CN108990047B (en) Test method, device and medium for subscription relationship management data preparation platform
CN111045921A (en) Automatic interface testing method and device, computer equipment and storage medium
CN109558313B (en) Method and device for constructing abnormal test scene
CN110119350A (en) Software Development Kit test method, device and equipment and computer storage medium
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN111679982A (en) Automatic testing method for REST API (representational State transfer) interface software
CN116166525A (en) Method and device for generating test script
CN111309602A (en) Software testing method, device and system
CN109002305A (en) A kind of update method and its system of device program
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
US20230315620A1 (en) System and Method for Diagnosing a Computing Device in Safe Mode
CN107203373B (en) Interface control acquiring method, interface control testing method, interface control acquiring device and interface control testing device
KR101252358B1 (en) Apparatus and method for testing plc command
CN109918287A (en) APP upgrading test method, apparatus, computer equipment and storage medium
CN116302738A (en) Method, system, equipment and storage medium for testing chip
CN108845932B (en) Unit testing method and device of network library, storage medium and terminal
CN111209197B (en) Application continuous integration test method, system, equipment and storage medium
CN112433946A (en) Interface test management method, device, equipment and storage medium
CN111597101A (en) SDK access state detection method, computer device and computer readable storage medium
CN111966387B (en) Firmware upgrading method, device, equipment and storage medium of NTB card
CN116955193A (en) Interface testing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination