Equipment testing method, equipment and storage medium
By detecting and re-establishing the adb connection, obtaining and executing the boot wizard interface operation instructions, the automated XTS test of the Android terminal device is realized, which solves the problems of low test efficiency and high manpower consumption in the existing technology, and improves the test efficiency and accuracy. .
Patent Information
- Application Number
- CN202310161456.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-14
- Publication Date
- 2024-08-23
AI Technical Summary
The existing technology requires frequent manual switching of test environments when testing the Google Mobile Services (GMS) certification test suite (XTS) of Android system terminal devices, resulting in low test efficiency and high manpower consumption, making it difficult to implement automated testing.
By detecting whether the adb connection of the Android debugging bridge is abnormal, re-establishing the connection, obtaining the boot wizard interface parameters after the device is restored to factory settings, and generating and executing interface operation instructions to realize the automated XTS test process.
It improves the efficiency and accuracy of XTS testing of terminal equipment, reduces manual intervention, and significantly reduces testing time and labor costs.
Smart Images

Figure CN118535393A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of device testing, and in particular to a device testing method, device and storage medium. Background Art
[0002] With the widespread use of Android system, more and more terminal devices integrate Google's Google Mobile Service (GMS) on the Android system. Terminal devices integrated with GMS need to undergo Google's Certification Test Suite (XTS) test. XTS test includes Compatibility Test Suite (CTS) test, Google Mobile Services Test Suite (GTS) test, Security Test Suite (STS) test, Vendor Test Suite (VTS) test, CTS-on-GSI test and TVTS (TV Test Suite) test. Since XTS test includes multiple suite tests, it is necessary to frequently switch the test environment manually when running the test items. If a failed item occurs during the XTS test process, the staff needs to manually execute the test command and manually switch the test environment, and retest the failed test items until the test passes. This process consumes a lot of manpower and is inefficient.
[0003] Therefore, how to provide an automatic XTS test method to improve the efficiency and accuracy of XTS testing of terminal equipment is a problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present invention provide a device testing method, a device and a storage medium, aiming to improve the efficiency and accuracy of XTS testing of terminal devices.
[0005] In a first aspect, an embodiment of the present invention provides a device testing method, which is applied to a testing device, wherein the testing device is used to test a tested device, and the method includes:
[0006] When the certification test suite XTS test is triggered, determine whether the Android debug bridge adb connection with the device under test is abnormal;
[0007] When it is determined that the adb connection with the device under test is abnormal, re-establishing a connection with the adb of the device under test through an application program preset in the device under test;
[0008] When the device under test is connected to the adb and the device under test is restored to factory settings, obtaining various interface parameters of the startup wizard of the device under test, generating various interface operation instructions according to the various interface parameters, and sending the various interface operation instructions to the device under test;
[0009] When the device under test executes each of the interface operation instructions to complete the startup wizard, an XTS test is performed on the device under test.
[0010] In a second aspect, an embodiment of the present invention further provides a testing device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any device testing method provided in the specification of the present invention are implemented.
[0011] In a third aspect, an embodiment of the present invention further provides a device under test, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any device testing method provided in the specification of the present invention are implemented.
[0012] In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any device testing method provided in the specification of the present invention.
[0013] The embodiment of the present invention provides a device testing method, device and storage medium. When the authentication test suite XTS test is triggered, the embodiment of the present invention determines whether the Android debug bridge adb connection with the device under test is abnormal; when it is determined that the adb connection with the device under test is abnormal, the connection with the adb of the device under test is re-established through an application pre-installed in the device under test; when the device under test is connected with adb and the factory settings are restored to the device under test, the interface parameters of the startup wizard of the device under test are obtained, and the interface operation instructions are generated according to the interface parameters, and the interface operation instructions are sent to the device under test; when the device under test executes the interface operation instructions to complete the startup wizard, the device under test is subjected to an XTS test. This solution can realize the automatic testing of the device under test by the test device, greatly improving the efficiency and accuracy of the XTS test of the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1A schematic diagram of a flow chart of a device testing method provided by an embodiment of the present invention;
[0015] Figure 2 A schematic diagram of a startup wizard interface provided by an embodiment of the present invention;
[0016] Figure 3 for Figure 1 A schematic diagram of the sub-step flow chart of the device testing method in FIG.
[0017] Figure 4 A schematic diagram of a flow chart of another device testing method provided by an embodiment of the present invention;
[0018] Figure 5 A schematic block diagram of the structure of a test device provided by an embodiment of the present invention;
[0019] Figure 6 A schematic block diagram of the structure of a device under test provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0022] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0023] The embodiment of the present invention provides a device testing method, device and storage medium. Among them, the device testing method can be applied to a test device, and the test device can be an electronic device such as a mobile phone, a tablet computer, a desktop computer and a laptop computer. The device under test can be an electronic device such as a set-top box, a router, a mobile phone and a tablet computer. For example, the test device is a desktop computer, and the device under test is a set-top box. When the desktop computer triggers the certification test suite XTS test, it is determined whether the connection with the Android debug bridge adb of the set-top box is abnormal; when it is determined that the adb connection with the set-top box is abnormal, the connection with the adb of the set-top box is re-established through the application pre-installed in the set-top box; when the adb is connected and the set-top box is restored to factory settings, the interface parameters of the set-top box startup wizard are obtained, and the interface operation instructions are generated according to the interface parameters, and the interface operation instructions are sent to the set-top box; when the set-top box executes each of the interface operation instructions to complete the startup wizard, the set-top box is subjected to XTS testing.
[0024] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0025] Please refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of a device testing method provided by an embodiment of the present invention.
[0026] like Figure 1 As shown, the device testing method includes steps S101 to S104.
[0027] Step S101: When the authentication test suite XTS test is triggered, determine whether the Android debug bridge adb connection with the device under test is abnormal.
[0028] Among them, XTS tests include Compatibility Test Suite (CTS) test, Google Mobile Services Test Suite (GTS) test, Security Test Suite (STS) test, Vendor Test Suite (VTS) test, CTS-on-GSI test and TVTS (TV Test Suite) test. Android Debug Bridge (adb) is a tool for testing devices to perform device tests on the device under test.
[0029] In one embodiment, when an XTS test is triggered, a version upgrade package is sent to the device under test, and the version upgrade package is used to upgrade the test version of the device under test, so that the test device can perform XTS testing on the device under test. After the device under test receives the version upgrade package, the system is upgraded and the target application is installed according to the version upgrade package. When an XTS test is triggered, a version upgrade package is sent to the device under test, so that the device under test can complete the XTS test preparation after receiving the version upgrade package, which greatly improves the efficiency and accuracy of the XTS test.
[0030] It should be noted that the version upgrade package includes a configuration file for system upgrade and an installation package for configuring a target application, where the target application is used for the device under test to communicate with the test device.
[0031] It should be noted that the method of triggering the XTS test can be set according to the actual situation, and the embodiment of the present invention does not specifically limit this. For example, the test device receives the XTS test instruction sent by the control device, triggers the XTS test according to the XTS test instruction; and sets the interval preset time to trigger the XTS test. The control device can be selected according to the actual situation, and the embodiment of the present invention does not specifically limit this. For example, the control device can be an electronic device such as a mobile phone, a desktop computer, a laptop computer, and a tablet computer, and the preset time can be 5 hours.
[0032] In one embodiment, feedback information of the adb connection is obtained, and whether the adb connection with the device under test is abnormal is determined according to the feedback information. By obtaining feedback information of the adb connection, it is possible to accurately know whether the adb connection is abnormal, which greatly improves the efficiency of the terminal device test.
[0033] In one embodiment, an application preinstalled in the device under test sends an adb connection status request to the test device. The test device receives the adb connection status request, queries the adb connection status according to the adb connection status request, and obtains feedback information of the adb connection. According to the feedback information of the adb connection, it can be accurately determined whether the adb connection is abnormal.
[0034] In one embodiment, the method of determining whether the adb connection with the device under test is abnormal according to the feedback information may be: determining whether the identifier carried in the feedback information is the first identifier or the second identifier, and when the identifier carried in the feedback information is the first identifier, determining that the Android debug bridge adb connection with the device under test is abnormal; when the identifier carried in the feedback information is the second identifier, determining that the Android debug bridge adb connection with the device under test is normal. Whether the adb connection is abnormal can be accurately known according to the identifier carried in the feedback information.
[0035] Step S102: When it is determined that the adb connection with the device under test is abnormal, re-establish the connection with the adb of the device under test through an application program preset in the device under test.
[0036] In one embodiment, an application preinstalled in the device under test sends an adb connection status request to the test device, the test device receives the adb connection status request, queries the adb connection status according to the adb connection status request, obtains feedback information of the adb connection, and the test device sends the feedback information to the device under test, and the device under test receives the feedback information through the application. When the identifier carried in the feedback information is the first identifier, the application receives the restart adb instruction sent by the test device, and the device under test re-sends the adb connection status request to the test device through the application according to the restart adb instruction, and receives the feedback information sent by the test device based on the adb connection status request, and determines the adb connection status according to the feedback information. When the adb connection is abnormal, restarting the adb connection can improve the accuracy of the terminal device test.
[0037] In one embodiment, when the number of restarts of the adb connection is greater than or equal to a preset threshold, the device under test is restarted and the adb connection is restarted, and the adb connection request is sent to the test device again through the application, and feedback information sent by the test device based on the adb connection request is received, and the adb connection status is determined according to the feedback information. When the identifier carried in the feedback information is the first identifier, an adb connection abnormality reminder is sent to the command device used by the test staff, so that the test staff can quickly know that the adb connection between the device under test and the test device is abnormal. Among them, the command device can be selected according to actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the command device can be a mobile phone or a desktop computer; the preset threshold can be set according to the time situation, and the embodiment of the present invention does not make specific limitations on this. For example, the preset threshold can be 5 times.
[0038] In one embodiment, when a CTS-on-GSI test is required, a debug image is written to the vendor partition of the device under test; the device under test is controlled to restore factory settings and reinstall the target application; and a user image is written to the vendor partition of the device under test. The above method can conveniently restore the device under test for the CTS-on-GSI test to factory settings and allow the adb of the device under test to connect back to the test device.
[0039] It should be noted that when conducting CTS and GTS tests, the device under test is controlled to restore factory settings, adb is turned on and the adb authentication pop-up window is detected. When the adb authentication pop-up window is obtained, the virtual control operation is obtained according to the adb authentication pop-up window, and the adb authentication is completed according to the virtual control operation to complete the connection between the device under test and the test device.
[0040] Step S103: When the device under test is connected to the adb and the device under test is restored to factory settings, obtain various interface parameters of the startup wizard of the device under test, generate various interface operation instructions according to the various interface parameters, and send the various interface operation instructions to the device under test.
[0041] In one embodiment, when it is determined that the test device and the device under test have established an adb connection and the device under test has been restored to factory settings, the interface parameters of the power-on wizard of the device under test are obtained, and the corresponding virtual control operations are obtained according to the interface parameters; the interface operation instructions corresponding to each interface reference are generated according to each virtual control operation, and each interface operation instruction is sent to the device under test, and the device under test executes each interface operation instruction to complete the power-on wizard. Among them, the virtual control operation includes but is not limited to control operations such as confirmation, up move, down move, left move, right move and return. According to the interface parameters of the power-on wizard, each interface operation instruction is queried, and the execution of each interface operation instruction can quickly pass the power-on wizard, which greatly improves the efficiency and accuracy of terminal device testing.
[0042] In one embodiment, the method of obtaining the corresponding virtual control operation according to each interface parameter can be: querying the virtual control operation matching the interface parameter from the preset virtual control operation library, and obtaining the corresponding virtual control operation for each interface parameter. Among them, the preset virtual control operation library is a pre-set virtual control operation library, and the virtual control operation library can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. Through the preset virtual control operation library, it is possible to accurately query each interface parameter to obtain the corresponding virtual control operation, which greatly improves the efficiency and accuracy of terminal device testing.
[0043] It should be noted that the method of querying the virtual control operation that matches the interface parameters from the preset virtual control operation library can be selected according to the actual situation. The embodiment of the present invention does not make specific limitations on this. For example, the interface parameters are matched with the virtual control operation through a preset neural network model.
[0044] In one embodiment, when no virtual control operation matching the interface parameters is found in the preset virtual control operation library, a request for querying the interface parameters matching the virtual control operation is sent to the server. When the server finds the interface parameters matching the virtual control operation, the interface parameters matching the virtual control operation are sent to the test device. By sending the virtual control operation query to the server, the accuracy of the query can be improved.
[0045] In one embodiment, when no virtual control operation matching the interface parameters is found in the preset virtual control operation library, each virtual control operation is used as a candidate virtual control operation matching the interface parameters, each candidate virtual control operation generates a candidate interface operation instruction, each candidate interface operation instruction is sent to the terminal under test, the terminal under test executes each candidate interface operation instruction, and obtains the interface information after executing each candidate interface operation instruction, and sends the interface information to the test device, so that the test device obtains the corresponding virtual control operation according to the interface information; generates the interface operation instruction corresponding to each interface reference according to each virtual control operation, sends each interface operation instruction to the device under test, and the device under test executes each interface operation instruction to complete the power-on wizard. When no virtual control operation matching the interface parameters is found in the preset virtual control operation library, the device under test completes the power-on wizard by traversing, which greatly improves the efficiency of terminal device testing.
[0046] In one embodiment, when the power-on wizard is completed by traversing and executing the candidate interface operation instructions that match each candidate virtual control operation, the target virtual control operation is determined by the matching candidate virtual control operations corresponding to each interface, and the target virtual control operations that match each interface are stored to facilitate subsequent terminal device testing to query the virtual control operations that match the interface, thereby greatly improving the efficiency of terminal device testing.
[0047] For example, Figure 2 As shown, the interface 200 of the power-on wizard includes a first area 210, a second area 220, a third area 230, a return 240 and a next step 250. The virtual control operation matching the first area 210, the second area 220 and the third area 230 of the interface 200 is queried from the preset virtual control operation library as the next step 250. The next step 250 generates a next step interface operation instruction, and the next step interface operation instruction is sent to the device under test. The device under test executes the next step interface operation instruction to complete the power-on wizard of the interface 200.
[0048] Step S104: When the device under test executes each of the interface operation instructions to complete the startup wizard, perform an XTS test on the device under test.
[0049] In one embodiment, when the device under test executes each interface operation instruction to complete the boot wizard, it is determined that the device under test has completed the test preparation, and the device under test can be tested at any time. When the device under test enters the device test, the application stops sending adb connection status requests to the test device.
[0050] In one embodiment, if Figure 3 As shown, step S104 includes sub-steps S1041 and S1042.
[0051] Sub-step S1041: Obtain an XTS test data packet.
[0052] The test device obtains an XTS test data packet, which is a data packet used to test the device under test. By obtaining the XTS test data packet, the device under test can be tested accurately, greatly improving the efficiency and accuracy of the XTS test.
[0053] It should be noted that the method for obtaining the XTS test data packet can be selected according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the XTS test data packet is obtained from the server.
[0054] Sub-step S1042: performing an XTS test on the device under test according to the adb and the XTS test data packet.
[0055] In one embodiment, when there is a detection anomaly in the XTS test, the abnormal keywords of the XTS test are obtained; multiple preset exception handling strategies are obtained according to the abnormal keywords, and the detection anomaly is handled according to the multiple exception handling strategies respectively, and the XTS test is continued on the device under test. Among them, the preset exception handling strategy is an exception handling strategy pre-set according to the abnormal keywords. The preset exception handling strategy is obtained through the abnormal keywords, and the exception can be efficiently handled according to the exception handling strategy, which greatly improves the efficiency and accuracy of the XTS test. It should be noted that there is a degree of matching between the abnormal keywords and each exception handling strategy. The exception is first handled by the exception handling strategy with the highest matching degree, and the secondary exception handling strategy is matched, and the exception continues to be handled by the secondary exception handling strategy until the exception is handled.
[0056] In one embodiment, the method of obtaining a preset exception handling strategy based on an abnormal keyword can be: obtaining an exception handling strategy matched by an abnormal keyword from a preset exception handling strategy library, obtaining an exception handling strategy matched by each abnormal keyword, and then obtaining an exception handling strategy matched by each detected abnormality. Among them, the preset exception handling strategy library is established in advance based on each abnormal keyword and the matching exception handling strategy. The preset exception handling strategy library can be established according to actual conditions, and the embodiment of the present invention does not specifically limit this. Through the preset exception handling strategy library, the exception handling strategy matched by each detected abnormality can be accurately queried, which greatly improves the efficiency and accuracy of the XTS test.
[0057] In one embodiment, an exception handling strategy matching an exception keyword is obtained from a preset exception handling strategy library, and a method of obtaining an exception handling strategy matching each exception keyword may be: performing similarity matching between the exception keyword and the exception handling strategy in the preset exception handling strategy library, obtaining a matching score between the exception keyword and each exception handling strategy, and determining the exception handling strategy with the highest matching score as the target exception handling strategy corresponding to the exception keyword. By performing similarity matching between the exception keyword and each exception handling strategy, the most matching target exception handling strategy can be accurately queried.
[0058] It should be noted that the method of similarity matching between abnormal keywords and each abnormal handling strategy can be selected according to actual conditions, and the embodiments of the present invention do not make specific limitations on this. For example, the cosine similarity between the abnormal keywords and the abnormal handling strategies is calculated, and the cosine similarity value is used as the similarity matching value between the abnormal keywords and the abnormal handling strategies; or, the abnormal keywords are input into a preset abnormal handling strategy similarity matching model to obtain the similarity matching scores between the abnormal keywords and each abnormal handling strategy, wherein the preset abnormal handling strategy similarity matching model is a pre-trained neural network model, and the neural network model can be trained according to actual conditions, and the embodiments of the present invention do not make specific limitations on this.
[0059] In one embodiment, when the first exception handling strategy corresponding to the exception keyword is matched, the first exception handling strategy is executed to handle the exception, and it is detected whether the exception is handled. If it is detected that the exception is resolved, the XTS test is continued. If it is detected that the exception is not resolved, it is determined whether there is at least one second exception handling strategy recommended by the first exception handling strategy. If there is at least one second exception handling strategy recommended by the first exception handling strategy, the second exception handling strategy is executed to handle the exception, and it is detected whether the exception is handled; if it is detected that the exception is resolved, the XTS test is continued; if there is no second exception handling strategy recommended by the first exception handling strategy, the third exception handling strategy with the second highest matching score is obtained, the third exception handling strategy is executed to handle the exception, and it is detected whether the exception is handled. If the exception is resolved, the matching score of each exception handling strategy for solving the exception is increased, and if the next exception handling strategy is not in the recommendation list of the previous exception handling strategy, it is added to the recommendation list of the previous exception handling strategy. The method for increasing the matching score of each exception handling strategy after successful execution includes but is not limited to: setting the total score of each successful reward to a fixed value, and dividing the fixed value equally among each exception handling strategy, wherein the more exception handling steps are executed, the lower the reward score obtained by each exception handling strategy.
[0060] It should be noted that, when the exception handling strategy is executed for a number greater than or equal to a preset number of times and the exception is not resolved, it is determined that the exception handling has failed, and the matching of the exception handling strategy is stopped. The preset number of times can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the preset number of times can be set to 5 times.
[0061] In one embodiment, it is determined whether the matching score between each abnormal keyword and the abnormal processing strategy is less than or equal to the preset matching score. When the matching score between the abnormal keyword and the abnormal processing strategy is less than or equal to the preset matching score, the matching relationship between the abnormal keyword and the abnormal processing strategy is deleted to reduce the problem of failure in detecting abnormal processing.
[0062] In one embodiment, when the test device and the device under test perform device testing, CTS test, GTS test, STS test, VTS test, CTS-on-GSI test and TVTS test are performed. It should be noted that the order of the tests can be selected according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the device test order can be GTS test, TVTS test, VTS test, STS test, CTS-on-GSI test and CTS test.
[0063] In one embodiment, the test device performs an XTS test on the device under test and outputs the test results of each test item. When there is a test failure item, the test is restarted. When the number of test item failures is greater than or equal to a preset first number, the device under test is restored to factory settings and reconnected to adb. The test failure is retried based on the previous test results. If the number of test result failures of the test item is greater than or equal to a preset second number, a reminder of the test failure is sent to the instruction device operated by the test staff to facilitate the test staff to handle the failed test; when all test items are completed, the test results are output. Among them, the preset first number and second number can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. By retesting the failed test items, the efficiency and accuracy of the XTS test can be improved.
[0064] The device testing method in the above embodiment, when the authentication test suite XTS test is triggered, determines whether the connection with the Android debug bridge adb of the device under test is abnormal; when it is determined that the adb connection with the device under test is abnormal, re-establishes the connection with the adb of the device under test through the application pre-installed in the device under test; when connected with adb and the device under test is restored to factory settings, obtains each interface parameter of the startup wizard of the device under test, generates each interface operation instruction according to each interface parameter, and sends each interface operation instruction to the device under test; when the device under test executes each interface operation instruction to complete the startup wizard, performs XTS test on the device under test. This solution can realize the automated testing of the device under test by the test equipment, greatly improving the efficiency and accuracy of the XTS test of the terminal equipment.
[0065] Please refer to Figure 4 , Figure 4 A schematic flow chart of another device testing method provided by an embodiment of the present invention.
[0066] like Figure 4 As shown, the device testing method includes steps S301 to S304.
[0067] Step S301: Obtain a version upgrade package sent by the test device, and determine whether the connection between adb and the test device is abnormal based on a target application preinstalled in the version upgrade package.
[0068] The target application is obtained by parsing the installation package of the target application in the version upgrade package. It should be noted that the target application and the application in the embodiment of the present invention are the same application.
[0069] In one embodiment, when an XTS test is triggered, a version upgrade package is sent to the device under test, and the version upgrade package is used to upgrade the test version of the device under test, so that the test device can perform XTS testing on the device under test. After the device under test receives the version upgrade package, the system is upgraded and the target application is installed according to the version upgrade package. When an XTS test is triggered, a version upgrade package is sent to the device under test, so that the device under test can complete the XTS test preparation after receiving the version upgrade package, which greatly improves the efficiency and accuracy of the XTS test.
[0070] In one embodiment, feedback information of the adb connection is obtained, and whether the adb connection with the device under test is abnormal is determined according to the feedback information. By obtaining feedback information of the adb connection, it is possible to accurately know whether the adb connection is abnormal, which greatly improves the efficiency of the terminal device test.
[0071] In one embodiment, the target application in the device under test sends an adb connection status request to the test device. The test device receives the adb connection status request, queries the adb connection status according to the adb connection status request, and obtains feedback information of the adb connection. According to the feedback information of the adb connection, it can be accurately determined whether the adb connection is abnormal.
[0072] Step S302: When it is determined that the connection between the adb and the test device is abnormal, reestablish the connection between the adb and the test device through the target application, and perform a version update according to the version upgrade package.
[0073] In one embodiment, the target application in the device under test sends an adb connection status request to the test device, the test device receives the adb connection status request, queries the adb connection status according to the adb connection status request, obtains feedback information of the adb connection, and the test device sends the feedback information to the device under test, and the device under test receives the feedback information through the target application. When the identifier carried in the feedback information is the first identifier, the target application receives the restart adb instruction sent by the test device, and the device under test re-sends the adb connection status request to the test device through the target application according to the restart adb instruction, and receives the feedback information sent by the test device based on the adb connection status request, and determines the adb connection status according to the feedback information. When the adb connection is abnormal, restarting the adb connection can improve the accuracy of the terminal device test.
[0074] In one embodiment, when the number of times the adb connection is restarted is greater than or equal to a preset threshold, the device under test is restarted and the adb connection is restarted, and the adb connection status request is sent to the test device again through the target application, and feedback information sent by the test device based on the adb connection status request is received, and the adb connection status is determined according to the feedback information. When the identifier carried in the feedback information is the first identifier, an adb connection abnormality reminder is sent to the command device used by the test staff, so that the test staff can quickly know the adb connection abnormality between the device under test and the test device.
[0075] In one embodiment, when a CTS-on-GSI test is required, a debug image is written to the vendor partition of the device under test; the device under test is controlled to restore factory settings and reinstall the target application; and a user image is written to the vendor partition of the device under test. The above method can conveniently restore the device under test for the CTS-on-GSI test to factory settings and allow the adb of the device under test to connect back to the test device.
[0076] Step S303, obtaining various interface parameters of the boot wizard after the version is updated and the factory settings are restored, and generating various interface operation instructions according to the interface parameters.
[0077] In one embodiment, when it is determined that the test device and the device under test have established an adb connection and the device under test has been restored to factory settings, the interface parameters of the power-on wizard of the device under test are obtained, and the corresponding virtual control operations are obtained according to the interface parameters; the interface operation instructions corresponding to each interface reference are generated according to each virtual control operation, and the device under test executes each interface operation instruction to complete the power-on wizard. Among them, the virtual control operation includes but is not limited to control operations such as confirmation, up move, down move, left move, right move and return. According to the interface parameters of the power-on wizard, each interface operation instruction is queried, and the execution of each interface operation instruction can quickly pass the power-on wizard, which greatly improves the efficiency and accuracy of terminal device testing.
[0078] In one embodiment, the method of obtaining the corresponding virtual control operation according to each interface parameter can be: querying the virtual control operation matching the interface parameter from the preset virtual control operation library, and obtaining the corresponding virtual control operation for each interface parameter. Among them, the preset virtual control operation library is a pre-set virtual control operation library, and the virtual control operation library can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. Through the preset virtual control operation library, it is possible to accurately query each interface parameter to obtain the corresponding virtual control operation, which greatly improves the efficiency and accuracy of terminal device testing.
[0079] It should be noted that the method of querying the virtual control operation that matches the interface parameters from the preset virtual control operation library can be selected according to the actual situation. The embodiment of the present invention does not make specific limitations on this. For example, the interface parameters are matched with the virtual control operation through a preset neural network model.
[0080] In one embodiment, when no virtual control operation matching the interface parameters is found in the preset virtual control operation library, a request for querying the interface parameters matching the virtual control operation is sent to the server. When the server finds the interface parameters matching the virtual control operation, the interface parameters matching the virtual control operation are sent to the test device. By sending the virtual control operation query to the server, the accuracy of the query can be improved.
[0081] In one embodiment, when no virtual control operation matching the interface parameters is found in the preset virtual control operation library, each virtual control operation is used as a candidate virtual control operation matching the interface parameters, and each candidate virtual control operation generates a candidate interface operation instruction. The terminal under test executes each candidate interface operation instruction, and obtains the interface information after executing each candidate interface operation instruction, and obtains the corresponding virtual control operation according to the interface information; generates the interface operation instruction corresponding to each interface reference according to each virtual control operation, and the device under test executes each interface operation instruction to complete the power-on wizard. When no virtual control operation matching the interface parameters is found in the preset virtual control operation library, the device under test completes the power-on wizard by traversing, which greatly improves the efficiency of terminal device testing.
[0082] In one embodiment, when the power-on wizard is completed by traversing and executing the candidate interface operation instructions that match each candidate virtual control operation, the target virtual control operation is determined by the matching candidate virtual control operations corresponding to each interface, and the target virtual control operations that match each interface are stored to facilitate subsequent terminal device testing to query the virtual control operations that match the interface, thereby greatly improving the efficiency of terminal device testing.
[0083] It should be noted that the preset virtual control operation library can be stored in the test device and / or the device under test, and the test device can query the virtual control operation matching the interface parameters from the preset virtual control operation library, and obtain the corresponding virtual control operation for each interface parameter. Of course, the device under test can also query the virtual control operation matching the interface parameters from the preset virtual control operation library, and obtain the corresponding virtual control operation for each interface parameter.
[0084] Step S304: execute each of the interface operation instructions to complete the startup wizard and accept the XTS test of the test equipment.
[0085] In one embodiment, when there is a detection anomaly in the XTS test, the abnormal keyword of the XTS test is obtained; a preset abnormality handling strategy is obtained according to the abnormal keyword, and the detection anomaly is handled according to the abnormality handling strategy, and the XTS test is continued on the device under test. Among them, the preset abnormality handling strategy is an abnormality handling strategy pre-set according to the abnormal keyword. The preset abnormality handling strategy is obtained through the abnormal keyword, and the abnormality can be efficiently handled according to the abnormality handling strategy, which greatly improves the efficiency and accuracy of the XTS test.
[0086] In one embodiment, the method of obtaining a preset exception handling strategy based on an abnormal keyword can be: obtaining an exception handling strategy matched by an abnormal keyword from a preset exception handling strategy library, obtaining an exception handling strategy matched by each abnormal keyword, and then obtaining an exception handling strategy matched by each detected abnormality. Among them, the preset exception handling strategy library is established in advance based on each abnormal keyword and the matching exception handling strategy. The preset exception handling strategy library can be established according to actual conditions, and the embodiment of the present invention does not specifically limit this. Through the preset exception handling strategy library, the exception handling strategy matched by each detected abnormality can be accurately queried, which greatly improves the efficiency and accuracy of the XTS test.
[0087] In one embodiment, the test device performs an XTS test on the device under test and outputs the test results of each test item. When there is a test failure item, the test is restarted. When the number of test item failures is greater than or equal to a preset first number, the device under test is restored to factory settings and adb is reconnected to retest the test items that failed. If the test item still fails, a reminder of the test failure is sent to the command device operated by the test staff to facilitate the test staff to handle the failed test; when all test items are completed, the test results are output. Among them, the preset first number can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. By retesting the failed test items, the efficiency and accuracy of the XTS test can be improved.
[0088] The device testing method in the above embodiment obtains the version upgrade package sent by the test device, and determines whether the connection between adb and the test device is abnormal according to the target application preinstalled in the version upgrade package; if it is determined that the connection between adb and the test device is abnormal, re-establish the connection between adb and the test device through the target application, and perform version update according to the version upgrade package; obtains the interface parameters of the boot wizard after the version is updated and the factory settings are restored, and generates each interface operation instruction according to each interface parameter; executes each interface operation instruction to complete the boot wizard, and accepts the XTS test of the test device. This solution can realize the test device to automatically test the device under test, greatly improving the efficiency and accuracy of the XTS test of the terminal device.
[0089] See also Figure 5 , Figure 5 A schematic block diagram of the structure of a testing device provided in an embodiment of the present invention.
[0090] like Figure 5 As shown, the test device 400 includes a processor 401 and a memory 402 , and the processor 401 and the memory 402 are connected via a bus 403 , such as an I2C (Inter-integrated Circuit) bus.
[0091] Specifically, the processor 401 is used to provide computing and control capabilities to support the operation of the entire test equipment. The processor 401 can be a central processing unit (CPU), and the processor 401 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0092] Specifically, the memory 402 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0093] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the test equipment to which the scheme of the present invention is applied. The specific test equipment may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0094] The processor is used to run a computer program stored in the memory, and implement any one of the device testing methods provided by the embodiments of the present invention when executing the computer program.
[0095] In one embodiment, the processor 401 is used to run a computer program stored in a memory, and implements the following steps when executing the computer program:
[0096] When the certification test suite XTS test is triggered, determine whether the Android debug bridge adb connection with the device under test is abnormal;
[0097] When it is determined that the adb connection with the device under test is abnormal, re-establishing a connection with the adb of the device under test through an application program preset in the device under test;
[0098] When the device under test is connected to the adb and the device under test is restored to factory settings, obtaining various interface parameters of the startup wizard of the device under test, generating various interface operation instructions according to the various interface parameters, and sending the various interface operation instructions to the device under test;
[0099] When the device under test executes each of the interface operation instructions to complete the startup wizard, an XTS test is performed on the device under test.
[0100] In one embodiment, when implementing the XTS test on the device under test, the processor 401 is used to implement:
[0101] Get the XTS test data package;
[0102] Perform an XTS test on the device under test according to the adb and the XTS test data packet.
[0103] In one embodiment, when implementing the performing of the XTS test on the device under test according to the adb and the XTS test data packet, the processor 401 is configured to implement:
[0104] When the XTS test has a detection anomaly, obtaining an abnormal keyword of the XTS test;
[0105] A preset exception handling strategy is obtained according to the exception keyword, and the detected exception is handled according to the exception handling strategy, and the XTS test of the device under test is continued.
[0106] In one embodiment, when the processor 401 generates each interface operation instruction according to each interface parameter, it is used to implement:
[0107] Acquire corresponding virtual control operations according to each of the interface parameters;
[0108] Generate interface operation instructions corresponding to each interface reference according to each virtual control operation.
[0109] In one embodiment, when implementing the determination of whether the connection with the Android debug bridge adb of the device under test is abnormal, the processor 401 is used to implement:
[0110] Get feedback information about the adb connection.
[0111] Determine whether the adb connection with the device under test is abnormal according to the feedback information.
[0112] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the test equipment described above can refer to the corresponding process in the aforementioned equipment testing method embodiment, which will not be repeated here.
[0113] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a device under test provided by an embodiment of the present invention.
[0114] like Figure 6 As shown, the device under test 500 includes a processor 501 and a memory 502 , and the processor 501 and the memory 502 are connected via a bus 503 , such as an I2C (Inter-integrated Circuit) bus.
[0115] Specifically, the processor 501 is used to provide computing and control capabilities to support the operation of the entire device under test. The processor 501 can be a central processing unit (CPU), and the processor 501 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0116] Specifically, the memory 502 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0117] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the device under test to which the scheme of the present invention is applied. The specific device under test may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] The processor is used to run a computer program stored in the memory, and implement any one of the device testing methods provided by the embodiments of the present invention when executing the computer program.
[0119] In one embodiment, the processor 501 is used to run a computer program stored in a memory, and implements the following steps when executing the computer program:
[0120] Obtaining a version upgrade package sent by the test device, and determining whether a connection between adb and the test device is abnormal according to a target application preinstalled in the version upgrade package;
[0121] When it is determined that the connection between the adb and the test device is abnormal, reestablishing the connection between the adb and the test device through the target application, and performing a version update according to the version upgrade package;
[0122] Obtaining various interface parameters of the boot wizard after the version is updated and the factory settings are restored, and generating various interface operation instructions according to the interface parameters;
[0123] Execute each of the interface operation instructions to complete the startup wizard and accept the XTS test of the test equipment.
[0124] In one embodiment, when implementing the version update according to the version upgrade package, the processor 501 is used to implement:
[0125] When a CTS-on-GSI test is required, a debug image is written to the vendor partition of the device under test;
[0126] Controlling the device under test to restore factory settings and reinstall the target application;
[0127] Write the user image to the vendor partition of the device under test.
[0128] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device under test described above can refer to the corresponding process in the aforementioned device testing method embodiment, which will not be repeated here.
[0129] An embodiment of the present invention also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any device testing method provided in the specification of the present invention.
[0130] The storage medium may be an internal storage unit of the test device or / and the device under test described in the foregoing embodiments, such as a hard disk or memory of the test device or / and the device under test. The storage medium may also be an external storage device of the test device or / and the device under test, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the test device or / and the device under test.
[0131] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0132] It should be understood that the term "and / or" used in the present specification refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0133] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A device testing method, characterized in that: Applied to a test device, the test device is used to test a device under test, the method comprising: When the certification test suite XTS test is triggered, determine whether the Android debug bridge adb connection with the device under test is abnormal; When it is determined that the adb connection with the device under test is abnormal, re-establishing a connection with the adb of the device under test through an application program preset in the device under test; When the device under test is connected to the adb and the device under test is restored to factory settings, obtaining various interface parameters of the startup wizard of the device under test, generating various interface operation instructions according to the various interface parameters, and sending the various interface operation instructions to the device under test; When the device under test executes each of the interface operation instructions to complete the startup wizard, an XTS test is performed on the device under test.
2. The device testing method according to claim 1, characterized in that: The performing XTS test on the device under test comprises: Get the XTS test data package; Perform an XTS test on the device under test according to the adb and the XTS test data packet.
3. The device testing method according to claim 2, characterized in that: The performing an XTS test on the device under test according to the adb and the XTS test data packet comprises: When the XTS test has a detection anomaly, obtaining an abnormal keyword of the XTS test; A preset exception handling strategy is obtained according to the exception keyword, and the detected exception is handled according to the exception handling strategy, and the XTS test of the device under test is continued.
4. The device testing method according to claim 1, characterized in that: Generating each interface operation instruction according to each interface parameter includes: Acquire corresponding virtual control operations according to each of the interface parameters; Generate interface operation instructions corresponding to each interface reference according to each virtual control operation.
5. The device testing method according to claim 1, characterized in that: The step of determining whether the connection with the Android debug bridge adb of the device under test is abnormal includes: Get feedback information about the adb connection. Determine whether the adb connection with the device under test is abnormal according to the feedback information.
6. A device testing method, characterized in that: Applied to a device under test, the device under test is detected by a testing device, and the method comprises: Obtaining a version upgrade package sent by the test device, and determining whether a connection between adb and the test device is abnormal according to a target application preinstalled in the version upgrade package; When it is determined that the connection between the adb and the test device is abnormal, reestablishing the connection between the adb and the test device through the target application, and performing a version update according to the version upgrade package; Obtaining various interface parameters of the boot wizard after the version is updated and the factory settings are restored, and generating various interface operation instructions according to the interface parameters; Execute each of the interface operation instructions to complete the startup wizard and accept the XTS test of the test equipment.
7. The device testing method according to claim 6, characterized in that: The performing version updating according to the version upgrade package includes: When a CTS-on-GSI test is required, a debug image is written to the vendor partition of the device under test; Controlling the device under test to restore factory settings and reinstall the target application; Write the user image to the vendor partition of the device under test.
8. A testing device, characterized in that: The testing device comprises a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the device testing method according to any one of claims 1 to 5 are realized.
9. A device under test, characterized in that: The device under test includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the device testing method as described in any one of claims 6 to 7 are implemented.
10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the device testing method described in any one of claims 1 to 5 or / and implement the steps of the device testing method described in any one of claims 6 to 7.
