SIM card switching test method, electronic device and storage medium

By automatically simulating mouse clicks and response data judgment methods, the problems of low efficiency of SIM card switching test and difficulty in abnormal capture in the prior art are solved, and efficient SIM card switching test is realized.

CN115643618BActive Publication Date: 2025-08-29GUILIN YIYUAN COMM TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211294060.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2025-08-29
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

In the prior art, SIM card switching test requires frequent human operation, resulting in low testing efficiency and difficult to capture abnormal results.

Method used

Through automated methods, the mouse click operation is simulated, the interface element identification is found, and the entity switching and function of the SIM card are normal based on the received response data, so as to realize automatic SIM card switching and exception capture.

Benefits of technology

It improves the efficiency and quality of SIM card switching test, saves manpower and material resources, and provides a good user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115643618B_ABST
    Figure CN115643618B_ABST
Patent Text Reader

Abstract

The present application discloses a SIM card switching test method, electronic device and storage medium, which relates to the technical field of communication technology. The method includes: after finding the SIM card switching selection box, in response to the instruction of selecting the first SIM card in the SIM card switching selection box, executing the operation of setting the first SIM card as the currently used SIM card; based on the SIM card information responded by the communication module, judging whether the physical SIM card corresponding to the SIM card information is consistent with the SIM card displayed on the current interface, and both are the first SIM card; if the physical SIM card is consistent with the displayed SIM card and both are the first SIM card, judging whether the network function corresponding to the first SIM card is normal based on the received network function response data. Therefore, the present application has the advantages of high automation, improved testing efficiency and manpower saving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of communication technology, and in particular to a SIM card switching test method, electronic equipment, and storage medium. Background Art

[0002] In the prior art, dual-SIM single standby (DSS) functionality is a common requirement for laptop communication modules. Its primary function is to connect the laptop to the MBIM network card, allowing users to switch between SIM card 1 and SIM card 2 on the laptop's mobile network interface. This allows users to switch between SIM card 1 and SIM card 2. The operator pre-installs a standard SIM card into the laptop's first SIM card slot, which becomes the default SIM card 1 for the communication module. Additionally, the communication module comes with an E-SIM card, which is located in the second SIM card slot and becomes the default SIM card 2 for the communication module.

[0003] When a laptop is connected to the MBIM network card, the operator selects SIM Card 1 on the mobile network interface, and the laptop switches to the built-in SIM Card 1 to use the corresponding mobile network. If the operator selects SIM Card 2 on the mobile network interface, the laptop switches to the E-SIM card included with the communication module to use the corresponding mobile network. Existing SIM card switching testing methods require manually clicking the name of the SIM card to be tested or other related options on the computer interface multiple times, observing for SIM card switching failures or SIM card usage anomalies. This method not only requires frequent manual operation but also makes it difficult for the naked eye to detect test anomalies in a timely manner. Summary of the Invention

[0004] The purpose of this application is to provide a SIM card switching test method, electronic device and storage medium, which can automatically switch SIM cards and automatically capture test anomalies, effectively improving the test efficiency and test quality of SIM card switching and saving manpower.

[0005] The embodiment of the present application is implemented as follows:

[0006] A first aspect of the present application provides a SIM card switching test method, the method comprising: after finding a SIM card switching selection box, in response to an instruction to select a first SIM card in the SIM card switching selection box, executing an operation of setting the first SIM card as the currently used SIM card; based on SIM card information responded by a communication module, determining whether a physical SIM card corresponding to the SIM card information is consistent with a SIM card displayed on a current interface and both are the first SIM card; if the physical SIM card is consistent with the displayed SIM card and both are the first SIM card, determining whether a network function corresponding to the first SIM card is normal based on received network function response data.

[0007] In one embodiment, before executing the operation of setting the first SIM card as the currently used SIM card in response to the instruction of selecting the first SIM card in the SIM card switching selection box, the method further includes: after finding the SIM card switching selection box, determining whether the first SIM card exists in the SIM card switching selection box.

[0008] In one embodiment, based on the SIM card information responded by the communication module, determining whether the physical SIM card corresponding to the SIM card information and the SIM card displayed on the current interface are consistent and both are the first SIM card includes: based on the SIM card information responded by the communication module, determining whether the physical SIM card corresponding to the SIM card information is the first SIM card; if the physical SIM card is the first SIM card, confirming the SIM card displayed on the current interface based on the obtained interface element identifier; and determining whether the displayed SIM card is the first SIM card.

