Automatic testing method and system for equipment
Through automated keystroke tools and automated testing frameworks, automated addition and operation testing of IOT devices are achieved, solving the problems of inefficiency and high cost caused by relying on manual operations in existing IOT devices, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411592579.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-28
AI Technical Summary
Existing IOT equipment testing relies on manual operations, resulting in long test time, high cost, prone to human errors, and inefficient testing.
An automated testing method and system for equipment is proposed. Through automated keystroke tools and automated testing frameworks, automated addition and operation testing of equipment to be operated is realized instead of manual operation.
Automatic testing is realized instead of manual operation, reducing the cost and risk of manual intervention and improving the efficiency and accuracy of the testing process.
Smart Images

Figure CN119544545A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to an automatic testing method and system for equipment. Background Art
[0002] IOT device testing is a key link to ensure the function, performance, compatibility, security and reliability of IoT devices. Testing covers functional verification, performance evaluation, compatibility testing, security testing and long-term stability testing, aiming to improve device quality and user experience and ensure data security. Through comprehensive testing, we can ensure that IOT devices can run stably and efficiently in actual applications.
[0003] Existing IOT device testing is done manually, requiring testers to manually view App information, add and delete devices, and manually operate devices, which consumes a lot of testing time and labor costs, and is prone to human errors, resulting in low testing efficiency. Summary of the invention
[0004] In view of this, the present invention proposes an automated testing method and system for equipment, and the specific scheme is as follows:
[0005] In the first part, the present invention proposes an automated testing method for a device, which is applied to a system including a device to be operated, an automated keystroke tool, an automated testing framework, and a background server. The method includes:
[0006] For the device to be operated that is not connected to the network, a device adding request for the device to be operated is sent to the background server, and the automated key striking tool is controlled by the automated testing framework to automatically control the key striking of the device to be operated, so as to realize the networking of the device to be operated;
[0007] For the device to be operated in the networked state, a test operation request is sent to the background server, and the automated test framework performs an automated operation test on the device to be operated in the networked state based on the test operation request; different test operation requests correspond to different operation tests.
[0008] In a specific embodiment, the device to be operated includes a control button; the automatic button control includes: controlling the automated button striking tool to perform a striking operation on the control button according to a preset rule to achieve networking of the device to be operated;
[0009] The preset rules include: a time interval rule between two striking actions, and / or a stay time rule of the striking head of the automated key striking tool on the control key, and / or a number of consecutive strikes rule.
[0010] In a specific embodiment, it also includes:
[0011] Acquire a test item of the device to be operated according to the device type of the device to be operated;
[0012] Integrate all or part of the test items to form test cases corresponding to the device to be operated and encapsulate the test cases in the automated testing framework, so that the automated testing framework performs automated operation tests on the device to be operated in a networked state based on the test cases and the test operation requests.
[0013] In a specific embodiment, the operational test includes viewing device information;
[0014] The checking of device information includes:
[0015] Sending a request for viewing device information of the device to be operated to the backend server;
[0016] Sending a request for calling an interface to the backend server through the automated testing framework to call a device information viewing interface and obtain device information of the device to be operated;
[0017] Returns the device information.
[0018] In a specific embodiment, the device information includes: one or more of: device power level, device trigger status, device operation status, device local log, and cloud operation log.
[0019] In a specific embodiment, the operational testing includes removing a device;
[0020] The deleting device comprises:
[0021] Sending a deletion request for the device to be operated to the backend server;
[0022] Sending a request for calling an interface to the backend server through the automated testing framework to call a device deletion interface, and controlling the deletion of the device to be operated;
[0023] If the deletion is successful, a deletion success signal is returned.
[0024] In a specific embodiment, the operational test includes testing equipment;
[0025] The test equipment includes:
[0026] Sending a test request for the device to be operated to the backend server;
[0027] Sending a request for calling an interface to the backend server through the automated testing framework to call a test device interface, and controlling a preset test operation to be performed on the device to be operated;
[0028] Returns the test results.
[0029] In a specific embodiment, the “to achieve networking of the device to be operated” further includes:
[0030] Performing a polling detection operation on the status of the device to be operated at a preset time interval through the automated testing framework to determine whether the device to be operated is added successfully;
[0031] Returns the test result.
[0032] In a specific embodiment, the preset time interval increases or decreases at a preset frequency;
[0033] It also includes: the patrol detection operation automatically stops after a preset time; or,
[0034] If a stop command is obtained through the automated testing framework, the polling detection operation is stopped.
[0035] In the second part, the present invention proposes an automated testing system for a device, which is applied to a system including a device to be operated, an automated keystroke tool, an automated testing framework, and a background server, and the system includes:
[0036] An adding module is used to send a device adding request for the device to be operated that is not connected to the network to the backend server, and control the automatic key striking tool to automatically control the key striking of the device to be operated through the automatic test framework, so as to realize the networking of the device to be operated;
[0037] The operation module is used to send a test operation request to the background server for the device to be operated in the networked state, and perform an automated operation test on the device to be operated in the networked state based on the test operation request through the automated testing framework; different test operation requests correspond to different operation tests.
[0038] Beneficial effects:
[0039] The present invention provides an automated testing method and system for equipment, which realizes automated addition of equipment and automated operation testing through interface automated testing and automated keystroke tools, thereby replacing manual operation with automated testing, reducing the cost and risk of manual intervention, and improving the efficiency and accuracy of the entire testing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of an automated testing method for a device according to an embodiment of the present invention;
[0041] Figure 2 is a schematic diagram of an automated testing system module for a device according to an embodiment of the present invention;
[0042] Figure 3 is a detailed flow chart of the automated testing method for a device according to an embodiment of the present invention;
[0043] Figure 4 It is a schematic diagram of the specific composition of the operation test of an embodiment of the present invention.
[0044] Figure numerals: 1-adding module; 2-operating module. DETAILED DESCRIPTION
[0045] In the following, various embodiments of the present disclosure will be described more fully. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.
[0046] The terms used in the various embodiments disclosed in the present invention are only used for the purpose of describing specific embodiments and are not intended to limit the various embodiments disclosed in the present invention. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise specified, all terms used herein (including technical terms and scientific terms) have the same meaning as the meanings commonly understood by ordinary technicians in the field of the various embodiments disclosed in the present invention. The terms (such as the terms defined in the generally used dictionary) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in the various embodiments disclosed in the present invention.
[0047] Example 1
[0048] Embodiment 1 of the present invention discloses an automated testing method for a device, which realizes automated addition of devices and automated operation testing through interface automated testing and automated keystroke tools, thereby realizing automated testing instead of manual operation, reducing the cost and risk of manual intervention, and improving the efficiency and accuracy of the entire testing process. The specific scheme is as follows:
[0049] An automated testing method for a device is applied to a system including a device to be operated, an automated keystroke tool, an automated testing framework, and a background server, as shown in the attached Figure 1 and attached Figure 3 As shown, the method includes:
[0050] 101. For the devices to be operated that are not connected to the Internet, a device adding request for the devices to be operated is sent to the background server, and the automated key striking tool is controlled by the automated testing framework to automatically control the keys of the devices to be operated, so as to realize the networking of the devices to be operated.
[0051] This embodiment is based on the Python programming language, and combines the pytest test framework, the requests library for HTTP requests, the pyserial library for serial communication, the yaml format file for configuration management, and the allure report generation tool to create a comprehensive automated testing framework. During the execution of test cases, the automated testing framework will automatically send HTTP requests for calling interfaces to the background server according to the preset test steps and conditions to simulate actual user operations or system interactions, thereby realizing the verification and testing of system functions.
[0052] Specifically, in this embodiment, for the device to be operated that is currently not connected to the network, first, a clear device addition request is sent to the background server through the relevant functional modules in the automated testing framework. The device addition request contains the necessary information such as the unique identifier of the device to be operated (such as MAC address, serial number, etc.), device model, manufacturer information, etc., so that the background server can accurately identify and record the device. This request is intended to register the device to be operated in the management system of the background server for subsequent monitoring and testing. Further, the script execution capability and control interface of the automated testing framework are used to control the startup of the automated keystroke tool and automatically control the keystrokes of the device to be operated, that is, to control the automated keystroke tool to simulate manual operation and press the control buttons on the device according to preset rules to achieve networking of the device to be operated. Thereby, automated testing is realized instead of manual operation, which improves the efficiency and accuracy of the entire testing process.
[0053] 102. For the devices to be operated in the networked state, a test operation request is sent to the background server, and an automated operation test is performed on the devices to be operated in the networked state based on the test operation request through the automated testing framework; different test operation requests correspond to different operation tests.
[0054] For devices to be operated that are connected to the Internet, first send a clear test operation request to the background server through the relevant functional modules in the automated test framework. Then, the automated test framework is used to parse the test operation request and convert it into automated operation instructions for the connected device, and then a series of automated operation tests are performed on the device. At the same time, the automated test framework will call the relevant interface to the background server in real time during the test process to obtain the necessary test data or perform specific auxiliary operations, thereby effectively supporting the smooth execution of test cases. Different test operation requests will trigger the framework to execute different operation test processes to ensure that all aspects of the device function are covered.
[0055] Furthermore, for different test operation requests in the networking state of the device to be operated, the test device interface can also be called through the background server, and the automated key-strike tool can be controlled to perform different test operations. That is, in actual applications, the application of automated key control technology is not limited to the networking process of the device. No matter what state the device to be operated is in, as long as it needs to be operated by keys, the automated key-strike tool can play a role. Taking the water immersion sensor as an example, if you want to restore it to factory settings, you can also control the automated key-strike tool to simulate manual operation, press the control buttons on the device according to preset rules, to reset the device and restore the factory settings... Thereby realizing automated testing instead of manual operation, improving the efficiency and accuracy of the entire testing process.
[0056] In this embodiment, as shown in the attached Figure 4 As shown in the figure, the operation test includes viewing device information, testing devices, and deleting devices. In actual applications, first, a clear test operation request is sent to the background server through the relevant functional modules in the automated test framework. Subsequently, the automated test framework is used to parse the instructions and parameters in the request, and the operation test is performed according to the device type, firmware version, network configuration and other information. During the test, the automated test framework will record the test data in real time, capture abnormal information, and generate a detailed test report after the test is completed.
[0057] In this way, the system can realize automated operation testing of the devices to be operated in the networked state, which not only improves the test efficiency and accuracy, but also reduces the cost and risk of manual intervention. At the same time, due to the flexible configuration of test operation requests and test scripts, the system can easily cope with test scenarios of different device types and different test requirements.
[0058] In a specific embodiment, the device to be operated includes a control button; the automatic button control includes: controlling the automated button striking tool to perform a striking operation on the control button according to a preset rule to achieve networking of the device to be operated;
[0059] The preset rules include: a time interval rule between two striking actions, and / or a stay time rule of the striking head of the automated key striking tool on the control key, and / or a number of consecutive striking times.
[0060] In this embodiment, the device to be operated includes control buttons, which are key interfaces for realizing device functions and settings. In order to complete the networking operation of the device without manual intervention, this embodiment introduces an automated key-strike tool. In actual applications, the automated key-strike tool can be controlled by an automated test framework to accurately strike the control buttons according to preset rules, simulating the manual operation process of the user, thereby realizing the networking of the device to be operated.
[0061] Specifically, the preset rules define in detail the behavior pattern that the automated key striking tool should follow when performing tasks. In practical applications, the preset rules at least include: the time interval between two consecutive striking operations on the control key; the duration of the striking head of the automated key striking tool contacting and pressing the control key; and the number of consecutive strikes on the control key.
[0062] By comprehensively applying these preset rules, the automated keystroke tool can accurately simulate user operations and realize the automated networking process of the device to be operated. Furthermore, for different test operation requests in the networking state of the device to be operated, the test device interface can be called through the background server, and the automated keystroke tool can be controlled to perform different test operations. This not only improves the test efficiency, but also reduces the possibility of human errors, providing strong support for the testing of IoT devices. In practical applications, the above rules can be adjusted according to actual needs to enhance the flexibility and adaptability of automated testing.
[0063] In a specific embodiment, it also includes:
[0064] Obtaining test items of the device to be operated according to the device type of the device to be operated;
[0065] Integrate all or part of the test items to form test cases corresponding to the devices to be operated and encapsulate the test cases in an automated testing framework, so that the automated testing framework performs automated operation tests on the devices to be operated in a networked state based on the test cases and test operation requests.
[0066] In this embodiment, the entire automated test process includes further refinement and expansion. In actual applications, the system will dynamically obtain all test items corresponding to the device type according to the device type of the device to be operated. These test items may cover various aspects of the device, such as functional verification, performance evaluation, and stability testing, to ensure that the device can operate normally and meet established standards and requirements when connected to the Internet.
[0067] Furthermore, the system will intelligently analyze and integrate the acquired test items according to factors such as the priority, dependency, and test time of the test items, and combine all or part of the test items into a series of test cases; each test case contains necessary information such as specific test steps, expected results, and test data, so that the automated test can be clearly guided during execution. After completing the integration of the test cases, the system will encapsulate these test cases in the automated test framework; further, the automated test framework will perform automated operation tests on the devices to be operated in the networked state based on the information in the test cases and the received test operation requests. This not only improves the test efficiency and accuracy of the entire automated test process, but also realizes the dynamic management and flexible configuration of test items, providing strong support for the testing of different types of equipment.
[0068] In a specific embodiment, as shown in the attached Figure 4 As shown, the operational test includes viewing device information;
[0069] View device information including:
[0070] Send a request to the backend server for viewing device information of the device to be operated;
[0071] Send a request to call the interface to the backend server through the automated testing framework to call the device information viewing interface and obtain the device information of the device to be operated;
[0072] Returns device information.
[0073] In this embodiment, an operation test of viewing device information is included; specifically, the system first sends a request to view device information to the background server through a preset communication protocol or interface. The request contains a unique identifier of the device to be operated to ensure that the background server can accurately identify and locate the target device; then a request to call an interface is sent to the background server through the automated testing framework, and the request is intended to call the preset interface for viewing device information on the background server, which is responsible for processing and responding to the request for viewing device information. Once the interface for viewing device information is successfully called, the automated testing framework will retrieve and extract detailed information of the device to be operated from the database based on the parameters in the request. This information may include key attributes such as the device model, serial number, firmware version, and network connection status.
[0074] In actual applications, during the process of calling the interface, the automated testing framework can also perform data processing and verification operations, including but not limited to data encryption, identity authentication, permission checking and other security measures to ensure that the acquired device information is accurate, complete and complies with security specifications.
[0075] Furthermore, the automated testing framework will encapsulate the acquired device information about the device to be operated in a preset form and return it to the system that initiated the request through the original communication channel. After receiving the returned device information, the system will parse and display it so that the tester or manager can intuitively understand the current status and related configuration of the device. The operation test of viewing device information not only provides important data support for the automated testing of the device, but also lays the foundation for subsequent fault diagnosis, performance optimization, software upgrades, etc. By automatically viewing device information, the test efficiency and accuracy are significantly improved.
[0076] In a specific embodiment, the device information includes: one or more of: device power level, device trigger status, device operation status, device local log, and cloud operation log.
[0077] The device power is an important indicator to measure the power supply status of the device, reflecting the device's endurance or whether it needs to be charged / powered. By monitoring the device power in real time, it can be ensured that the device will not be interrupted due to power exhaustion during the execution of critical tasks, and it also helps to optimize energy efficiency; the device trigger state refers to whether the device is triggered by an external event or signal to enter a specific working mode or perform a specific task, which is crucial for rapid response and taking corresponding measures; the device operation status reflects the current working status of the device, such as online, offline, triggered state, normal, etc., which is of great significance for remote monitoring and management of devices and ensuring service continuity and efficiency; the device local log records the detailed information and events generated by the device during operation, including start / stop time, error reports, warning information, performance statistics, etc., which is of great significance for in-depth analysis of device behavior, diagnosis of the root cause of the problem, and evaluation of system health; the cloud operation log provides centralized storage and access capabilities across regions and devices, which facilitates the monitoring and analysis of large-scale systems. Through the cloud log, administrators can more conveniently track the operation trajectory of the device, analyze trends, and share key information with multiple users or teams when necessary.
[0078] In this embodiment, by collecting and analyzing the device information, the system can achieve comprehensive monitoring and efficient management of the device status, thereby improving the overall operation and maintenance efficiency and service quality.
[0079] In one specific embodiment, the operational test includes removing the device;
[0080] Deleting devices includes:
[0081] Send a deletion request for the device to be operated to the backend server;
[0082] Send a request to call the interface to the background server through the automated testing framework to call the device deletion interface and control the deletion of the device to be operated;
[0083] If the deletion is successful, a deletion success signal is returned.
[0084] In this embodiment, it also includes an operation test for deleting a device; specifically, first, a deletion request for the device to be operated is sent to the background server, and the deletion request contains a unique identifier of the device to be deleted to ensure that the background can accurately identify and locate the target device; then, a request for calling an interface is sent to the background server through the automated testing framework, and the request is intended to call the preset device deletion interface on the background server. Once the device deletion interface is successfully called, the automated testing framework will call the corresponding device deletion interface according to the device identifier in the request to control the deletion of the device to be operated. If the deletion operation is successfully completed, the automated testing framework will return a clear deletion success signal to the user or system that initiated the deletion request.
[0085] In one specific embodiment, the operational test includes testing the device;
[0086] Test equipment includes:
[0087] Send a test request for the device to be operated to the backend server;
[0088] Send a request to call the interface to the backend server through the automated testing framework to call the test device interface, and control the preset test operation on the device to be operated;
[0089] Returns the test results.
[0090] In this embodiment, it also includes an operational test of the test equipment; specifically, the tester or the automated test script first sends a test request containing a unique identifier of the device to be tested to the background server through the corresponding interface; then a request to call the interface is sent to the background server through the automated test framework, and the request is intended to call the test equipment interface preset on the background server. Once the test equipment interface is successfully called, the automated test framework will perform a series of preset test operations, including but not limited to performance testing, functional testing, compatibility testing, etc.; after the test is completed, the automated test framework collects and analyzes all data generated during the test process, including successfully executed test items, failed test items, error logs, performance indicators, etc., and compiles and returns it into a test result report so that the tester can understand the test status of the device and make corresponding adjustments and optimizations based on the test results.
[0091] In a specific embodiment, “to achieve networking of the device to be operated” also includes:
[0092] The automated testing framework is used to poll the status of the device to be operated at a preset time interval to determine whether the device to be operated has been added successfully;
[0093] Returns the test result.
[0094] In this embodiment, once the device networking adding process is started, the automated testing framework will continuously monitor the device status. Specifically, the automated testing framework will poll the device to see if it has been successfully added and connected to the network at a preset time interval (such as every second, every minute, or other time intervals set according to actual needs), analyze and process the collected device status information, and generate a test result based on it and return it.
[0095] In a specific embodiment, the preset time interval increases or decreases at a preset frequency;
[0096] It also includes: the patrol detection operation automatically stops after a preset time; or,
[0097] If a stop command is obtained through the automated testing framework, the polling detection operation is stopped.
[0098] In this embodiment, in order to improve the flexibility and efficiency of the system, the preset time interval is designed to be dynamically adjusted according to the preset frequency, that is, the preset time interval can be increased or decreased according to actual needs, so that the system can automatically adjust the polling frequency according to the actual situation of the device networking or changes in external conditions to optimize resource utilization.
[0099] Specifically, when the device networking process is relatively smooth and each polling can quickly obtain confirmation that the device is online, the preset time interval may be gradually shortened according to the preset decreasing frequency to reduce the number of polling times and waiting time; on the contrary, if the device networking encounters obstacles, such as network delays, slow device response, etc., the preset time interval may be gradually extended according to the preset increasing frequency to increase the duration and fault tolerance of the polling detection, to ensure that the successful networking of the device can be finally detected.
[0100] Furthermore, it also includes an automatic stop mechanism for polling detection operations. After a preset period of time, if the device has successfully connected to the network and is in a stable state, or if the device is not detected online after multiple pollings and is considered to have timed out, the polling detection operation will automatically stop. This automatic stop mechanism helps prevent system resources from being occupied indefinitely and ensures that the system can respond to other tasks in a timely manner. In addition, if the automated testing framework obtains an explicit stop command, the polling detection operation will be stopped immediately regardless of whether the current polling is completed.
[0101] Example 2
[0102] Embodiment 2 of the present invention discloses an automated testing system for a device, which systematizes the automated testing method for a device in Embodiment 1 to make it more practical. The overall structure diagram of the automated testing system for the device is shown in the attached specification. Figure 2The specific plan is as follows:
[0103] An automated testing system for a device is applied to a system including a device to be operated, an automated keystroke tool, an automated testing framework, and a background server, the system comprising:
[0104] An adding module is used to send a device adding request for the device to be operated that is not connected to the Internet to the background server, and control the automated key striking tool to automatically control the key strokes of the device to be operated through the automated test framework, so as to realize the networking of the device to be operated;
[0105] The operation module is used to send a test operation request to the background server for the device to be operated in the networked state, and perform automated operation tests on the device to be operated in the networked state based on the test operation request through the automated testing framework; different test operation requests correspond to different operation tests.
[0106] Furthermore, for different test operation requests in the networking state of the device to be operated, the test device interface can also be called through the background server, and the automated key-strike tool can be controlled to perform different test operations. That is, in actual applications, the application of automated key control technology is not limited to the networking process of the device. No matter what state the device to be operated is in, as long as it needs to be operated by keys, the automated key-strike tool can play a role. Taking the water immersion sensor as an example, if you want to restore it to factory settings, you can also control the automated key-strike tool to simulate manual operation, press the control buttons on the device according to preset rules, to reset the device and restore the factory settings... Thereby realizing automated testing instead of manual operation, improving the efficiency and accuracy of the entire testing process.
[0107] In a specific embodiment, the device to be operated includes a control button; the automatic button control includes: controlling the automated button striking tool to perform a striking operation on the control button according to a preset rule to achieve networking of the device to be operated;
[0108] The preset rules include: a time interval rule between two striking actions, and / or a stay time rule of the striking head of the automated key striking tool on the control key, and / or a number of consecutive striking times.
[0109] In a specific embodiment, it also includes:
[0110] Obtaining test items of the device to be operated according to the device type of the device to be operated;
[0111] Integrate all or part of the test items to form test cases corresponding to the devices to be operated and encapsulate the test cases in an automated test framework so that the automated test framework performs automated operation tests on the devices to be operated in a networked state based on the test cases and test operation requests.
[0112] In a specific embodiment, the operational test includes viewing device information;
[0113] View device information including:
[0114] Send a request to the backend server for viewing device information of the device to be operated;
[0115] Send a request for calling an interface to the backend server through the automated testing framework to call the device information viewing interface and obtain the device information of the device to be operated;
[0116] Returns device information.
[0117] In a specific embodiment, the device information includes: one or more of: device power level, device trigger status, device operation status, device local log, and cloud operation log.
[0118] In one specific embodiment, the operational test includes removing the device;
[0119] Deleting devices includes:
[0120] Send a deletion request for the device to be operated to the backend server;
[0121] Send a request to call the interface to the background server through the automated testing framework to call the device deletion interface and control the deletion of the device to be operated;
[0122] If the deletion is successful, a deletion success signal is returned.
[0123] In one specific embodiment, the operational test includes testing the device;
[0124] Test equipment includes:
[0125] Send a test request for the device to be operated to the backend server;
[0126] Send a request to call the interface to the backend server through the automated testing framework to call the test device interface, and control the preset test operation on the device to be operated;
[0127] Returns the test results.
[0128] In a specific embodiment, “to achieve networking of the device to be operated” also includes:
[0129] The backend server performs polling detection operation on the status of the device to be operated at a preset time interval to determine whether the device to be operated is added successfully;
[0130] Returns the test result.
[0131] In a specific embodiment, the preset time interval increases or decreases at a preset frequency;
[0132] It also includes: the patrol detection operation automatically stops after a preset time; or,
[0133] If a stop command is obtained through the automated testing framework, the polling detection operation is stopped.
[0134] The present invention provides an automated testing method and system for equipment, which realizes automated addition of equipment and automated operation testing through interface automated testing and automated keystroke tools, thereby replacing manual operation with automated testing, reducing the cost and risk of manual intervention, and improving the efficiency and accuracy of the entire testing process.
[0135] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required for implementing the present invention. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be changed accordingly and located in one or more devices different from the present implementation scenario.
Claims
1. An automated testing method for a device, characterized in that: Applied to a system including a device to be operated, an automated keystroke tool, an automated test framework, and a background server, the method includes: For the device to be operated that is not connected to the network, a device adding request for the device to be operated is sent to the background server, and the automated key striking tool is controlled by the automated testing framework to automatically control the key striking of the device to be operated, so as to realize the networking of the device to be operated; For the device to be operated in the networked state, a test operation request is sent to the background server, and the automated test framework performs an automated operation test on the device to be operated in the networked state based on the test operation request; different test operation requests correspond to different operation tests.
2. The automated testing method for a device according to claim 1, characterized in that: The device to be operated includes a control button; the automatic button control includes: controlling the automatic button striking tool to perform a striking operation on the control button according to a preset rule to achieve networking of the device to be operated; The preset rules include: a time interval rule between two striking actions, and / or a stay time rule of the striking head of the automated key striking tool on the control key, and / or a number of consecutive strikes rule.
3. The automated testing method for a device according to claim 1, characterized in that: Also includes: Acquire a test item of the device to be operated according to the device type of the device to be operated; Integrate all or part of the test items to form test cases corresponding to the device to be operated and encapsulate the test cases in the automated testing framework, so that the automated testing framework performs automated operation tests on the device to be operated in a networked state based on the test cases and the test operation requests.
4. The automated testing method for a device according to claim 1, characterized in that: The operation test includes checking device information; The checking of device information includes: Sending a request for viewing device information of the device to be operated to the backend server; Sending a request for calling an interface to the backend server through the automated testing framework to call a device information viewing interface and obtain device information of the device to be operated; Returns the device information.
5. The automated testing method for a device according to claim 4, characterized in that: The device information includes: one or more of device power, device trigger status, device operation status, device local log, and cloud operation log.
6. The automated testing method for a device according to claim 1, characterized in that: The operational testing includes removing the device; The deleting device comprises: Sending a deletion request for the device to be operated to the backend server; Sending a request for calling an interface to the backend server through the automated testing framework to call a device deletion interface, and controlling the deletion of the device to be operated; If the deletion is successful, a deletion success signal is returned.
7. The automated testing method for a device according to claim 1, characterized in that: The operational test includes testing equipment; The test equipment includes: Sending a test request for the device to be operated to the backend server; Sending a request for calling an interface to the backend server through the automated testing framework to call a test device interface, and controlling a preset test operation to be performed on the device to be operated; Returns the test results.
8. The automated testing method for a device according to claim 1, characterized in that: The "to achieve networking of the device to be operated" also includes: Performing a polling detection operation on the status of the device to be operated at a preset time interval through the automated testing framework to determine whether the device to be operated is added successfully; Returns the test result.
9. The automated testing method for a device according to claim 8, characterized in that: The preset time interval increases or decreases at a preset frequency; It also includes: the patrol detection operation automatically stops after a preset time; or, If a stop command is obtained through the automated testing framework, the polling detection operation is stopped.
10. An automated testing system for a device, characterized in that: Applied to a system including a device to be operated, an automated keystroke tool, an automated test framework, and a background server, the system including: An adding module is used to send a device adding request for the device to be operated that is not connected to the network to the backend server, and control the automatic key striking tool to automatically control the key striking of the device to be operated through the automatic test framework, so as to realize the networking of the device to be operated; The operation module is used to send a test operation request to the background server for the device to be operated in the networked state, and perform an automated operation test on the device to be operated in the networked state based on the test operation request through the automated testing framework; different test operation requests correspond to different operation tests.