Method and system for back-end automatic testing of short message platform
Through automated test scripts and virtual SMS clients, various test steps of the SMS platform are simulated and executed, solving the problems of low efficiency and insufficient reliability of automated tests in the existing technology, and achieving more efficient and reliable test coverage.
Patent Information
- Application Number
- CN202510027392.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, the automated testing of the backend of the SMS platform is inefficient, and it is impossible to guarantee the repeated execution of test cases, which is susceptible to human factors, resulting in insufficient reliability and coverage of the test results.
Using automated test scripts and virtual SMS clients, by simulating various scenarios and parameters, we automatically perform test steps such as account authentication, parameter verification, virtual SMS operator return failure response and receipt processing of SMS platform.
It improves the accuracy and reliability of the test, reduces human errors, has a wider coverage, can quickly verify the impact of version iteration, and reduces R&D costs and version iteration cycle.
Smart Images

Figure CN119865776A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to communication technology, and more specifically, to a method and system for automatic testing of a short message platform back end. Background Art
[0002] With the development of technology and the progress of society, the application of traditional short messages has been expanded to more and more fields. SMS appears in every corner of people's daily life and has penetrated into various industries and fields. For example, verification code SMS, merchant member notification SMS, merchant marketing SMS, government / legal notification SMS, railway / aviation / hospital / property notification SMS and other scenarios. However, not all merchants or customers will develop a set of SMS platforms that can connect to the three major operators. Instead, they use APIs to call the open interfaces of the SMS platform to send SMS. Therefore, the SMS platform has become an indispensable part of the industry.
[0003] Since SMS has touched many industries and scenarios, it is a basic right for end users to receive relevant SMS notifications in a timely manner after users purchase goods and services. Therefore, the stability of the SMS platform is very important. If there is a problem with the SMS platform, it will have a great impact on end users. Imagine that when a user is using a mobile phone number to log in to a government APP, but cannot receive a mobile phone verification code, or the received SMS content is incomplete or garbled, it will cause great trouble to the user, and the customer will also question the services provided by the SMS platform, which will lead to customer complaints.
[0004] For any system, testing is essential before new functions are launched. Especially for the backend of the SMS platform, which involves the core processing logic of SMS sending, it is the top priority of testing. The industry currently mainly uses manual testing methods. However, manual testing has the following shortcomings:
[0005] 1. Many steps and low efficiency: Testers need to manually execute each SMS test case. The steps include: confirming the account required by the case and modifying the configuration of the account according to the preset conditions, executing the test case, observing and recording various results (including user-side interaction results, operator-side interaction results, whether all fields in the SMS platform database are correct, sending log records, etc.), and tracking problems. With the increase and update of the functions of the SMS platform, the workload of testing is increasing.
[0006] 2. Poor repeatability: Manual testing cannot guarantee the repeated execution of test cases and is easily affected by human factors. For example, a test case that passed the first round of testing may be artificially ignored by the tester in the second round of testing.
[0007] 3. Low reliability: Manual testing is easily affected by subjective factors, and the reliability of test results is low.
[0008] 4. Low coverage: When relying solely on manual execution of use cases, the use case scenarios of the previous version cannot be covered. Summary of the invention
[0009] The technical problem to be solved by the present invention is to provide a method and system for automatic testing of the back-end of a short message platform in view of the deficiencies in the prior art, which can greatly reduce R&D costs, improve demand iteration speed and version quality, and ensure customer experience.
[0010] The method for automatic testing of the back-end of a short message platform described in the present invention comprises the following steps:
[0011] An account authentication test step is used to send the parameters of the automated test script with an incorrect account to a virtual SMS client, initiate a login request to the SMS platform through the virtual SMS client, and if a failed connection response is returned to the automated test script, the SMS platform account authentication test is completed;
[0012] The SMS platform parameter verification step is used to send the parameters of the automated test script with the wrong mobile phone number to the virtual SMS client, initiate a SMS sending request to the SMS platform through the virtual SMS client, and if a failed sending response is returned to the automated test script, the SMS platform parameter verification is completed;
[0013] The processing step of the SMS platform returning a failure response to the virtual SMS operator is used to send the parameters of the automated test script with the shutdown number to the virtual SMS client, initiate a SMS delivery request to the SMS platform through the virtual SMS client, and the SMS platform delivers the SMS to the virtual SMS operator. If the automated test script receives a delivery failure receipt from the SMS platform, the SMS platform completes the test of returning a failure response to the virtual SMS operator.
[0014] The processing steps of the SMS platform returning a failed receipt to the virtual SMS operator are used to send the parameters of the automated test script with a normally used mobile phone number to the virtual SMS client, initiate an SMS sending request to the SMS platform through the virtual SMS client, and the SMS platform sends the SMS to the virtual SMS operator. If the automated test script receives a failed sending receipt from the virtual SMS operator, the SMS platform completes the test of returning a failed receipt to the virtual SMS operator.
[0015] Preferably, the account authentication test step specifically includes:
[0016] Step 1: Setting the parameters of the current use case in the automated test script, and setting the account parameter in the current use case to an account that does not exist in the SMS platform;
[0017] Step 2: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction;
[0018] Step 3: The virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform;
[0019] Step 4: After receiving the login request, the SMS platform obtains the account parameters in the login request and verifies the account parameters. If the verification result shows that the account in the account parameters does not exist, a login failure response is returned;
[0020] Step 5: After receiving the login failure response, the virtual SMS client returns a connection response to the automated test script;
[0021] Step 6: The automated test script verifies the received connection response. If the verification result indicates that the connection has failed, it asserts that the response code is consistent with expectations.
[0022] Preferably, in the account authentication test step, there is no need to perform script pre-processing and post-processing on the current use case.
[0023] Preferably, the SMS platform parameter verification step includes:
[0024] Step 1: Set the parameters of the current use case in the automated test script, and set the account parameter in the current use case to an incorrectly formatted mobile phone number;
[0025] Step 2: Pre-process the automated test script;
[0026] Step 3: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction;
[0027] Step 4: the virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform;
[0028] Step 5: After receiving the login request, the SMS platform extracts the account number in the first type parameter for authentication test. If the authentication test passes, a login success response is returned to the virtual SMS client;
[0029] Step 6: After receiving the successful login response, the virtual SMS client returns a successful connection response to the automated test script;
[0030] Step 7: After the automated test script asserts that the connection response is consistent with expectations based on the successful connection response, it proceeds to the next step;
[0031] Step 8: The automated test script sends the second type of parameters in the parameters as the content of the SMS instruction to the virtual SMS client;
[0032] Step 9: After receiving the SMS instruction, the virtual SMS client sends the SMS instruction to the SMS platform in the form of SMS;
[0033] Step 10: After receiving the SMS, the SMS platform verifies the second type parameter. If the verification result shows that the mobile phone number format is incorrect, the platform submits a failure response to the virtual SMS client;
[0034] Step 11: The virtual SMS client returns a failure response to the automated test script;
[0035] Step 12: After receiving the failed response, the automated test script asserts that the response is consistent with expectations;
[0036] Step 13: The automated test script is post-processed.
[0037] Preferably, the SMS platform processes the failure response returned by the virtual SMS operator by:
[0038] Step 1: Set the parameters of the current test case in the automated test script;
[0039] Step 2: Pre-process the automated test script;
[0040] Step 3: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction;
[0041] Step 4: the virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform;
[0042] Step 5: After receiving the login request, the SMS platform extracts the account number in the first type parameter for authentication test. If the authentication test passes, a login success response is returned to the virtual SMS client;
[0043] Step 6: After receiving the successful login response, the virtual SMS client returns a successful connection response to the automated test script;
[0044] Step 7: After the automated test script asserts that the connection response is consistent with expectations based on the successful connection response, it proceeds to the next step;
[0045] Step 8: The automated test script sends the second type of parameters in the parameters as the content of the SMS instruction to the virtual SMS client;
[0046] Step 9: After receiving the SMS instruction, the virtual SMS client sends the SMS instruction to the SMS platform in the form of SMS;
[0047] Step 10: After receiving the SMS, the SMS platform verifies the second type parameter, and if the verification passes, returns a successful SMS submission response to the virtual SMS client;
[0048] Step 11: The virtual SMS client returns a successful response to the automated test script;
[0049] Step 12: After receiving the successful response, the automated test script asserts that the response is consistent with expectations and proceeds to the next step;
[0050] Step 13: The SMS platform submits the SMS to the virtual SMS operator;
[0051] Step 14: The virtual SMS operator extracts the mobile phone number from the SMS and verifies whether it is in a powered-off state. If the verification result shows that the mobile phone number is in a powered-off state, a submission failure response is returned to the virtual SMS operator;
[0052] Step 15: After receiving the failure response from the virtual SMS operator, the SMS platform pushes a SMS delivery failure receipt to the virtual SMS client;
[0053] Step 16: After receiving the receipt of the failed SMS delivery, the virtual SMS client returns a receipt response to the SMS platform;
[0054] Step 17: The automated test script calls the instruction to obtain a receipt of the virtual SMS client;
[0055] Step 18: After receiving the instruction to obtain a receipt, the virtual SMS client returns the data in the receipt of the failed SMS delivery to the automated test script;
[0056] Step 19: the automated test script parses the data in the SMS delivery failure receipt, and if the data in the SMS delivery failure receipt contains data indicating that the submitted mobile phone number is in a powered-off state, it is asserted that the response is consistent with expectations;
[0057] Step 20: The automated test script is post-processed.
[0058] Preferably, the SMS platform processes the failed receipt returned by the virtual SMS operator in the following steps:
[0059] Step 1: Set the parameters of the current test case in the automated test script;
[0060] Step 2: Pre-process the automated test script;
[0061] Step 3: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction;
[0062] Step 4: the virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform;
[0063] Step 5: After receiving the login request, the SMS platform extracts the account number in the first type parameter for authentication test. If the authentication test passes, a login success response is returned to the virtual SMS client;
[0064] Step 6: After receiving the successful login response, the virtual SMS client returns a successful connection response to the automated test script;
[0065] Step 7: After the automated test script asserts that the connection response is consistent with expectations based on the successful connection response, it proceeds to the next step;
[0066] Step 8: The automated test script sends the second type of parameters in the parameters as the content of the SMS instruction to the virtual SMS client;
[0067] Step 9: After receiving the SMS instruction, the virtual SMS client sends the SMS instruction to the SMS platform in the form of SMS;
[0068] Step 10: After receiving the SMS, the SMS platform verifies the second type parameter, and if the verification passes, returns a successful SMS submission response to the virtual SMS client;
[0069] Step 11: The virtual SMS client returns a successful response to the automated test script;
[0070] Step 12: After receiving the successful response, the automated test script asserts that the response is consistent with expectations and proceeds to the next step;
[0071] Step 13: The SMS platform submits the SMS to the virtual SMS operator;
[0072] Step 14: The virtual SMS operator extracts the mobile phone number from the SMS and verifies it. When the verification passes, a successful SMS submission response is returned to the SMS platform;
[0073] Step 15: The virtual SMS operator simulates that the SMS is not successfully sent to the mobile phone number terminal, and generates a SMS push failure receipt, and pushes the SMS failure receipt to the SMS platform;
[0074] Step 16: After receiving the SMS push failure receipt, the SMS platform returns a receipt response to the virtual SMS operator;
[0075] Step 17: The SMS platform pushes the SMS push failure receipt to the virtual SMS client;
[0076] Step 18: After receiving the SMS push failure receipt, the virtual SMS client returns a receipt response to the SMS platform;
[0077] Step 19: The automated test script calls the instruction to obtain a receipt of the virtual SMS client;
[0078] Step 20: The virtual SMS client returns the received SMS push failure receipt data to the automated test script;
[0079] Step 21: The automated test script parses the data of the SMS push failure receipt. If the data in the SMS push failure receipt contains data indicating that the virtual SMS operator cannot push the SMS to the mobile phone number terminal, it is asserted that the response is consistent with expectations and post-processing is performed.
[0080] Preferably, the pre-processing includes confirming whether the account, password and mobile phone number used in the current use case exist in the SMS platform; the post-processing includes sending a disconnection instruction to the virtual SMS client and restoring the account configuration.
[0081] Preferably, the first type of parameters includes an account number, an account password, and a protocol type; the second type of parameters includes a mobile phone number and text message content.
[0082] A system for implementing the SMS platform backend automated testing method, comprising an SMS automated testing framework, wherein the SMS automated testing framework is constructed with:
[0083] Automated test scripts, for scripts written based on current use cases;
[0084] Virtual SMS client, used to extract the sending protocols involved in the SMS platform into a set of common interface instructions;
[0085] The SMS platform that was the target of the test;
[0086] A virtual SMS operator is used to simulate a real operator in the existing network.
[0087] Beneficial Effects
[0088] The advantages of the present invention are:
[0089] 1. Support simulation tests of multiple scenarios to help discover system defects: The present invention can conveniently adjust various preconditions and set various parameters in real time through automated test scripts to help simulate various scenarios of the existing SMS network.
[0090] 2. Improve test accuracy and reliability: Once the automated test script is written, the test can be repeatedly executed based on fixed preconditions, avoiding human errors and improving test accuracy and reliability.
[0091] 3. Speed up the version iteration cycle and save R&D costs: Testers can directly run the test case set to verify whether the modification of the current version affects the functions of the previous version, reduce the time of regression testing, and speed up the testing progress. Therefore, in the long run, it can save a lot of human resources and time, speed up the version iteration cycle, and thus reduce the overall R&D cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] Figure 1 It is a schematic diagram of the system framework of the present invention;
[0093] Figure 2 A schematic diagram of a test flow of using an incorrect account to log into a text message platform for an automated test script in the method of the present invention;
[0094] Figure 3 A schematic diagram of a test flow of sending a text message using an incorrect mobile phone number by using an automated test script in the method of the present invention;
[0095] Figure 4 A schematic diagram of a test flow of sending a text message to a powered-off mobile phone number under an automated test case script in the method of the present invention;
[0096] Figure 5 The present invention is a schematic diagram of a test flow of sending a text message to a normal mobile phone number under an automated test script in the method of the present invention. DETAILED DESCRIPTION
[0097] The present invention will be further described below in conjunction with the embodiments, but it does not constitute any limitation to the present invention. Any limited number of modifications made by anyone within the scope of the claims of the present invention are still within the scope of the claims of the present invention.
[0098] like Figure 1As shown, a system for automated testing of the back-end of a text message platform of the present invention includes a text message automated testing framework. Among them, the text message automated testing framework mainly provides a general capability, such as: supporting the independent running of automated test case scripts, supporting the sequential running or parallel running of all case scripts, abstracting general underlying functions and functions for use by upper-level automated case scripts, supporting multiple ways to notify the results of case running, detailed log records, etc. The text message automated testing framework includes the following four parts: automated testing scripts, virtual text message clients, text message platforms, and virtual text message operators. The present invention is applicable to text message platforms that support China Mobile's CMPP2.0 protocol, China Mobile's CMPP3.0 protocol, China Unicom's SGIP1.2 protocol, China Telecom's SMGP3.0 protocol, and the international SMPP3.4 protocol. The functional overview of each part is as follows:
[0099] Automated test scripts:
[0100] The automated test script is implemented based on Python language. The automated test script is a script written by the tester based on the test case. Each script includes the variables involved in the current test case (such as account number, mobile phone number, SMS content, port, etc.), precondition settings, use case implementation and result assertion, and postcondition settings.
[0101] Virtual SMS client:
[0102] The function of the virtual SMS client is to abstract the sending protocols involved in the SMS platform into a set of general interface instructions, including connection instructions, disconnection instructions, viewing all connections instructions, login instructions, SMS submission instructions, SMS status report instructions, and uplink SMS instructions. The automated test script carries parameters and sends instructions to the virtual SMS client, which interacts with the SMS platform based on the received parameters and instructions.
[0103] SMS platform:
[0104] The SMS platform is the target to be tested. The SMS platform contains many functions, such as: number blacklist detection, SMS content keyword detection, SMS content review, SMS sending frequency limit, channel routing, etc. Each automated test script actually tests a function point of the SMS platform. Each function point of the SMS platform may require several automated test scripts to test.
[0105] Virtual SMS Operator:
[0106] Virtual SMS operators are used to simulate real operators in the existing network. During the daily testing of the SMS platform, we cannot directly send SMS to real operators. Virtual SMS operators provide a set of interfaces, through which we can set the behavior of virtual SMS operators in real time. For example: set the response delay, response code, receipt delay, receipt code, uplink SMS delay, uplink SMS content, uplink SMS, etc. of the virtual SMS operator, and you can also make the virtual SMS operator actively disconnect from the SMS platform.
[0107] Based on the above system, the present invention provides a method for automatic testing of the back-end of a short message platform, which is specifically described as follows.
[0108] like Figure 2 The following is an example of an automated test script that uses an incorrect account to log in to the SMS platform to test the account authentication function of the SMS platform. The following steps are included:
[0109] F1: The automated test script sets the parameters required for the current use case, but the current use case will use a non-existent account;
[0110] F2: The automated test script does some preprocessing, but this use case does not require any preprocessing;
[0111] F3: The automated test script carries relevant parameters (account number, password, protocol type, etc.) and formally issues a connection command to the virtual SMS client;
[0112] F4: The virtual SMS client uses the received parameters to initiate a login request to the SMS platform;
[0113] F5: After receiving the login request, the SMS platform obtains the account number in the request message. However, after verification, the system finds that the account does not exist and returns a failure response;
[0114] F6: After receiving the failed response, the virtual SMS client returns the response of the connection instruction to the automated test script;
[0115] F7: The automated test script verifies the response to the received connection command and asserts that the response code is consistent with the expectation;
[0116] F8: The automated test script performs post-processing. This use case does not require any post-processing to complete the account authentication test of the SMS platform.
[0117] like Figure 3 As shown in the figure, it is an automated test script that uses an incorrect mobile phone number to send a text message to test the parameter verification function of the SMS platform, including the following steps:
[0118] F1: The automated test script sets the parameters required for the current use case, but the current use case will use an incorrectly formatted mobile phone number;
[0119] F2: The automated test script performs some pre-processing, such as confirming that the account used in the current test case already exists in the system and obtaining the password of this account.
[0120] F3: The automated test script carries relevant parameters (account number, password, protocol type, etc.) and formally issues a connection command to the virtual SMS client;
[0121] F4: The virtual SMS client uses the received parameters to initiate a login request to the SMS platform;
[0122] F5: After receiving the login request, the SMS platform passes the authentication and returns a login success response to the virtual SMS client;
[0123] F6: After receiving the response, the virtual SMS client returns a connection success response to the automated test script;
[0124] F7: The automated test script asserts that the connection response is consistent with expectations;
[0125] F8: The automated test script carries relevant parameters (mobile phone number, SMS content, etc.) and sends SMS instructions to the virtual SMS client;
[0126] F9: The virtual SMS client receives the request and uses the parameters in the request to send the SMS to the SMS platform;
[0127] F10: After receiving the SMS, the SMS platform performs parameter verification and finds that the mobile phone number format is incorrect, and returns a failure response;
[0128] F11: The virtual SMS client returns a failed response to the automated test script;
[0129] F12: The automated test script receives a failed response and asserts that the response is consistent with expectations and is a failed response;
[0130] F13: The automated test script performs some post-processing, such as sending a disconnect command to the virtual SMS client, restoring account configuration, etc.
[0131] like Figure 4 As shown, it is an automated test case script that sends a text message to a powered-off mobile phone number to test the SMS platform's processing function for the failure response returned by the virtual SMS operator, including the following steps:
[0132] F1: The automated test script sets the parameters required for the current use case, such as account number, mobile phone number, SMS content, etc.
[0133] F2: The automated test script performs some pre-processing, such as confirming that the account used by the current script already exists in the system and obtaining the password of this account.
[0134] F3: The automated test script carries relevant parameters (account number, password, protocol type, etc.) and formally issues a connection command to the virtual SMS client;
[0135] F4: The virtual SMS client uses the received parameters to initiate a login request to the SMS platform;
[0136] F5: After receiving the login request, the SMS platform passes the authentication and returns a login success response to the virtual SMS client;
[0137] F6: After receiving the response, the virtual SMS client returns a connection success response to the automated test script;
[0138] F7: The automated test script asserts that the connection response is consistent with expectations;
[0139] F8: The automated test script carries relevant parameters (mobile phone number, SMS content, etc.) and sends SMS instructions to the virtual SMS client;
[0140] F9: The virtual SMS client receives the request and uses the parameters in the request to send the SMS to the SMS platform;
[0141] F10: After receiving the SMS, the SMS platform performs parameter verification. If the verification passes, the mobile phone number exists in the system, and a response is returned to the virtual SMS client.
[0142] F11: After receiving the submission response, the virtual SMS client returns the response to the automated test script;
[0143] F12: The automated test script asserts that the response sent is consistent with expectations;
[0144] F13: The SMS platform submits SMS to the virtual SMS operator;
[0145] F14: The virtual SMS operator extracts the mobile phone number from the SMS and verifies whether it is powered off. If the verification result shows that the mobile phone number is powered off, a submission failure response is returned;
[0146] F15: The SMS platform receives the response of submission failure and pushes a failure receipt to the virtual SMS client;
[0147] F16: After receiving the failure receipt, the virtual SMS client returns a receipt response to the SMS platform;
[0148] F17: The automated test script calls the instruction to obtain receipts of the virtual SMS client to obtain receipts that the virtual SMS client has received;
[0149] F18: The virtual SMS client returns the received receipt data to the automated test script;
[0150] F19: The automated test script receives the receipt data and asserts that the response is consistent with expectations, which is a failed response;
[0151] F20: The automated test script performs some post-processing, such as sending a disconnect command to the virtual SMS client, restoring account configuration, etc.
[0152] like Figure 5 As shown, it is an automated test script that sends a text message to a normal mobile phone number to test the SMS platform's processing function for the failed receipt returned by the virtual SMS operator, including the following steps:
[0153] F1: The automated test script sets the parameters required for the current use case, such as account number, mobile phone number, SMS content, etc.
[0154] F2: The automated test script performs some pre-processing, such as confirming that the account used by the current script already exists in the system, obtaining the password of this account, and setting the virtual SMS operator to return a successful response and a failed receipt, etc.
[0155] F3: The automated test script carries relevant parameters (account number, password, protocol type, etc.) and formally issues a connection command to the virtual SMS client;
[0156] F4: The virtual SMS client uses the received parameters to initiate a login request to the SMS platform;
[0157] F5: After receiving the login request, the SMS platform passes the authentication and returns a login success response to the virtual SMS client;
[0158] F6: After receiving the response, the virtual SMS client returns a connection success response to the automated test script;
[0159] F7: The automated test script asserts that the connection response is consistent with expectations;
[0160] F8: The automated test script carries relevant parameters (mobile phone number, SMS content, etc.) and sends SMS instructions to the virtual SMS client;
[0161] F9: The virtual SMS client receives the request and uses the parameters in the request to send the SMS to the SMS platform;
[0162] F10: After receiving the SMS, the SMS platform performs parameter verification and returns a successful response to the virtual SMS client;
[0163] F11: The virtual SMS client returns a successful response to the automated test script;
[0164] F12: The automated test script receives the response and asserts that the response is consistent with expectations and is a successful response, and verifies parameters such as msgid and result;
[0165] F13: After the SMS platform processes the service, it submits the SMS to the virtual SMS operator;
[0166] F14: The virtual SMS operator returns a response to the SMS platform, which is a successful response;
[0167] F15: The virtual SMS operator pushes a receipt to the SMS platform. This receipt is a failed receipt, which means that the virtual SMS operator did not successfully send the SMS to the mobile phone.
[0168] F16: After receiving the receipt, the SMS platform returns a receipt response to the virtual SMS operator;
[0169] F17: The SMS platform pushes the receipt to the virtual SMS client;
[0170] F18: After receiving the receipt, the virtual SMS client returns the receipt response to the SMS platform;
[0171] F19: The automated test script calls the instruction to obtain receipts of the virtual SMS client to obtain receipts that the virtual SMS client has received;
[0172] F20: The virtual SMS client returns the received receipt data to the automated test script;
[0173] F21: The automated test script asserts the receipt and the judgment is consistent with expectations;
[0174] F22: The automated test script performs some post-processing, such as sending a disconnect command to the virtual SMS client, restoring the account configuration, etc.
[0175] The above is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the structure of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent.
Claims
1. A method for automatic testing of the backend of a short message platform, characterized in that: The method comprises the following steps: An account authentication test step is used to send the parameters of the automated test script with an incorrect account to a virtual SMS client, initiate a login request to the SMS platform through the virtual SMS client, and if a failed connection response is returned to the automated test script, the SMS platform account authentication test is completed; The SMS platform parameter verification step is used to send the parameters of the automated test script with the wrong mobile phone number to the virtual SMS client, initiate a SMS sending request to the SMS platform through the virtual SMS client, and if a failed sending response is returned to the automated test script, the SMS platform parameter verification is completed; The processing step of the SMS platform returning a failure response to the virtual SMS operator is used to send the parameters of the automated test script with the shutdown number to the virtual SMS client, initiate a SMS delivery request to the SMS platform through the virtual SMS client, and the SMS platform delivers the SMS to the virtual SMS operator. If the automated test script receives a delivery failure receipt from the SMS platform, the SMS platform completes the test of returning a failure response to the virtual SMS operator. The processing steps of the SMS platform returning a failed receipt to the virtual SMS operator are used to send the parameters of the automated test script with a normally used mobile phone number to the virtual SMS client, initiate an SMS sending request to the SMS platform through the virtual SMS client, and the SMS platform sends the SMS to the virtual SMS operator. If the automated test script receives a failed sending receipt from the virtual SMS operator, the SMS platform completes the test of returning a failed receipt to the virtual SMS operator.
2. The method for automatic testing of the back-end of a short message platform according to claim 1, characterized in that: The account authentication test steps specifically include: Step 1: Setting the parameters of the current use case in the automated test script, and setting the account parameter in the current use case to an account that does not exist in the SMS platform; Step 2: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction; Step 3: The virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform; Step 4: After receiving the login request, the SMS platform obtains the account parameters in the login request and verifies the account parameters. If the verification result shows that the account in the account parameters does not exist, a login failure response is returned; Step 5: After receiving the login failure response, the virtual SMS client returns a connection response to the automated test script; Step 6: The automated test script verifies the received connection response. If the verification result indicates that the connection has failed, it asserts that the response code is consistent with expectations.
3. The method for automatic testing of the back-end of a short message platform according to claim 2, characterized in that: In the account authentication test step, there is no need to perform script pre-processing and post-processing on the current use case.
4. The method for automatic testing of the back-end of a short message platform according to claim 1, characterized in that: The SMS platform parameter verification step includes: Step 1: Set the parameters of the current use case in the automated test script, and set the account parameter in the current use case to an incorrectly formatted mobile phone number; Step 2: Pre-process the automated test script; Step 3: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction; Step 4: the virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform; Step 5: After receiving the login request, the SMS platform extracts the account number in the first type parameter for authentication test. If the authentication test passes, a login success response is returned to the virtual SMS client; Step 6: After receiving the successful login response, the virtual SMS client returns a successful connection response to the automated test script; Step 7: After the automated test script asserts that the connection response is consistent with expectations based on the successful connection response, it proceeds to the next step; Step 8: The automated test script sends the second type of parameters in the parameters as the content of the SMS instruction to the virtual SMS client; Step 9: After receiving the SMS instruction, the virtual SMS client sends the SMS instruction to the SMS platform in the form of SMS; Step 10: After receiving the SMS, the SMS platform verifies the second type parameter. If the verification result shows that the mobile phone number format is incorrect, the platform submits a failure response to the virtual SMS client; Step 11: The virtual SMS client returns a failure response to the automated test script; Step 12: After receiving the failed response, the automated test script asserts that the response is consistent with expectations; Step 13: The automated test script is post-processed.
5. The method for automatic testing of the back-end of a short message platform according to claim 1, characterized in that: The steps of processing the failure response returned by the SMS platform to the virtual SMS operator include: Step 1: Set the parameters of the current test case in the automated test script; Step 2: Pre-process the automated test script; Step 3: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction; Step 4: the virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform; Step 5: After receiving the login request, the SMS platform extracts the account number in the first type parameter for authentication test. If the authentication test passes, a login success response is returned to the virtual SMS client; Step 6: After receiving the successful login response, the virtual SMS client returns a successful connection response to the automated test script; Step 7: After the automated test script asserts that the connection response is consistent with expectations based on the successful connection response, it proceeds to the next step; Step 8: The automated test script sends the second type of parameters in the parameters as the content of the SMS instruction to the virtual SMS client; Step 9: After receiving the SMS instruction, the virtual SMS client sends the SMS instruction to the SMS platform in the form of SMS; Step 10: After receiving the SMS, the SMS platform verifies the second type parameter, and if the verification passes, returns a successful SMS submission response to the virtual SMS client; Step 11: The virtual SMS client returns a successful response to the automated test script; Step 12: After receiving the successful response, the automated test script asserts that the response is consistent with expectations and proceeds to the next step; Step 13: The SMS platform submits the SMS to the virtual SMS operator; Step 14: The virtual SMS operator extracts the mobile phone number from the SMS and verifies whether it is in a powered-off state. If the verification result shows that the mobile phone number is in a powered-off state, a submission failure response is returned to the operator; Step 15: After receiving the failure response from the virtual SMS operator, the SMS platform pushes a SMS delivery failure receipt to the virtual SMS client; Step 16: After receiving the receipt of the failed SMS delivery, the virtual SMS client returns a receipt response to the SMS platform; Step 17: The automated test script calls the instruction to obtain a receipt of the virtual SMS client; Step 18: After receiving the instruction to obtain a receipt, the virtual SMS client returns the data in the receipt of the failed SMS delivery to the automated test script; Step 19: the automated test script parses the data in the SMS delivery failure receipt, and if the data in the SMS delivery failure receipt contains data indicating that the submitted mobile phone number is in a powered-off state, it is asserted that the response is consistent with expectations; Step 20: The automated test script is post-processed.
6. The method for automatic testing of the back-end of a short message platform according to claim 1, characterized in that: The SMS platform processes the failed receipt returned by the virtual SMS operator in the following steps: Step 1: Set the parameters of the current test case in the automated test script; Step 2: Pre-process the automated test script; Step 3: Send the first type of parameters in the parameters to the virtual SMS client through a connection instruction; Step 4: the virtual SMS client uses the received first type of parameters to initiate a login request to the SMS platform; Step 5: After receiving the login request, the SMS platform extracts the account number in the first type parameter for authentication test. If the authentication test passes, a login success response is returned to the virtual SMS client; Step 6: After receiving the successful login response, the virtual SMS client returns a successful connection response to the automated test script; Step 7: After the automated test script asserts that the connection response is consistent with expectations based on the successful connection response, it proceeds to the next step; Step 8: The automated test script sends the second type of parameters in the parameters as the content of the SMS instruction to the virtual SMS client; Step 9: After receiving the SMS instruction, the virtual SMS client sends the SMS instruction to the SMS platform in the form of SMS; Step 10: After receiving the SMS, the SMS platform verifies the second type parameter, and if the verification passes, returns a successful SMS submission response to the virtual SMS client; Step 11: The virtual SMS client returns a successful response to the automated test script; Step 12: After receiving the successful response, the automated test script asserts that the response is consistent with expectations and proceeds to the next step; Step 13: The SMS platform submits the SMS to the virtual SMS operator; Step 14: The virtual SMS operator extracts the mobile phone number from the SMS and verifies it. When the verification passes, a successful SMS submission response is returned to the SMS platform; Step 15: The virtual SMS operator simulates that the SMS is not successfully sent to the mobile phone number terminal, and generates a SMS push failure receipt, and pushes the SMS failure receipt to the SMS platform; Step 16: After receiving the SMS push failure receipt, the SMS platform returns a receipt response to the virtual SMS operator; Step 17: The SMS platform pushes the SMS push failure receipt to the virtual SMS client; Step 18: After receiving the SMS push failure receipt, the virtual SMS client returns a receipt response to the SMS platform; Step 19: The automated test script calls the instruction to obtain a receipt of the virtual SMS client; Step 20: The virtual SMS client returns the received SMS push failure receipt data to the automated test script; Step 21: The automated test script parses the data of the SMS push failure receipt. If the data in the SMS push failure receipt contains data indicating that the virtual SMS operator cannot push the SMS to the mobile phone number terminal, it is asserted that the response is consistent with expectations and post-processing is performed.
7. A method for automatic testing of the backend of a short message platform according to claim 3, 4, 5 or 6, characterized in that: The pre-processing includes confirming whether the account, password and mobile phone number used in the current use case exist in the SMS platform; the post-processing includes sending a disconnection instruction to the virtual SMS client and restoring the account configuration.
8. A method for automatic testing of the backend of a short message platform according to any one of claims 2 to 6, characterized in that: The first type of parameters includes account number, account password, and protocol type; the second type of parameters includes mobile phone number and text message content.
9. A system for implementing the SMS platform backend automation testing method according to any one of claims 1 to 8, characterized in that: It includes a text message automation test framework, which is constructed with: Automated test scripts, for scripts written based on current use cases; Virtual SMS client, used to extract the sending protocols involved in the SMS platform into a set of common interface instructions; The SMS platform that was the target of the test; A virtual SMS operator is used to simulate a real operator in the existing network.
Citation Information
Cited By
Method and device for verifying short message login function, equipment, medium and program product
CN120456024A