[0009] In one embodiment, the network function response data includes network registration response data, and determining whether the network function corresponding to the first SIM card is normal based on the received network function response data includes: determining whether the mobile network corresponding to the first SIM card can be found based on the network registration response data; if the mobile network corresponding to the first SIM card can be found, determining whether the network function corresponding to the first SIM card is normal based on other network function response data.

[0010] In one embodiment, the network function response data also includes network card connection data, and judging whether the network function corresponding to the first SIM card is normal based on other network function response data includes: disabling the local network; and judging whether the network card connection status is normal when the current network is the mobile network corresponding to the first SIM card based on the network card connection data.

[0011] In one embodiment, the network function response data also includes web page response data, and determining whether the network function corresponding to the first SIM card is normal based on other network function response data includes: disabling the local network; after sending page data request information to a preset designated website, receiving web page response data corresponding to the page data request information; based on the web page response data, determining whether the data service is normal when the current network is the mobile network corresponding to the first SIM card.

[0012] In one embodiment, before executing an operation of setting the first SIM card as the currently used SIM card in response to an instruction to select the first SIM card in the SIM card switching selection box, the method further includes: after sending an instruction to request obtaining interface information, querying a SIM card switching selection box identifier based on the obtained interface information; and searching for the SIM card switching selection box based on the SIM card switching selection box identifier.

[0013] In one embodiment, before searching for the SIM card switching selection box, the method further includes: searching for a mobile network element identifier in the acquired interface information, and determining whether a mobile network option exists in the current interface based on the query result.

[0014] A second aspect of an embodiment of the present application provides an electronic device, which includes: a processor, a communication module, and a memory for storing processor executable instructions; wherein the communication module is used to implement the mobile communication function of the electronic device; the processor is configured to execute the SIM card switching test method of the first aspect of the embodiment of the present application and any embodiment thereof.

[0015] A third aspect of the present application provides a computer-readable storage medium storing a computer program that can be executed by a processor to implement the SIM card switching test method of the first aspect of the present application and any of its embodiments.

[0016] The beneficial effects of this application compared with the prior art are:

[0017] This application can solve the problems of low test efficiency and easy failure to capture abnormal test results caused by frequent manual switching of SIM cards in the existing technology. This application uses a test method that searches for multiple interface element identifiers to further simulate mouse click operations and automatically determines whether the physical switching and function of the SIM card are valid based on the received response data. This improves the test efficiency and test quality of SIM card switching, greatly saves manpower and material resources, and provides users with a good experience during the SIM card switching test process. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0020] Figure 2 A flowchart of a SIM card switching test method provided in one embodiment of the present application;

[0021] Figure 3 A flowchart of a SIM card switching test method provided in one embodiment of the present application;

[0022] Figure 4 A schematic diagram of an interface for searching mobile network options provided in an embodiment of the present application;

[0023] Figure 5 A schematic diagram of an interface for searching for advanced mobile network options provided in an embodiment of the present application;

[0024] Figure 6 A schematic diagram of an interface for selecting the first SIM card in the SIM card switching selection box provided in an embodiment of the present application;

[0025] Figure 7 A flowchart of a SIM card switching test method provided in one embodiment of the present application;

[0026] Figure 8 This is a schematic diagram of an interface for selecting a second SIM card in a SIM card switching selection box provided in an embodiment of the present application.

[0027] Figure numerals: 1-electronic device; 10-bus; 11-processor; 12-memory; 13-communication module; 101-mobile network options; 102-mobile network advanced options; 103-SIM card switching selection box; 104-network status bar. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0029] Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.

[0030] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings.

[0031] See Figure 1 , Figure 1 This is a structural diagram of an electronic device 1 provided in an embodiment of the present application. The electronic device 1 can be used as a mobile terminal such as a notebook computer. Figure 1 As shown, the electronic device 1 includes at least one processor 11, a communication module 13 and at least one memory 12. Figure 1 In the figure, a processor 11 and a memory 12 are used as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by at least one processor 11. The instructions are executed by at least one processor 11 so that at least one processor 11 performs the SIM card switching test method in the following embodiment. The communication module 13 is used to implement the mobile communication function of the electronic device 1.

