CN111159035A - Test method and device based on short message verification software - Google Patents

Test method and device based on short message verification software Download PDF

Info

Publication number
CN111159035A
CN111159035A CN201911375184.9A CN201911375184A CN111159035A CN 111159035 A CN111159035 A CN 111159035A CN 201911375184 A CN201911375184 A CN 201911375184A CN 111159035 A CN111159035 A CN 111159035A
Authority
CN
China
Prior art keywords
short message
verification code
short
verification
software
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911375184.9A
Other languages
Chinese (zh)
Inventor
晏焱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201911375184.9A priority Critical patent/CN111159035A/en
Publication of CN111159035A publication Critical patent/CN111159035A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]

Abstract

The invention provides a test method and a device based on short message verification software, wherein the method comprises the following steps: determining newly-added short messages in a short message inbox of the mobile phone in a mode of circularly reading the short messages in the short message inbox of the mobile phone; judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message; and filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and the software. The invention can automatically acquire and fill in the short message verification code under the condition of not modifying background product codes based on the scene that short message verification software needs to input the short message verification code, and improves the application range and the test efficiency of automatic tests under the condition of simulating a real test scene to the maximum extent.

Description

Test method and device based on short message verification software
Technical Field
The invention relates to the technical field of software testing, in particular to a testing method and a testing device based on short message verification software.
Background
In the years, with the rapid development of mobile communication technology, mobile phones based on an operating system are more and more popular, have the great advantage of open source and also have the problem of complex software performance, and meanwhile, the rapid development of mobile internet technology makes a large amount of software be developed and produced in a short time.
During the test process of developing software, a scenario of filling in a short message verification code for verification is encountered, such as: short message login, the conventional solution is: and skipping the short message verification function or calling a background product method to acquire the short message verification code by modifying the background product code.
However, the above method needs to modify the background product code or communicate with the background product and obtain the related authority to implement, which reduces the testing efficiency of the software.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a test method and a test device based on short message verification software, which can improve the automation degree of the test based on the short message verification software and further improve the test efficiency.
In order to solve the technical problems, the invention provides the following technical scheme:
in a first aspect, the present invention provides a test method based on short message verification software, including:
determining newly-added short messages in a short message inbox of the mobile phone in a mode of circularly reading the short messages in the short message inbox of the mobile phone;
judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and the software.
The method for determining the newly added short messages in the mobile phone short message inbox by circularly reading the short messages in the mobile phone short message inbox comprises the following steps:
comparing the short messages in the short message inbox read each time with the short messages in the short message inbox initially obtained one by one, and determining the short messages which do not exist in the short messages in the short message inbox initially obtained from the short messages in the short message inbox read each time; and the short messages which do not exist in the initially acquired short message inbox of the mobile phone are newly added short messages.
Wherein, the judging whether the newly added short message is a verification code short message comprises:
matching the content in the newly added short message in a regular expression mode, and judging whether the newly added short message contains preset first specific content;
the new short message containing the preset first specific content is a verification code short message.
The extracting of the verification code in the verification code short message comprises the following steps:
matching second specific content preset in the verification code short message in a regular expression mode;
and extracting the verification code in the verification code short message based on the second specific content.
In a second aspect, the present invention provides a testing apparatus based on short message verification software, including:
the new short message unit is used for determining new short messages in the mobile phone short message inbox in a mode of circularly reading the short messages in the mobile phone short message inbox;
the verification code extracting unit is used for judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and the verification code testing unit is used for filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification based on the verification code and an automatic testing program of the software.
Wherein, the newly added short message unit comprises:
the newly-added short message subunit is used for comparing the short messages in the mobile phone short message inbox read each time with the short messages in the mobile phone short message inbox initially acquired one by one, and determining the short messages which do not exist in the short messages in the mobile phone short message inbox initially acquired in the short messages in the mobile phone short message inbox read each time; and the short messages which do not exist in the initially acquired short message inbox of the mobile phone are newly added short messages.
Wherein the verification code extracting unit includes:
the first matching subunit is used for matching the content in the newly added short message in a regular expression mode and judging whether the newly added short message contains preset first specific content or not;
the new short message containing the preset first specific content is a verification code short message.
Wherein the verification code extracting unit includes:
the second matching subunit is used for matching second specific content preset in the verification code short message in a regular expression mode;
and the extracting subunit is used for extracting the verification code in the verification code short message based on the second specific content.
In a third aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the short message verification software-based test method when executing the program.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the short message verification software-based testing method.
According to the technical scheme, the invention provides the test method and the test device based on the short message verification software, and the newly added short messages in the mobile phone short message inbox are determined in a mode of circularly reading the short messages in the mobile phone short message inbox; judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message; the verification code is filled in a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and software, so that the short message verification code can be automatically acquired and filled in without modifying a background product code in a scene that the short message verification software needs to input the short message verification code, and the use range and the test efficiency of the automatic test are improved under the condition of simulating a real test scene to the maximum extent.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a test method based on short message verification software in an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a test apparatus based on short message verification software according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides an embodiment of a test method based on short message verification software, which specifically comprises the following contents in reference to fig. 1:
s101: determining newly-added short messages in a short message inbox of the mobile phone in a mode of circularly reading the short messages in the short message inbox of the mobile phone;
in this step, before the short messages in the short message inbox of the mobile phone are read circularly, the short messages in the short message inbox of the mobile phone need to be initialized, and the initially acquired short messages in the short message inbox of the mobile phone are written into the linked list.
And circularly reading the short messages in the short message inbox of the mobile phone, and comparing the short messages in the short message inbox read each time with the short messages in the linked list one by one. If the read short messages do not exist in the linked list, the newly received short messages are regarded as newly-added short messages.
It should be noted that, after each time the new short message is determined to be received, the new short message is stored at the tail of the linked list, so as to update the short message in the linked list, which is convenient for determining the new short message next time.
In specific implementation, the short messages in the short message inbox of the mobile phone are read at intervals of preset time, and in this embodiment, the preset time is 0.1s, which can be configured according to actual conditions.
S102: judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
in this step, the content in the newly added short message is matched in a regular expression manner, and if it is determined that the newly added short message contains a preset first specific content, the first specific content is used for determining that the short message is a verification short message, and may be a group of numbers, a group of symbols, or a mixture of numbers and symbols. When the newly added short message has the same content as the first specific content, the newly added short message is determined as a verification code short message; and when the newly added short message does not have the content which is the same as the first specific content, determining the newly added short message as a non-verification code short message.
And after the newly added short message is determined to be the verification code short message, matching second specific content preset in the verification code short message again in a regular expression mode, wherein the second specific content is used for positioning the verification code short message. The verification code in the verification code short message is extracted by determining second specific content in the verification code short message, specifically, the verification code in the verification code short message is extracted according to the front or back preset number of characters of the second specific content, and after the verification code is determined.
S103: and filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and the software.
In the step, when the automatic test is performed on the basis of the short message verification software, an automatic test program (Airtest) is used for performing the automatic test, when the automatic test program runs to a page where the short message verification code is obtained (other information is automatically filled in) and waits for the short message verification code to be obtained, the automatic test program Airtest recognizes and clicks a button for obtaining the short message verification code on the page by using a touch method, obtains the verification code which is obtained by calling a socket server interface and receiving the socket communication mode, positions a cursor to a short message verification code text box by using the touch method, fills the short message verification code into the short message verification code text box by using a text method, and performs the next test, thereby realizing the automatic test of the short message verification.
It is understood that AirTest: the method is a UI automation testing tool based on image recognition and PROC control recognition.
Socket: also known as "sockets," applications typically make requests to or respond to network requests through a "socket," which is used primarily for network communications.
the touch method comprises the following steps: the click event method provided by the AirTest automatic test tool is used for simulating the operation of a user clicking a button in an APP interface.
Text method: a text box filling method provided by an AirTest automatic test tool; the method is used for simulating the input of a user in an APP text box.
As can be seen from the above description, the test method based on short message verification software according to the embodiment of the present invention determines new short messages in the short message inbox by cyclically reading short messages in the short message inbox; judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message; the verification code is filled in a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and software, so that the short message verification code can be automatically acquired and filled in without modifying a background product code in a scene that the short message verification software needs to input the short message verification code, and the use range and the test efficiency of the automatic test are improved under the condition of simulating a real test scene to the maximum extent.
The embodiment of the invention provides a specific implementation manner of a short message verification software-based testing device capable of realizing all contents in the short message verification software-based testing method, and referring to fig. 2, the short message verification software-based testing device specifically comprises the following contents:
the new short message adding unit 10 is used for determining new short messages in the mobile phone short message inbox in a mode of circularly reading the short messages in the mobile phone short message inbox;
the verification code extracting unit 20 is configured to determine whether the newly added short message is a verification code short message, and extract a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and the verification code testing unit 30 is used for filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification based on the verification code and an automatic testing program of the software.
Wherein, the newly added short message unit 10 includes:
the newly-added short message subunit is used for comparing the short messages in the mobile phone short message inbox read each time with the short messages in the mobile phone short message inbox initially acquired one by one, and determining the short messages which do not exist in the short messages in the mobile phone short message inbox initially acquired in the short messages in the mobile phone short message inbox read each time; and the short messages which do not exist in the initially acquired short message inbox of the mobile phone are newly added short messages.
Wherein the verification code extracting unit 20 includes:
the first matching subunit is used for matching the content in the newly added short message in a regular expression mode and judging whether the newly added short message contains preset first specific content or not;
the new short message containing the preset first specific content is a verification code short message.
Wherein the verification code extracting unit 20 includes:
the second matching subunit is used for matching second specific content preset in the verification code short message in a regular expression mode;
and the extracting subunit is used for extracting the verification code in the verification code short message based on the second specific content.
The embodiment of the test device based on short message verification software provided by the invention can be specifically used for executing the processing flow of the embodiment of the test method based on short message verification software in the embodiment, the functions of the embodiment are not repeated herein, and reference can be made to the detailed description of the embodiment of the method.
As can be seen from the above description, the test device based on short message verification software according to the embodiment of the present invention determines new short messages in the short message inbox by cyclically reading short messages in the short message inbox; judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message; the verification code is filled in a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and software, so that the short message verification code can be automatically acquired and filled in without modifying a background product code in a scene that the short message verification software needs to input the short message verification code, and the use range and the test efficiency of the automatic test are improved under the condition of simulating a real test scene to the maximum extent.
The application provides an embodiment of an electronic device for implementing all or part of contents in the test method based on short message verification software, wherein the electronic device specifically comprises the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between related devices; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the electronic device may be implemented with reference to the embodiment for implementing the test method based on the short message verification software and the embodiment for implementing the test apparatus based on the short message verification software, which are incorporated herein, and repeated details are not repeated.
Fig. 3 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 3, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this FIG. 3 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the testing function based on the short message verification software may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
determining new short messages in the short message inbox by circularly reading the short messages in the short message inbox;
judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and the software.
As can be seen from the above description, the electronic device provided in the embodiment of the present application determines new short messages in the short message inbox of the mobile phone by cyclically reading the short messages in the short message inbox of the mobile phone; judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message; the verification code is filled in a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and software, so that the short message verification code can be automatically acquired and filled in without modifying a background product code in a scene that the short message verification software needs to input the short message verification code, and the use range and the test efficiency of the automatic test are improved under the condition of simulating a real test scene to the maximum extent.
In another embodiment, the testing device based on the short message verification software may be configured separately from the central processor 9100, for example, the testing device based on the short message verification software may be configured as a chip connected to the central processor 9100, and the testing function based on the short message verification software is realized by the control of the central processor.
As shown in fig. 3, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 3; further, the electronic device 9600 may further include components not shown in fig. 3, which may be referred to in the art.
As shown in fig. 3, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present invention further provides a computer-readable storage medium capable of implementing all steps in the test method based on short message verification software in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all steps of the test method based on short message verification software in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
determining new short messages in the short message inbox by circularly reading the short messages in the short message inbox;
judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and the software.
As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present invention determines new short messages in the short message inbox of the mobile phone by cyclically reading the short messages in the short message inbox of the mobile phone; judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message; the verification code is filled in a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and software, so that the short message verification code can be automatically acquired and filled in without modifying a background product code in a scene that the short message verification software needs to input the short message verification code, and the use range and the test efficiency of the automatic test are improved under the condition of simulating a real test scene to the maximum extent.
Although the present invention provides method steps as described in the examples or flowcharts, more or fewer steps may be included based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, apparatus (system) or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "upper", "lower", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience in describing the present invention and simplifying the description, but do not indicate or imply that the referred devices or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. Unless expressly stated or limited otherwise, the terms "mounted," "connected," and "connected" are intended to be inclusive and mean, for example, that they may be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention is not limited to any single aspect, nor is it limited to any single embodiment, nor is it limited to any combination and/or permutation of these aspects and/or embodiments. Moreover, each aspect and/or embodiment of the present invention may be utilized alone or in combination with one or more other aspects and/or embodiments thereof.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.

