Equipment testing method and device, electronic equipment and storage medium
By obtaining the imported test files and automatically sending test instructions, the problem of tedious manual input of instructions in equipment testing is solved, and efficient automation of equipment testing is achieved.
Patent Information
- Application Number
- CN202410859002.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-15
AI Technical Summary
During the equipment testing process, testers need to manually enter multiple test instructions, which is cumbersome and inefficient, resulting in low testing efficiency.
By obtaining the imported test files, the test instructions are automatically sent to the second electronic device and the test results are received, thereby reducing manual operations and improving test efficiency.
It realizes the automation of equipment testing, reduces the operating steps of testers, and significantly improves testing efficiency.
Smart Images

Figure CN118779167A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a device testing method, apparatus, electronic device and storage medium. Background Art
[0002] At present, equipment testing is a means of controlling equipment design and a means of checking and reviewing the product quality of equipment. Testers can check and test equipment through test instructions. When testers conduct product testing on equipment, they often need to manually input multiple test instructions, which is cumbersome and has low efficiency in testing equipment. Summary of the invention
[0003] The embodiments of the present application disclose a device testing method, an apparatus, an electronic device and a storage medium, which can improve the testing efficiency of the device testing.
[0004] The present application embodiment discloses a device testing method, which is applied to a first electronic device, wherein the first electronic device establishes a communication connection with a second electronic device; the method includes:
[0005] Obtain an imported test file; the test file contains instruction information corresponding to a plurality of test instructions respectively;
[0006] According to the test file, send instruction information corresponding to at least part of the test instruction to the second electronic device, so that the second electronic device performs a test service according to the received instruction information corresponding to the test instruction and obtains a test result corresponding to the test service;
[0007] Receive the test result sent by the second electronic device.
[0008] As an optional implementation, before obtaining the imported test file, the method further includes:
[0009] Acquire login data, and send the login data to the second electronic device, so that the second electronic device verifies the login data and obtains a login result;
[0010] receiving the login result sent by the second electronic device;
[0011] The sending, according to the test file, instruction information corresponding to at least part of the test instruction to the second device includes:
[0012] If the login result indicates that the login is successful, then according to the test file, instruction information corresponding to at least part of the test instruction is sent to the second device.
[0013] As an optional implementation manner, the sending at least part of the instruction information corresponding to the test instruction to the second electronic device includes:
[0014] Sending instruction information corresponding to each test instruction to the second electronic device in sequence according to the arrangement order of the multiple test instructions;
[0015] After receiving the test result sent by the second electronic device, the method further includes:
[0016] If it is determined that the first test result indicates that the test service processing fails, stop sending the next test instruction to the second electronic device; the first test result is the test result corresponding to the instruction information currently sent by the first electronic device;
[0017] If it is determined that the first test result indicates that the test service processing is successful, a next test instruction is sent to the second electronic device.
[0018] As an optional implementation manner, the instruction information includes a first address and an execution instruction, the first address is the address of the second electronic device, and the execution instruction is used to indicate a test service that needs to be executed.
[0019] The present application embodiment discloses a device testing method, which is applied to a second electronic device, where the second electronic device establishes a communication connection with a first electronic device; the method includes:
[0020] Receiving instruction information corresponding to a test instruction sent by a first electronic device; the test instruction is one of a plurality of test instructions included in a test file acquired by the first electronic device;
[0021] Execute the test service according to the instruction information corresponding to the test instruction, and obtain the test result corresponding to the test service;
[0022] The test result is sent to the first electronic device.
[0023] As an optional implementation manner, executing the test service according to the instruction information corresponding to each test instruction includes:
[0024] Parsing the instruction information corresponding to the test instruction to obtain a first address and an execution instruction corresponding to the test instruction;
[0025] determining whether the first address matches a target address corresponding to the second electronic device;
[0026] If it is determined that the first address matches the target address corresponding to the second electronic device, the test service corresponding to the execution instruction is executed according to the execution instruction.
[0027] The present application embodiment discloses a device testing apparatus, which is applied to a first electronic device, wherein the first electronic device establishes a communication connection with a second electronic device; the apparatus includes:
[0028] A file acquisition module, used to acquire an imported test file; the test file contains instruction information corresponding to a plurality of test instructions respectively;
[0029] An instruction sending module is used to send instruction information corresponding to at least part of the test instruction to the second electronic device according to the test file, so that the second electronic device performs a test service according to the instruction information corresponding to the received test instruction and obtains a test result corresponding to the test service.
[0030] The result receiving module is used to receive the test result sent by the second electronic device.
[0031] The present application embodiment discloses a device testing apparatus, which is applied to a second electronic device, and the second electronic device establishes a communication connection with a first electronic device; the apparatus includes:
[0032] An instruction receiving module, configured to receive instruction information corresponding to a test instruction sent by a first electronic device; the test instruction is one of a plurality of test instructions included in a test file acquired by the first electronic device;
[0033] A service execution module, used to execute the test service according to the instruction information corresponding to the test instruction, and obtain the test result corresponding to the test service;
[0034] The result sending module is used to send the test result to the first electronic device.
[0035] An embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any device testing method disclosed in the embodiment of the present application.
[0036] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, any device testing method disclosed in the embodiment of the present application is implemented.
[0037] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0038] The embodiment of the present application provides a device testing method, apparatus, electronic device and storage medium, wherein a first electronic device obtains an imported test file; the test file contains instruction information corresponding to a plurality of test instructions; the first electronic device sends instruction information corresponding to at least part of the test instructions to a second electronic device according to the test file, and the second electronic device performs a test service according to the instruction information corresponding to the received test instructions, and obtains a test result corresponding to the test service; the first electronic device receives the test result sent by the second electronic device. In implementing the embodiment of the present application, the first electronic device can automatically send instruction information corresponding to at least part of the test instructions to the second electronic device according to the obtained test file, so that the second electronic device performs the test service and obtains the test result corresponding to the test service, without the need for the test personnel to enter the test instructions one by one, reducing the operation of the test personnel in the device testing process, and improving the test efficiency of the device testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is an application scenario diagram of a device testing method disclosed in an embodiment of the present application;
[0041] Figure 2 It is a flow chart of a device testing method disclosed in an embodiment of the present application;
[0042] Figure 3 It is a flow chart of another device testing method disclosed in an embodiment of the present application;
[0043] Figure 4 is a schematic diagram of a display interface of a testing tool in an embodiment;
[0044] Figure 5 is a schematic diagram of a device test in an embodiment;
[0045] Figure 6 It is a flow chart of another device testing method disclosed in an embodiment of the present application;
[0046] Figure 7 It is a structural schematic diagram of a device testing apparatus disclosed in an embodiment of the present application;
[0047] Figure 8 It is a structural schematic diagram of another device testing device disclosed in an embodiment of the present application;
[0048] Fig. 9 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0051] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first electronic device may be referred to as a second electronic device, and similarly, a second electronic device may be referred to as a first electronic device. Both the first electronic device and the second electronic device are electronic devices, but they are not the same electronic devices.
[0052] The embodiments of the present application disclose a device testing method, apparatus, electronic device and storage medium, which can improve the testing efficiency of the device testing.
[0053] See also Figure 1 , Figure 1 It is an application scenario diagram of a device testing method disclosed in an embodiment of the present application. The device testing method is applicable to a first electronic device 101 and a second electronic device 102, and the electronic device 101, the electronic device and the second electronic device 102 may include but are not limited to mobile phones, tablet computers, wearable devices, laptop computers, PCs (Personal Computers), etc. The first electronic device 101 and the second electronic device 102 can establish a communication connection, and further, the first electronic device 101 can simultaneously establish a wired communication connection and a wireless communication connection with the second electronic device 102, and further, the first electronic device 101 and the second electronic device 102 can be connected by wired communication via a connection line 103 for transmitting data, and at the same time, the first electronic device 101 and the second electronic device 102 can establish a wireless network connection through a network protocol.
[0054] Optionally, the second electronic device may be a device produced on a production line that needs to be tested, or may be a device that needs to test the compatibility of a new application program added to the second electronic device.
[0055] The first electronic device 101 obtains an imported test file, which contains instruction information corresponding to multiple test instructions. According to the test file, the first electronic device 101 sends instruction information corresponding to at least part of the test instructions to the second electronic device, so that the second electronic device 102 performs a test service according to the instruction information corresponding to the received test instruction, and obtains a test result corresponding to the test service. The second electronic device 102 receives the instruction information corresponding to the test instruction sent by the first electronic device 101, and executes the test service according to the instruction information corresponding to the test instruction, and obtains a test result corresponding to the test service. The second electronic device 102 sends the test result to the first electronic device 101, and the first electronic device 101 receives the test result sent by the second electronic device 102.
[0056] Figure 2 : is a flow chart of a device testing method disclosed in an embodiment of the present application. Figure 2 The device testing method described is applicable to the first electronic device mentioned above. Figure 2 As shown, the device testing method may include the following steps:
[0057] S202, obtaining an imported test file; the test file includes instruction information corresponding to a plurality of test instructions.
[0058] When the tester tests the second electronic device, the tester may test the software installed in the second electronic device, or may test the data stored in the second electronic device, etc. The first electronic device may send instruction information corresponding to the test instructions contained in the test file to the second electronic device based on the acquired test file, wherein the test file contains instruction information corresponding to multiple test instructions.
[0059] In some embodiments, the first electronic device can obtain the test file based on the test file imported by the tester. Furthermore, the first electronic device can be installed with a test tool, and the test tool can send instruction information corresponding to the test instruction to the second electronic device based on the acquired test file, wherein the test tool can include an import box for the test file, and the tester can drag and drop the test file into the import box for the test file so that the first electronic device can obtain the test file. The tester can also click on the import box, and the test tool can display a list of test files stored in the first electronic device. The tester can select one of the multiple test files recorded in the list according to the list of test files as the test file that the first electronic device needs to obtain.
[0060] In some embodiments, the test instruction may be an instruction for performing a device test on the second electronic device. The instruction information corresponding to the test instruction may include a first address and an execution instruction, the first address being the address of the second electronic device, and the execution instruction being used to indicate the test service that needs to be executed. Among them, the address of the second electronic device may be the network address of the second electronic device, for example, the network address of the second electronic device may be "192.168.1.1". The test service may be a service executed when testing the second electronic device, and the test service may include one or more of obtaining device data stored in the second electronic device, updating device data stored in the second electronic device, or setting device data in the second electronic device, but is not limited thereto. Among them, the device data may be program data generated by an application program contained in the second electronic device during operation, or may be system data generated by the system of the second electronic device during use, but is not limited thereto.
[0061] As an implementation method, the instruction information may include multiple fields, each field in the instruction information may be separated by a specific symbol, and the execution instruction may be represented by one of the fields in the instruction information. Specifically, the execution instruction may usually be represented by the last field in the instruction information. For example, assuming that the instruction information can be represented as "192.168.1.1 / api / update", "192.168.1.1" may be used to represent the first address in the instruction information, and "update" may be used to represent the execution instruction in the instruction information, wherein the execution instruction may be parsed by the second electronic device as a test service for executing and updating the device data stored in the second electronic device. The instruction information contains the first address and the execution instruction, which can facilitate the second electronic device to quickly parse the instruction information, thereby obtaining the first address and the execution instruction, thereby improving the test efficiency of the device test.
[0062] The instruction information corresponding to the test instruction may also include a test message, which may be used to record the new device data required when the second electronic device performs a specific test service. For example, assuming that the test service is to update the device data stored in the second electronic device, the corresponding test message may record the target device data used to update the device data in the second electronic device, so that the second electronic device performs data update according to the target device data. The first electronic device may also generate a test file by inputting corresponding information in each input area in the test tool. Specifically, the tester may input a first address in the address input box of the test tool in the first electronic device, and multiple test services displayed in the test tool, and determine the execution instruction according to the test service selected by the tester. The tester may also input a test message in the message input box, and the first electronic device may obtain the test message input by the user, and generate the instruction information corresponding to the test instruction according to the input first address and test message and the selected test service. For example, the tester inputs "192.168.1.1" through the address input box in the test tool, and selects the "update" test service so that the generated test instruction updates the device data stored in the second electronic device, and inputs message A in the message input box, then the instruction information corresponding to the generated test instruction can be expressed as "192.168.1.1 / api / update, message A". The second electronic device can obtain the first address, execution instruction and test message that can be included in the instruction information according to the instruction information corresponding to the received test instruction, thereby improving the efficiency of the first electronic device in sending the instruction information corresponding to the test data to the second electronic device, thereby improving the test efficiency of the device test.
[0063] As an optional implementation, the first electronic device can obtain multiple test files, and sort the test files according to the order of the acquisition time corresponding to the multiple test files from far to near, so as to test the second electronic device in the order in which the multiple test files are arranged. For example, the first electronic device obtains test file A at the acquisition time 15:00:01, and obtains test file B at the acquisition time 15:00:05. The first electronic device can first test the second electronic device according to test file A, and then test the second electronic device according to test file B. The first electronic device can sort the test files according to the acquisition time corresponding to the multiple test files, and automatically test the second electronic device according to the sorting of the multiple test files, which can further improve the test efficiency of the device test.
[0064] S204, sending instruction information corresponding to at least part of the test instruction to the second electronic device according to the test file, so that the second electronic device performs a test service according to the received instruction information corresponding to the test instruction and obtains a test result corresponding to the test service.
[0065] In one embodiment, before the first electronic device sends instruction information corresponding to at least part of the test instruction to the second electronic device, the first electronic device may send a communication connection request to the second electronic device so that the first electronic device and the second electronic device establish a communication connection. If the first electronic device detects that the communication connection with the second electronic device is successful, it sends instruction information corresponding to at least part of the test instruction to the second electronic device; if the first electronic device detects that the communication connection with the second electronic device fails, it outputs prompt information about the failure of the communication connection with the second electronic device, so that the tester knows through the first electronic device that the second electronic device has failed to establish a communication connection with the first electronic device. The first electronic device can reacquire a new device address to generate a new wireless connection request, and send the new wireless connection request to the second electronic device to retry to establish a wireless communication connection with the second electronic device.
[0066] As an optional implementation, if the second electronic device successfully establishes a wireless communication connection with the first electronic device, the first electronic device can send instruction information corresponding to the test instruction to the second electronic device through the wireless communication connection established with the second electronic device, so that the second electronic device receives the instruction information corresponding to the test instruction sent by the first electronic device, wherein the test instruction received by the second electronic device can be one of at least some of the test instructions in the test file.
[0067] In some embodiments, when the first electronic device sends instruction information corresponding to at least part of the test instruction to the second electronic device according to the test file, the first electronic device may record the test instruction that failed to be sent, and output the test instruction that failed to be sent after the test process ends. Specifically, if the first electronic device records the test instruction that failed to be sent, a prompt control may be displayed, and the test instruction that failed to be sent may be displayed in the prompt control, so that the tester is aware of the test instruction that failed to be sent in the test file, thereby facilitating the tester to troubleshoot the fault that occurs during the device test.
[0068] In some embodiments, the first electronic device may send instruction information corresponding to a test instruction to the second electronic device each time according to the test file and the preset delay time, and then send instruction information corresponding to the next test instruction to the second electronic device after the preset delay time, until the instruction information corresponding to all the test instructions is sent. The delay time may refer to the time for the second electronic device to perform a test service according to the instruction information corresponding to the currently received test instruction, and therefore, the delay time may be set to be greater than the maximum time required for the second electronic device to perform a test service according to the instruction information corresponding to the received test instruction, so that the second electronic device can have enough time to perform the test service.
[0069] In other embodiments, the first electronic device can simultaneously send instruction information corresponding to all test instructions contained in the test file to the second electronic device based on the test file, so that the second electronic device can perform the test service according to the instruction information corresponding to the received test instructions. The first electronic device simultaneously sends all test instruction information contained in the test to the second electronic device, which can improve the efficiency of sending the instruction information and ensure that the second electronic device can receive the instruction information corresponding to all test instructions in the test file.
[0070] S206: Receive a test result sent by the second electronic device.
[0071] In some embodiments, before the first electronic device receives the test result sent by the second electronic device, the second electronic device may send the test result to the first electronic device, so that the first electronic device can determine whether the test service corresponding to the current test instruction is successfully processed based on the received test result. If it is determined that the processing is successful, the first electronic device continues to send instruction information corresponding to the next test instruction to the second electronic device based on the test file; if it is determined that the processing fails, the first electronic device ends the test process corresponding to the current test file, and detects whether there is a next test file. If it is determined that there is a next test file, the instruction information corresponding to at least part of the test instruction is sent to the second electronic device based on the next test file to execute the test process corresponding to the next test file; if it is determined that there is no next test file, all test processes are directly stopped, and a test report corresponding to the test process executed by the current test file is output.
[0072] In some embodiments, the first electronic device may receive a test result sent by the second electronic device, and the test result of the second electronic device may be used to indicate whether the current test service is successfully processed, wherein the successful processing of the test service may indicate that the test service is processed, and the failure of the test service processing may indicate that the test service is not processed or cannot be processed. After the second electronic device performs the test service according to the instruction information corresponding to the test instruction, if the second electronic device processes the corresponding test service successfully, the second electronic device sends a test result indicating that the current test service is processed successfully to the first electronic device; if the second electronic device fails to process the corresponding test service, the second electronic device sends a test result indicating that the current test service fails to process to the first electronic device. The second electronic device may generate test results of different fields to indicate whether the current test result is successful. For example, the second electronic device may generate a test result containing field A, which may be used to indicate that the current test service is processed successfully; similarly, the second electronic device may generate a test result containing field B, which may be used to indicate that the current test service fails to process.
[0073] In some embodiments, the test result sent by the second electronic device and received by the first electronic device may include parameters describing the degree of completion of the test service. The second electronic device performs the test service according to the instruction information corresponding to the received test instruction. If the second electronic device successfully processes the test service, a test result indicating that the current test service is successfully processed is directly generated; if the second electronic device fails to process the test service, the second electronic device can record the business processing degree of the test service, and generate a test result indicating that the current test task processing has failed, and including the business processing degree of the test service, and send the test result to the first electronic device. Among them, the business processing degree can be used to indicate the degree of completion of the current test service. The first electronic device receives the business processing degree sent by the second electronic device, so that the tester can learn through the first electronic device the completion status of the test service performed by the second electronic device according to the instruction information corresponding to the current test instruction, thereby facilitating the tester to adjust the device test of the second electronic device.
[0074] In other embodiments, the test result sent by the second electronic device and received by the first electronic device may also include data obtained in the test service. The second electronic device performs a test service of reading the device data stored in the second electronic device according to the instruction information corresponding to the received test instruction. If the second electronic device successfully processes the test service, a test result including the read device data may be generated, and the test result may be sent to the first electronic device, so that the first electronic device can obtain the device data stored in the second electronic device according to the instruction information corresponding to the sent test instruction.
[0075] In an embodiment of the present application, a first electronic device obtains an imported test file, and sends instruction information corresponding to at least part of the test instructions to a second electronic device based on the test file, so that the second electronic device performs a test service based on the instruction information corresponding to the received test instructions, and obtains a test result corresponding to the test service. After receiving the test result sent by the second electronic device, the first electronic device can automatically send instruction information corresponding to at least part of the test instructions to the second electronic device based on the test file, so that the second electronic device can perform a test service based on the instruction information corresponding to the received test instructions and obtain a test result corresponding to the test service. There is no need for the tester to send the instruction information corresponding to the test instruction to the second electronic device one by one, which reduces the operations of the tester when testing the device and can improve the test efficiency of the device testing.
[0076] Figure 3 FIG. 1 is a flow chart of another device testing method disclosed in an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:
[0077] S302, obtaining an imported test file; the test file includes instruction information corresponding to a plurality of test instructions.
[0078] The description of step S302 may refer to the relevant description of step S202 in the above embodiment, which will not be repeated here.
[0079] S304, according to the test file, in accordance with the arrangement order of the multiple test instructions, send the instruction information corresponding to each test instruction to the second electronic device in sequence, so that the second electronic device performs the test service according to the instruction information corresponding to the received test instruction, and obtains the test result corresponding to the test service.
[0080] There may be a corresponding arrangement order for multiple test instructions in a test file, and the arrangement order may be used to refer to the order in which the test instructions are arranged in the test file. In some embodiments, the arrangement order corresponding to multiple test instructions in a test file may be that when the tester writes the test file, the first electronic device may determine the arrangement order corresponding to the multiple test instructions based on the input time corresponding to the multiple test instructions input by the tester. For example, the electronic device that writes the test file detects that test instruction A is input at 15:00:01 and test instruction B is input at 15:00:10, then it can be determined that the arrangement order of test instruction A precedes that of test instruction B, and the first electronic device may first send the instruction information corresponding to test instruction A to the second electronic device based on the test file, and then send the instruction information corresponding to test instruction B to the second electronic device.
[0081] In other embodiments, the arrangement order corresponding to multiple test instructions in the test file can be determined according to the input area where the test personnel enter the test instructions in the writing page when writing the test file. For example, if the first electronic device detects that test instruction A is entered in input area A in the writing page, and detects that test instruction B is entered in input area B in the writing page, assuming that the arrangement order of the test instructions entered in input area B is set in advance to be earlier than the test instructions entered in input area A, then it can be determined that the arrangement order of test instruction B is earlier than test instruction A, and the first electronic device can first send the instruction information corresponding to test instruction B to the first electronic device based on the test file, and then send the instruction information corresponding to test instruction A to the first electronic device.
[0082] In some embodiments, the first electronic device may send instruction information corresponding to a test instruction to the second electronic device each time according to the test file, and the first electronic device may also send at least part of the test instructions directly to the second electronic device at one time according to the test file. Specifically, the first electronic device may send instruction information corresponding to the first test instruction to the second electronic device according to the test file, so that the second electronic device performs a test service according to the instruction information corresponding to the received first test instruction, and obtains a test result corresponding to the test service, and the second electronic device sends the test result corresponding to the first test instruction to the first electronic device, and the first electronic device may determine whether to send the next test instruction to the second electronic device according to the test result corresponding to the first test instruction. The first test instruction is the test instruction currently sent by the first electronic device.
[0083] In some embodiments, the second electronic device may store a plurality of correspondences between instruction information and test services that need to be executed. Therefore, after the second electronic device receives instruction information corresponding to the test instruction sent by the first electronic device, the second electronic device can determine the test service that needs to be executed based on the comparison relationship and the instruction information corresponding to the received test instruction, and obtain the test result corresponding to the test service.
[0084] Further, the second electronic device can parse the instruction information corresponding to the test instruction to obtain the first address and execution instruction corresponding to the test instruction; determine whether the first address matches the target address corresponding to the second electronic device; if it is determined that the first address matches the target address corresponding to the second electronic device, then execute the test service corresponding to the execution instruction according to the execution instruction. Wherein, the second electronic device can parse the instruction information corresponding to the test instruction according to the preset parsing mechanism to obtain the first address and execution instruction corresponding to the test instruction, wherein the parsing mechanism is used to parse the first address and execution instruction that can be recognized by the second electronic device according to the field in the instruction information corresponding to the test instruction. The second electronic device determines whether the first address is the same as the target address corresponding to the second electronic device. If the first address is the same as the target address corresponding to the second electronic device, it is determined that the first address matches the target address corresponding to the second electronic device, and the second electronic device can execute the test service corresponding to the execution instruction according to the execution instruction; if the first address is not the same as the target address corresponding to the second electronic device, it is determined that the first address does not match the target address corresponding to the second electronic device, and the second electronic device can generate a test result indicating that the test service processing fails, and send the test result to the first electronic device.
[0085] In some embodiments, before acquiring the imported test file, the first electronic device may first obtain the permission to transmit data with the second electronic device based on the acquired login data, and then send at least part of the instruction information corresponding to the test instruction to the second electronic device based on the imported test file. Before acquiring the imported test file, the first electronic device may acquire the login data and send the login data to the second electronic device so that the second electronic device verifies the login data and obtains the login result; receives the login result sent by the second electronic device; if the login result indicates that the login is successful, then sends at least part of the instruction information corresponding to the test instruction to the second device based on the test file.
[0086] The login data can be used by the second electronic device to verify whether the first electronic device is given permission to test. The login data may include user name information and password information. The user name information and password information can be used to verify whether the person currently performing the test operation is a person allowed to perform the test. The first electronic device can obtain the login data by the tester manually inputting the login data. The second electronic device can store multiple target login data, and the target login data may refer to the login data corresponding to the tester who has the permission to test the second electronic device.
[0087] The first electronic device may send the acquired login data to the second electronic device, and the second electronic device may match the received login data according to the stored multiple target login data. If there is a target login data that matches the received login data, the second electronic device may determine that the login is successful and grant the permission to perform the test, and generate a login result indicating that the login is successful, and send the login result to the first electronic device. If there is no target login data that matches the received login data, the second electronic device may determine that the login fails, and may generate a login result indicating that the login fails, and send the login result to the first electronic device. If the first electronic device receives a login result indicating that the login is successful, the first electronic device may obtain the permission to perform the test given by the second electronic device, so the first electronic device may send the instruction information corresponding to at least part of the test instruction to the second electronic device according to the test file. If the first electronic device receives a login result indicating that the login fails, it may generate corresponding prompt information according to the login result to prompt the tester that the current login fails, and may re-acquire the login data re-entered by the tester.
[0088] The first electronic device can send login data to the second electronic device so that the second electronic device performs verification based on the login data to obtain a login result, and when the login result indicates that the login is successful, the first electronic device can send instruction information corresponding to at least part of the test instructions to the second electronic device based on the test file to prevent the device data in the second electronic device from being arbitrarily changed or read, thereby ensuring the security of data transmission between the first electronic device and the second electronic device.
[0089] Figure 4 is a schematic diagram of a display interface of a test tool in an embodiment, such as Figure 3As shown, in the display interface of the test tool, the "user name" input box 301 and the "password" input box 302 are input boxes for the tester to input login data. Specifically, the "user name" input box 301 can be used to input user name information, and the "password" input box 302 can be used to input password information. By clicking the "login" button 303 by the tester, the first electronic device can obtain the login data. "Address" is an address input box 306 for the tester to input the first address. The tester can choose to click the "read" button 304 or the "set" button 305 to select the test service that the second electronic device needs to perform. Among them, the "read" button 304 can be used to determine that the test service that the tester needs the second electronic device to process is to read the device data stored in the second electronic device; the "set" button 305 can be used to determine that the test service that the tester needs the second electronic device to process is to set the device data stored in the second electronic device. "Message" is a message input box 307, and the tester can enter a test message through the message input box 307. After the tester completes the setting, the "Finish" button 308 can be clicked to generate corresponding instruction information according to the set data.
[0090] Figure 5 The present invention is a schematic diagram of a device test in an embodiment. As shown in the figure, the second electronic device is powered on, and the test tool in the first electronic device can send the device address and login data to the second electronic device to receive the address request from the server in the second electronic device. The second electronic device sends the login result to the first electronic device. The first electronic device determines whether the login is successful according to the login result sent by the second electronic device. If the login is successful, the first electronic device loads the test file. If the login fails, the test process ends. After the first electronic device loads the test file, it sends the test instructions to the second electronic device in sequence. The second electronic device parses the instruction information corresponding to the received test instructions to obtain the execution instructions, and executes the corresponding test service according to the execution instructions obtained by the parsing, and sends the test results to the first electronic device. The first electronic device determines whether the current test service is successfully processed according to the test result received from the second electronic device. If so, it continues to send the next test instruction to the second electronic device until the instruction information corresponding to the test instructions in the test file is sent; if not, the test process ends. Each time the first electronic device sends instruction information corresponding to the test instruction to the second electronic device according to the test file, it determines whether all the test instructions have been sent. If it is determined that all the test instructions have been sent, the test process is terminated; if it is determined that not all the test instructions have been sent, the next test instruction is sent to the second electronic device.
[0091] S306: Receive the test result sent by the second electronic device.
[0092] The description of step S306 may refer to the relevant description of step S206 in the above embodiment, which will not be repeated here.
[0093] S308: If it is determined that the first test result indicates that the test service processing fails, stop sending the next test instruction to the second electronic device; the first test result is the test result corresponding to the instruction information currently sent by the first electronic device.
[0094] The first electronic device performs a test according to instruction information corresponding to the test instructions included in the test file. If there is a test instruction in the test instructions included in the test file, which causes the second electronic device to fail in processing the test service when performing the test service according to the test instruction, it can be determined that the test of the second electronic device according to the test file has failed, and it is necessary to stop sending the next test instruction to the second electronic device in time.
[0095] In some embodiments, after the first electronic device stops sending the next test instruction to the second electronic device, it can indicate that the process of testing according to the current test file is over, and at least part of the test instructions sent by the first electronic device to the first electronic device according to the current test file can be arranged before the first test instruction and the first test instruction. If the first electronic device determines that the first test result indicates that the test service processing has failed, it can stop sending the next test instruction to the second electronic device, and generate a test report based on the first test result and the instruction information corresponding to the test instruction currently sent, so that the tester can know the node that failed the current test, so that the tester can check the cause of the test service failure caused by the test according to the test file.
[0096] S310: If it is determined that the first test result indicates that the test service processing is successful, send a next test instruction to the second electronic device.
[0097] In some embodiments, if the first electronic device determines that the first test result indicates that the test service processing is successful, it can continue to send the next test instruction to the second electronic device until it receives a test result indicating that the test service processing has failed, and then stops sending the next test instruction of the current test instruction to the second electronic device. If the first electronic device has sent instruction information corresponding to all test instructions contained in the test file to the second electronic device, it can indicate that the process of testing according to the current test file has ended, and the first electronic device can output the test results corresponding to each test instruction so that the tester can view the test results corresponding to each test instruction.
[0098] In an embodiment of the present application, the first electronic device sends instruction information corresponding to each test instruction to the second electronic device in sequence according to the test file and in the arrangement order corresponding to multiple test instructions, so that the second electronic device performs a test service according to the instruction information corresponding to the received test instruction and obtains a test result corresponding to the test service. If it is determined that the first test result indicates that the test service processing has failed, the sending of the next test instruction to the second electronic device is stopped; the first test result is the test result corresponding to the instruction information currently sent by the first electronic device. If it is determined that the first test result indicates that the test service processing has been successful, the next test instruction is sent to the second electronic device. When a test result indicating that the test service processing has failed is received, the sending of the next test instruction to the second electronic device can be stopped in time to avoid increasing the test time of the device test, thereby improving the test efficiency of the device test to a certain extent.
[0099] See also Figure 6 , Figure 6 1 is a flow chart of another device testing method disclosed in an embodiment of the present application. In one embodiment, the above device testing method can be applied to the above second electronic device, and the above device testing method further includes the following steps:
[0100] S602, receiving instruction information corresponding to a test instruction sent by a first electronic device; the test instruction is one of a plurality of test instructions included in a test file obtained by the first electronic device.
[0101] In one embodiment, step S602 further includes: the second electronic device may establish a communication connection with the first electronic device, and the second electronic device may receive instruction information corresponding to the test instruction sent by the first electronic device according to the established communication connection.
[0102] S604, executing the test service according to the instruction information corresponding to the test instruction, and obtaining the test result corresponding to the test service.
[0103] In some embodiments, step S604 further includes: the instruction information further includes a first address and an execution instruction, and the second electronic device can execute the test service according to the first address and the execution instruction in the instruction information, and obtain a test result corresponding to the test service.
[0104] S606: Send the test result to the first electronic device.
[0105] In some embodiments, step S606 further includes: the second electronic device sends the test result to the first electronic device, so that the first electronic device can determine whether the test service corresponding to the current test instruction is successfully processed according to the received test result.
[0106] The description of the above embodiment can refer to the relevant description of the second electronic device in the previous embodiment, which will not be repeated here.
[0107] In an embodiment of the present application, the second electronic device receives instruction information corresponding to the test instruction sent by the first electronic device, executes the test service according to the instruction information corresponding to the test instruction, obtains the test result corresponding to the test service, and sends the test result to the first electronic device, so that the second electronic device can reasonably execute the corresponding test task according to the instruction information corresponding to the test instruction sent by the first electronic device, so as to improve the test efficiency of the equipment test.
[0108] See also Figure 7 , Figure 7 Schematic diagram of a device testing apparatus disclosed in an embodiment of the present application. The apparatus can be applied to the first electronic device mentioned above, without specific limitation. Figure 7 As shown, the device testing apparatus 700 may include: a file acquisition module 701 , an instruction sending module 702 , and a result receiving module 703 .
[0109] The file acquisition module 701 is used to acquire an imported test file; the test file contains instruction information corresponding to a plurality of test instructions;
[0110] The instruction sending module 702 is used to send instruction information corresponding to at least part of the test instruction to the second electronic device according to the test file, so that the second electronic device performs the test service according to the instruction information corresponding to the received test instruction and obtains the test result corresponding to the test service;
[0111] The result receiving module 703 is used to receive the test result sent by the second electronic device.
[0112] In one embodiment, the device testing apparatus 700 further includes:
[0113] A first login module, used to obtain login data and send the login data to the second electronic device, so that the second electronic device verifies the login data and obtains a login result;
[0114] A second login module, used for receiving a login result sent by a second electronic device;
[0115] The instruction sending module 702 is further used to send instruction information corresponding to at least part of the test instructions to the second device according to the test file if the login result indicates that the login is successful.
[0116] In one embodiment, the instruction sending module 702 is further used to send instruction information corresponding to each test instruction to the second electronic device in sequence according to the arrangement order of the multiple test instructions;
[0117] The equipment testing device 700 further includes:
[0118] A first determination module is used to stop sending the next test instruction to the second electronic device if it is determined that the first test result indicates that the test service processing fails; the first test result is a test result corresponding to the instruction information currently sent by the first electronic device;
[0119] The second determining module is configured to send a next test instruction to the second electronic device if it is determined that the first test result indicates that the test service processing is successful.
[0120] In one embodiment, the instruction information includes a first address and an execution instruction, the first address is the address of the second electronic device, and the execution instruction is used to indicate a test service that needs to be executed.
[0121] See also Figure 8 , Figure 8 Schematic diagram of another device testing device disclosed in the embodiment of the present application. The device can be applied to the second electronic device mentioned above, without specific limitation. Figure 8 As shown, the device testing apparatus 800 may include: an instruction receiving module 801 , a service execution module 802 , and a result sending module 803 .
[0122] The instruction receiving module 801 is used to receive instruction information corresponding to a test instruction sent by a first electronic device; the test instruction is one of a plurality of test instructions included in a test file obtained by the first electronic device;
[0123] The service execution module 802 is used to execute the test service according to the instruction information corresponding to the test instruction, and obtain the test result corresponding to the test service;
[0124] The result sending module 803 is used to send the test result to the first electronic device.
[0125] In one embodiment, the business execution module 802 is also used to parse the instruction information corresponding to the test instruction to obtain the first address and execution instruction corresponding to the test instruction; determine whether the first address matches the target address corresponding to the second electronic device; if it is determined that the first address matches the target address corresponding to the second electronic device, then execute the test business corresponding to the execution instruction according to the execution instruction.
[0126] See also Fig. 9 , Fig. 9 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0127] like Fig. 9 As shown, the electronic device 900 may include:
[0128] A memory 901 storing executable program codes;
[0129] A processor 902 coupled to the memory 901;
[0130] The processor 902 calls the executable program code stored in the memory 901 to execute any device testing method disclosed in the embodiments of the present application.
[0131] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by the processor, the processor implements any device testing method disclosed in the embodiment of the present application.
[0132] The embodiments of the present application disclose a computer program product, including a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.
[0133] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0134] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0135] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0137] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0138] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0139] The above is a detailed introduction to a device testing method, apparatus, electronic device and storage medium disclosed in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A device testing method, characterized in that: Applied to a first electronic device, the first electronic device establishes a communication connection with a second electronic device; the method includes: Obtain an imported test file; the test file contains instruction information corresponding to a plurality of test instructions respectively; According to the test file, send instruction information corresponding to at least part of the test instruction to the second electronic device, so that the second electronic device performs a test service according to the received instruction information corresponding to the test instruction and obtains a test result corresponding to the test service; Receive the test result sent by the second electronic device.
2. The method according to claim 1, characterized in that Before obtaining the imported test file, the method further includes: Acquire login data, and send the login data to the second electronic device, so that the second electronic device verifies the login data and obtains a login result; receiving the login result sent by the second electronic device; The sending, according to the test file, instruction information corresponding to at least part of the test instruction to the second device includes: If the login result indicates that the login is successful, then according to the test file, instruction information corresponding to at least part of the test instruction is sent to the second device.
3. The method according to claim 1, characterized in that The sending instruction information corresponding to at least part of the test instruction to the second electronic device includes: Sending instruction information corresponding to each test instruction to the second electronic device in sequence according to the arrangement order of the multiple test instructions; After receiving the test result sent by the second electronic device, the method further includes: If it is determined that the first test result indicates that the test service processing fails, stop sending the next test instruction to the second electronic device; the first test result is the test result corresponding to the instruction information currently sent by the first electronic device; If it is determined that the first test result indicates that the test service processing is successful, a next test instruction is sent to the second electronic device.
4. The method according to claim 1, characterized in that: The instruction information includes a first address and an execution instruction, the first address is the address of the second electronic device, and the execution instruction is used to indicate a test service that needs to be executed.
5. A device testing method, characterized in that: Applied to a second electronic device, the second electronic device establishes a communication connection with a first electronic device; the method includes: Receiving instruction information corresponding to a test instruction sent by a first electronic device; the test instruction is one of a plurality of test instructions included in a test file acquired by the first electronic device; Execute the test service according to the instruction information corresponding to the test instruction, and obtain the test result corresponding to the test service; The test result is sent to the first electronic device.
6. The method according to claim 5, characterized in that The executing of the test service according to the instruction information corresponding to each test instruction includes: Parsing the instruction information corresponding to the test instruction to obtain a first address and an execution instruction corresponding to the test instruction; determining whether the first address matches a target address corresponding to the second electronic device; If it is determined that the first address matches the target address corresponding to the second electronic device, the test service corresponding to the execution instruction is executed according to the execution instruction.
7. A device testing apparatus, characterized in that: Applied to a first electronic device, the first electronic device establishes a communication connection with a second electronic device; the device includes: A file acquisition module, used to acquire an imported test file; the test file contains instruction information corresponding to a plurality of test instructions respectively; an instruction sending module, configured to send instruction information corresponding to at least part of the test instruction to the second electronic device according to the test file, so that the second electronic device performs a test service according to the instruction information corresponding to the received test instruction and obtains a test result corresponding to the test service; The result receiving module is used to receive the test result sent by the second electronic device.
8. A device testing apparatus, characterized in that: Applied to a second electronic device, the second electronic device establishes a communication connection with a first electronic device; the device includes: An instruction receiving module, configured to receive instruction information corresponding to a test instruction sent by a first electronic device; the test instruction is one of a plurality of test instructions included in a test file acquired by the first electronic device; A service execution module, used to execute the test service according to the instruction information corresponding to the test instruction, and obtain the test result corresponding to the test service; The result sending module is used to send the test result to the first electronic device.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 4 or 5 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 or 5 to 6 is implemented.