[0032] In the following embodiments of the present application, the SIM card switching test method is applied to a laptop computer. In other embodiments of the present application, the method can also be applied to any mobile terminal with data processing functions and equipped with a network card and communication module, such as a desktop computer, a smart watch, and a mobile phone.

[0033] See Figure 2 , Figure 2 A flow chart of a SIM card switching test method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the SIM card switching test method includes the following steps:

[0034] S110: After the SIM card switching selection box is found, in response to an instruction to select the first SIM card in the SIM card switching selection box, an operation of setting the first SIM card as the currently used SIM card is executed.

[0035] The SIM card switching selection box is the selection box on the laptop's mobile network settings interface that allows users to select a SIM card and click it. The selection box displays the names of multiple SIM cards, such as SIM Card 1 and SIM Card 2, based on the SIM card installed in the laptop's card slot and the ESIM card included with the communication module. The first SIM card is the test subject for the laptop's SIM card switching test. In this case, the first SIM card can be the SIM card installed in the laptop's card slot or the ESIM card included with the communication module.

[0036] In this step, after finding the switching selection box on the current interface of the laptop computer, the processor automatically obtains all SIM card information in the SIM card switching selection box, and selects the first SIM card according to the test object in the SIM card switching instruction, thereby setting the physical SIM card currently used by the laptop as the first SIM card, so that the laptop can subsequently use the telephone, mobile network and other service functions corresponding to the first SIM card.

[0037] S120: Based on the SIM card information responded by the communication module, determine whether the physical SIM card corresponding to the SIM card information is consistent with the SIM card displayed on the current interface, and whether both are the first SIM card.

[0038] The SIM card information responded by the communication module refers to the SIM card information returned by the communication module based on the physical SIM card currently being used by the laptop. For example, if the current laptop is using SIM card 1 located in the card slot, the communication module will respond to the request and return the relevant data of SIM card 1.

[0039] In this step, after the laptop sets the currently used SIM card as the first SIM card, the processor needs to re-acquire the laptop's interface information to further obtain the default SIM card information displayed on the laptop's current interface. The default SIM card is the SIM card currently in use displayed by the laptop to the user. After obtaining the default SIM card information, the processor determines whether the physical SIM card is consistent with the SIM card currently displayed on the interface, and whether both are the first SIM card, based on the physical SIM card information currently in use returned by the communication module and the test object in the switching instruction that controlled the laptop to switch SIM cards in step S110.

[0040] S130: If the physical SIM card is consistent with the displayed SIM card and both are first SIM cards, determine whether the network function corresponding to the first SIM card is normal based on the received network function response data.

[0041] In this step, after the processor confirms that the physical SIM card currently in use on the laptop and the SIM card currently in use displayed on the interface are both the first SIM card, the processor then tests, based on the received response data, whether the first SIM card can provide normal mobile network service. The response data required to evaluate the SIM card's network function testing is network function response data, such as serial port data indicating whether the network card is properly connected or web page response data corresponding to a request for specified web page data.

[0042] See Figure 3 , Figure 3 This is a flow chart of a SIM card switching test method provided in one embodiment of the present application. Figure 3 As shown, taking a switching test of only one SIM card in a laptop as an example, the SIM card switching test method includes the following steps:

[0043] S210: Query the acquired interface information for a mobile network element identifier, and determine whether a mobile network option exists in the current interface based on the query result.

[0044] See Figure 4 , Figure 4 This is a schematic diagram of an interface for searching mobile network options provided in an embodiment of the present application. Figure 4 As shown, when the laptop computer has been pre-installed with a SIM card and a communication module, the processor will control the display of the mobile network option 101 on the interface of the laptop computer based on the SIM card information returned by the communication module, as shown in FIG. Figure 4 Cellular is shown in the lower right corner.

[0045] In this step, the processor sends a request to obtain the current interface information of the laptop computer, and based on the received current interface information, confirms whether the current interface contains an interface element identifier related to the mobile network option. In one embodiment of the present application, the processor primarily queries whether the mobile network option exists in the current interface of the laptop computer through the text information of the interface element identifier. In other embodiments of the present application, the processor may also confirm the type of the current interface element identifier through specific information such as the interface element identifier ID, and further determine whether the mobile network option exists on the laptop computer interface.

[0046] If there is a mobile network option in the current interface of the laptop, the processor sends a control instruction to simulate the mouse selection Figure 4 The "Network and Internet Settings" option is selected and the next step S220 is executed; if the mobile network option does not exist in the current interface, the processor executes step S290, generates a test result of the test exception and outputs a corresponding exception prompt: the mobile network (or mobile phone network) is turned on abnormally.

[0047] S220: Query the acquired interface information for an element identifier of a mobile network advanced option display box, and determine whether a mobile network advanced option display box exists in the current interface based on the query result.

[0048] Please refer to Figure 5 , Figure 5 This is a schematic diagram of an interface for searching for advanced mobile network options provided by an embodiment of the present application. Figure 5 As shown, after simulating the mouse operation to select the "Network and Internet Settings" option, the current interface of the computer enters the specific option setting interface of "Network and Internet Settings".

[0049] In this step, the processor sends a request to obtain current interface information of the laptop computer, and confirms whether there is an interface element identifier related to the mobile network advanced option display box on the current interface based on the received current interface information.

[0050] like Figure 5 As shown, if there is a mobile network advanced option 102 in the current interface of the laptop, the processor sends a control instruction to simulate the mouse selection Figure 5 and execute the next step S230; if the mobile network advanced option does not exist in the current interface, the processor executes step S290, generates a test result of the test exception and outputs a corresponding exception prompt.

[0051] S230: In response to an instruction to select the first SIM card in the SIM card switching selection box, executing an operation of setting the first SIM card as the currently used SIM card.

[0052] In this step, the processor sends a request to obtain current interface information of the laptop computer, and queries the SIM card switching selection box identifier based on the received current interface information. After finding the SIM card switching selection box based on the SIM card switching selection box identifier, based on all the information of the SIM cards to be selected and selected in the SIM card switching selection box, it is determined whether the SIM card corresponding to the first SIM card exists in the SIM card switching selection box.

[0053] Please refer to Figure 6 , Figure 6 This is a schematic diagram of an interface for selecting the first SIM card in the SIM card switching selection box provided in an embodiment of the present application. Figure 6 As shown, after finding the SIM card switching selection box, the processor sends a control instruction to simulate the mouse selecting and clicking the SIM card switching selection box 103 in the current interface. The SIM card switching selection box 103 is as shown in FIG. Figure 6 After clicking the extension bar, the processor selects the specific SIM card corresponding to the first SIM card (test object) based on the test object in the SIM card switching instruction. Figure 6 As shown, the simulated mouse selects SIM card 1 as the first SIM card.

[0054] After determining whether the first SIM card exists in the SIM card switching selection box, if the first SIM card exists in the SIM card switching selection box, the processor sends a control instruction to simulate selecting the first SIM card with a mouse and executes the next step S240. If the first SIM card does not exist in the SIM card switching selection box, the processor executes step S290, generates a test result indicating a test exception, and outputs a corresponding exception prompt, which is a test exception prompt indicating a failure in switching (or searching) the first SIM card.

[0055] S240: Based on the SIM card information responded by the communication module 13, it is determined whether the physical SIM card corresponding to the SIM card information is consistent with the SIM card displayed on the current interface, and both are the first SIM card.

[0056] In this step, after sending a control instruction to simulate a mouse selection of the first SIM card, the processor reacquires the current interface information of the laptop and sends a request to the communication module to obtain information about the physical SIM card currently in use by the laptop. The processor then determines whether the physical SIM card corresponding to the SIM card information is the first SIM card based on the SIM card information received from the communication module 13.

[0057] If the physical SIM card is the first SIM card, the processor confirms the SIM card displayed on the current interface as the default SIM card based on the interface element identifier in the obtained interface information; if the physical SIM card is not the first SIM card, the processor executes step S290 to generate and output a test result of a test exception and a corresponding exception prompt, where the exception prompt is a test exception prompt information indicating that the first SIM card switching failed.

[0058] After confirming the SIM card currently displayed on the interface, the processor determines whether the SIM card currently displayed on the interface is the first SIM card. If the SIM card currently displayed on the interface is the first SIM card, the processor proceeds to step S250 below. If the SIM card currently displayed on the interface is not the first SIM card, the processor proceeds to step S290 to generate and output a test result indicating a test abnormality and a corresponding abnormality prompt.

[0059] like Figure 6 As shown, when the laptop computer is currently using the first SIM card, the communication module will automatically read the data of the SIM card, and the interface of the laptop computer will display the operator, phone number, connection status and other information of the SIM card accordingly for the user to view. Therefore, if the SIM card displayed on the current interface is the first SIM card, before executing step S250, the processor can also determine whether there is a network status bar 104 of the SIM card corresponding to the first SIM card on the current interface based on the interface element identifier in the acquired interface information, so as to ensure that the mobile network interface of the laptop computer displays the network status normally after the card is cut. If there is a network status bar 104, the processor continues to execute step S250; if the network status bar element identifier corresponding to the network status bar 104 is not found in the interface element identifier, the processor executes step S290, generates a test result of the test abnormality and outputs a corresponding abnormality prompt.

[0060] For other details of this step and step S230 , reference may be made to the above-mentioned steps S110 to S120 .

[0061] S250: Based on the network registration response data, determine whether the mobile network corresponding to the first SIM card can be found.

[0062] The network registration response data indicates whether the laptop can currently find the carrier network corresponding to the first SIM card. In actual use, the laptop may be unable to find the mobile network corresponding to the SIM card due to factors such as the SIM card not being registered, the corresponding account being in arrears, or lack of internet access. Therefore, in this step, the processor sends an instruction to obtain the network registration response data and, based on the network registration response data, determines whether the laptop can find the mobile network corresponding to the first SIM card.

[0063] If the mobile network corresponding to the first SIM card can be found, the processor proceeds to step S260 to determine whether the network function corresponding to the first SIM card is normal based on other network function response data, such as network card connection data or web page response data. If the mobile network corresponding to the first SIM card cannot be found, the processor proceeds to step S290 to generate a test result indicating a test abnormality and output a corresponding abnormality prompt. The abnormality prompt may be that the network registration failed after the first SIM card was switched.

[0064] S260: After disabling the local network, based on the network card connection data, determining whether the network card connection status is normal when the current network is the mobile network corresponding to the first SIM card.

[0065] Network card connection data refers to the serial port response data used to indicate whether the current laptop can properly connect to the network card. In this step, the processor first sends a command to control the laptop to disconnect from other networks and retain only the mobile network corresponding to the first SIM card. This prevents interference from other networks during the SIM card switching test, which could lead to inaccurate test results. The processor then sends a request to obtain the network card connection data returned by the serial port. Based on this network card connection data, the processor determines whether the network card connection status is normal when the current network is the mobile network corresponding to the first SIM card.

[0066] If the network card connection status is normal, the processor continues to execute the following step S270; if the network card connection status is abnormal, the processor executes step S290, generates and outputs the test result of the test abnormality and the corresponding abnormal prompt, and the abnormal prompt is that the network card connection is abnormal.

[0067] S270: Based on the webpage response data, determine whether the data service is normal when the current network is the mobile network corresponding to the first SIM card.

[0068] Web page response data refers to response data indicating whether the current laptop can normally log in to a specific website and retrieve specific web page data. In this step, the laptop remains in a state where other networks are disabled. After sending a page data request message to a preset designated website, the processor receives web page response data corresponding to the page data request message. Based on the web page response data, the processor determines whether the specific page data of the designated website can be normally retrieved when the current network is the mobile network corresponding to the first SIM card, thereby determining whether the data service is normal.

[0069] If the data service is normal, the processor continues to execute step S280; if the data service is abnormal, the processor executes step S290, generates and outputs the test result of the test abnormality and the corresponding abnormal prompt information, and the abnormal prompt is the data service abnormality.

[0070] The execution order of the above steps S260 and S270 is not strictly limited. Under the premise that other networks have been disabled, the processor may also test the data service first and then confirm the network card connection status.

[0071] S280: The first SIM card switching function test passes.

[0072] After all steps are tested to be passed, the processor generates and outputs a test result indicating that the handover test of the first SIM card (eg, SIM card 1) has passed, indicating that the test is normal.