Claims (10)

1. A test method based on short message verification software is characterized by comprising the following steps:
determining newly-added short messages in a short message inbox of the mobile phone in a mode of circularly reading the short messages in the short message inbox of the mobile phone;
judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification by an automatic test program based on the verification code and the software.
2. The method as claimed in claim 1, wherein the determining of the newly added short message in the inbox by cyclically reading the short message in the inbox comprises:
comparing the short messages in the short message inbox read each time with the short messages in the short message inbox initially obtained one by one, and determining the short messages which do not exist in the short messages in the short message inbox initially obtained from the short messages in the short message inbox read each time; and the short messages which do not exist in the initially acquired short message inbox of the mobile phone are newly added short messages.
3. The short message verification software-based testing method of claim 1, wherein the determining whether the newly added short message is a verification code short message comprises:
matching the content in the newly added short message in a regular expression mode, and judging whether the newly added short message contains preset first specific content;
the new short message containing the preset first specific content is a verification code short message.
4. The method as claimed in claim 1, wherein the extracting the verification code in the verification code short message comprises:
matching second specific content preset in the verification code short message in a regular expression mode;
and extracting the verification code in the verification code short message based on the second specific content.
5. A testing device based on short message verification software is characterized by comprising:
the new short message unit is used for determining new short messages in the mobile phone short message inbox in a mode of circularly reading the short messages in the mobile phone short message inbox;
the verification code extracting unit is used for judging whether the newly added short message is a verification code short message or not, and extracting a verification code in the verification code short message after determining that the newly added short message is the verification code short message;
and the verification code testing unit is used for filling the verification code into a short message verification code text box for filling the short message verification code in the software test based on the short message verification based on the verification code and an automatic testing program of the software.
6. The short message verification software-based testing device as claimed in claim 5, wherein the newly added short message unit comprises:
the newly-added short message subunit is used for comparing the short messages in the mobile phone short message inbox read each time with the short messages in the mobile phone short message inbox initially acquired one by one, and determining the short messages which do not exist in the short messages in the mobile phone short message inbox initially acquired in the short messages in the mobile phone short message inbox read each time; and the short messages which do not exist in the initially acquired short message inbox of the mobile phone are newly added short messages.
7. The short message verification software-based testing device as claimed in claim 5, wherein the verification code extracting unit comprises:
the first matching subunit is used for matching the content in the newly added short message in a regular expression mode and judging whether the newly added short message contains preset first specific content or not;
the new short message containing the preset first specific content is a verification code short message.
8. The short message verification software-based testing device as claimed in claim 5, wherein the verification code extracting unit comprises:
the second matching subunit is used for matching second specific content preset in the verification code short message in a regular expression mode;
and the extracting subunit is used for extracting the verification code in the verification code short message based on the second specific content.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the short message verification software-based testing method according to any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the short message verification software-based testing method of any one of claims 1 to 4.
CN201911375184.9A 2019-12-27 2019-12-27 Test method and device based on short message verification software Pending CN111159035A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911375184.9A CN111159035A (en) 2019-12-27 2019-12-27 Test method and device based on short message verification software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911375184.9A CN111159035A (en) 2019-12-27 2019-12-27 Test method and device based on short message verification software