[0073] S290: Test exception, output exception prompt.

[0074] When the processor executes each step of the SIM card switching test method, if an abnormal problem occurs, the processor will generate and output a test result indicating the test abnormality and a corresponding abnormality prompt. After generating the test result indicating the test abnormality, the processor can continue to execute subsequent steps or directly interrupt the test process according to pre-set instructions. For example, for the test item of whether the network status bar exists, if the network status bar does not exist in the current interface, it will not affect the execution of subsequent test steps, and the processor can continue to execute subsequent steps.

[0075] See Figure 7 , Figure 7 The flowchart of the SIM card switching test method provided by an embodiment of the present application is as follows. When a laptop computer is provided with multiple SIM cards and a cyclic switching test is required for the multiple SIM cards, the SIM card switching test method includes the following steps. Figure 7 As shown, the following embodiment takes two SIM cards for cycle switching test as an example. In other embodiments of the present application, the number of cycles can be preset for other numbers of SIM cards based on the following steps and the SIM card switching test method can be performed. The SIM card switching test method includes the following steps:

[0076] S310: Query the obtained interface information for a mobile network element identifier, and determine whether a mobile network option exists in the current interface based on the query result.

[0077] S320: Query the acquired interface information for an element identifier of a mobile network advanced option display box, and determine whether a mobile network advanced option display box exists in the current interface based on the query result.

[0078] Steps S310 to S320 are the same as the above-mentioned steps S210 to S220. For specific details, please refer to the above-mentioned steps S210 to S220, which will not be repeated here.

[0079] S330: Switch the currently used SIM card to the first SIM card and perform a function test;

[0080] S340: Switch the currently used SIM card to the second SIM card and perform a function test;

[0081] Both step S330 and step S340 may include the above-mentioned steps S230 to S270. For specific details, please refer to the above-mentioned steps S230 to S270.

[0082] In this step, the first SIM card refers to the SIM card that initially undergoes the handover test (e.g., SIM card 1), and the second SIM card refers to another SIM card (e.g., SIM card 2) that also requires a handover test after the first SIM card test is complete. After the processor determines whether the network function corresponding to the currently switched SIM card (the first SIM card) is normal, it determines the known second SIM card as the new SIM card to be used, so that the processor can perform the operation of switching the currently used SIM card to the second SIM card in subsequent steps.

[0083] Please combine Figure 8 , Figure 8 This is a schematic diagram of an interface for selecting a second SIM card in the SIM card switching selection box provided in an embodiment of the present application. Figure 8 As shown, after the processor completes the test on the first SIM card (SIM card 1), it changes the test object in the switching instruction to another SIM card, namely the second SIM card, so that when the processor sends the control instruction again to simulate the mouse movement, the second SIM card (i.e., SIM card 2) in the SIM card switching selection box is selected.

[0084] In one embodiment, the names of the SIM cards (e.g., first SIM card, second SIM card) can be directly determined by the slot position number preset in the laptop, or can be determined by other factors. For example, the first SIM card can also refer to the SIM card installed in position 1 of the laptop's slot. The laptop can default to SIM card 1 pre-installed in the slot as the first SIM card and the ESIM card (or SIM card 2) included with the communication module as the second SIM card.

[0085] S350: Determine whether the accumulated number of SIM card switching times reaches a preset number.

[0086] In this step, the processor may set a preset number of times based on the number of cycles or switches required for the SIM card switching test. The processor accumulates the number of switches after each SIM card completes a switching test, or accumulates the number of tests after all SIM cards to be tested are tested. The processor then determines, based on the preset number of times and the accumulated number of times, whether the accumulated number of times satisfies the condition for exiting the SIM card switching test cycle. If so, step S360 is executed; if not, step S330 is executed again.

[0087] S360: Output test results.

[0088] In this step, if the processor completes the test of multiple SIM cards in the laptop computer and the test results of all test steps of each SIM card are normal, the processor executes sub-step S361 to generate and output the test result that the laptop computer's SIM card switching function test passed; if the test result of any test step of any SIM card is abnormal, the processor executes step S362 to generate the test result of the test abnormality and summarize the corresponding abnormal prompts, and outputs them accordingly to be displayed on the user interface, so that the user can directly understand the root cause of the test abnormality.

[0089] S361: The SIM card switching function test passed.

[0090] S362: Test exception, output exception prompt.

[0091] In one embodiment, the present application can use the pywinauto module (pywinauto is a set of Python modules that implement windows GUI window automation) to simulate mouse click operations on the page by searching for the Name, ID (identification code), Text, etc. of different control UI (user interface) elements, so as to further implement the operation of switching SIM cards in the Windows mobile network interface.

[0092] The present application solves the problems in the prior art of low test efficiency and easy failure to capture abnormal test results caused by frequent manual switching of SIM cards. By searching for multiple interface element identifiers to further simulate mouse click operations and judging whether the physical switching and function of the SIM card are effective based on the received response data, the test method improves the test efficiency and test quality of SIM card switching, greatly saves manpower and material resources, and brings a good experience to users during the SIM card switching test process.

[0093] An embodiment of the present application provides a computer-readable storage medium storing a computer program that can be executed by a processor 11 to implement a SIM card switching test method.

[0094] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0095] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A SIM card switching test method, characterized in that: The method comprises: After finding the SIM card switching selection box, in response to an instruction to select a first SIM card in the SIM card switching selection box, performing an operation of setting the first SIM card as the currently used SIM card; Determining, based on the SIM card information responded by the communication module, whether the physical SIM card corresponding to the SIM card information is consistent with the SIM card displayed on the current interface and both are the first SIM card includes: Based on the SIM card information responded by the communication module, determining whether the physical SIM card corresponding to the SIM card information is the first SIM card; if the physical SIM card is the first SIM card, confirming the SIM card displayed on the current interface based on the obtained interface element identifier; and determining whether the displayed SIM card is the first SIM card; If the physical SIM card and the displayed SIM card are consistent and both are the first SIM card, it is determined whether the network function corresponding to the first SIM card is normal based on the received network function response data.

2. The SIM card switching test method according to claim 1, characterized in that: Before executing the operation of setting the first SIM card as the currently used SIM card in response to the instruction of selecting the first SIM card in the SIM card switching selection box, the method further includes: After finding the SIM card switching selection box, it is determined whether the first SIM card exists in the SIM card switching selection box.

3. The SIM card switching test method according to claim 1, characterized in that: The network function response data includes network registration response data, and judging whether the network function corresponding to the first SIM card is normal based on the received network function response data includes: Based on the network registration response data, determining whether a mobile network corresponding to the first SIM card can be found; If the mobile network corresponding to the first SIM card can be found, it is determined whether the network function corresponding to the first SIM card is normal based on the other network function response data.

4. The SIM card switching test method according to claim 3, characterized in that: The network function response data further includes network card connection data, and judging whether the network function corresponding to the first SIM card is normal based on other network function response data includes: Disable local network; Based on the network card connection data, it is determined whether the network card connection status is normal when the current network is the mobile network corresponding to the first SIM card.

5. The SIM card switching test method according to claim 3, characterized in that: The network function response data further includes webpage response data, and judging whether the network function corresponding to the first SIM card is normal based on other network function response data includes: Disable local network; After sending a page data request message to a preset designated website, receiving the webpage response data corresponding to the page data request message; Based on the webpage response data, it is determined whether the data service is normal when the current network is the mobile network corresponding to the first SIM card.

6. The SIM card switching test method according to claim 1, characterized in that: Before executing the operation of setting the first SIM card as the currently used SIM card in response to the instruction of selecting the first SIM card in the SIM card switching selection box, the method further includes: After sending an instruction requesting to obtain interface information, querying the SIM card switching selection box identifier based on the obtained interface information; Based on the SIM card switching selection box identifier, the SIM card switching selection box is searched.

7. The SIM card switching test method according to claim 6, characterized in that: Before searching for the SIM card switching selection box, the method further includes: The mobile network element identifier is searched in the acquired interface information, and based on the search result, it is determined whether a mobile network option exists in the current interface.

8. An electronic device, characterized in that: The electronic device comprises: processor; A communication module, used to implement the mobile communication function of the electronic device; a memory for storing processor-executable instructions; The processor is configured to execute the SIM card switching test method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program can be executed by a processor to complete the SIM card switching test method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • System and Process for Switching Subscriber Identity Module (SIM) Cards

    US20220007169A1