Publications (1)

Publication Number Publication Date
CN111159035A true CN111159035A (en) 2020-05-15

Family

ID=70556609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911375184.9A Pending CN111159035A (en) 2019-12-27 2019-12-27 Test method and device based on short message verification software

Country Status (1)

Country Link
CN (1) CN111159035A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120204091A1 (en) * 2011-02-04 2012-08-09 Oracle International Corporation Automated test tool interface
CN105101122A (en) * 2015-06-29 2015-11-25 安一恒通(北京)科技有限公司 Verification code inputting method and device
CN109726121A (en) * 2018-12-12 2019-05-07 北京云测信息技术有限公司 A kind of identifying code acquisition methods and terminal device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120204091A1 (en) * 2011-02-04 2012-08-09 Oracle International Corporation Automated test tool interface
CN105101122A (en) * 2015-06-29 2015-11-25 安一恒通(北京)科技有限公司 Verification code inputting method and device
CN109726121A (en) * 2018-12-12 2019-05-07 北京云测信息技术有限公司 A kind of identifying code acquisition methods and terminal device

Similar Documents

Publication Publication Date Title
CN109587252A (en) Loading method, device, electronic equipment and the storage medium of operator parameter
CN112463634B (en) Software testing method and device under micro-service architecture
CN110941563A (en) Automatic script testing method and device
US20170163787A1 (en) Method and electronic device for upgrading or downgrading system
WO2018176297A1 (en) Multi-window displaying apparatus and method and mobile electronic equipment
CN104811485A (en) Resource sharing method
CN113190229A (en) Method and device for generating government affair page
CN113342330A (en) Front-end engineering generation method and device
US20170168796A1 (en) Method and electronic apparatus for transferring application program from pc to mobile apparatus
CN113746840A (en) JSON format message generation method and device
CN110442416B (en) Method, electronic device and computer-readable medium for presenting information
CN112882685A (en) Object extension method and device of object-oriented programming language
CN111159035A (en) Test method and device based on short message verification software
CN113110829B (en) Multi-UI component library data processing method and device
CN113791984B (en) Automatic interface testing method and device
CN114637531A (en) Method and device for dynamically generating application program interface
CN110968383B (en) Message frame display method and device, terminal and storage medium
CN113641440A (en) Front-end multi-language display method and device
CN113050936A (en) Front-end data processing method and device based on integrated development environment
CN113672488A (en) Log text processing method and device
CN113360411A (en) Code coverage rate detection method and device based on parallel variation test
CN113050985A (en) Front-end engineering dependence automatic registration method and device
CN109150951B (en) Method and device for starting Activity of Android system
CN110955451B (en) Method and device for changing online interface
CN113419953A (en) Test data processing method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination