CN107291612B - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN107291612B
CN107291612B CN201610228255.2A CN201610228255A CN107291612B CN 107291612 B CN107291612 B CN 107291612B CN 201610228255 A CN201610228255 A CN 201610228255A CN 107291612 B CN107291612 B CN 107291612B
Authority
CN
China
Prior art keywords
service
message
result
terminal
server
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.)
Active
Application number
CN201610228255.2A
Other languages
Chinese (zh)
Other versions
CN107291612A (en
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.)
Ant Fortune Shanghai Financial Information Service Co ltd
Original Assignee
Advanced New Technologies Co 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201610228255.2A priority Critical patent/CN107291612B/en
Publication of CN107291612A publication Critical patent/CN107291612A/en
Application granted granted Critical
Publication of CN107291612B publication Critical patent/CN107291612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The embodiment of the application provides a testing method and a testing device, in the method, when a tester conducts a page test, a terminal can send a service message to an analog server, after the analog server receives the service message, the analog server extracts specific content in the service message, determines a result message matched with the service message, and returns the result message to the terminal, so that the terminal can test whether a service corresponding to the service message is normal or not according to the result message. Because the simulation server can return corresponding result messages according to different specific contents, a tester does not need to set the result messages to be returned in the simulation server before testing, and the simulation server can also return the result messages corresponding to the service messages to the terminals after the plurality of terminals send the service messages to the simulation server respectively, so that the requirement that the plurality of testers use one simulation server to test the page is met, and convenience is brought to the page testing work of the testers.

Description

Test method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a test method and apparatus.
Background
In order to meet the daily life requirements of people, various online platforms provide various business services for people, so that people can solve the problems in practice in the online platforms in a business processing mode, the capacity of people for solving the practical problems is greatly improved, and the online platforms are believed to continuously enrich and perfect various businesses along with the continuous development of network technology, and bring more convenience to people.
In order to enable a user to better enjoy service provided by an online platform, a tester of the online platform generally needs to test each service to verify whether each service can normally operate, wherein page testing is an important link for testing, so that when performing page testing currently, a virtual server (the virtual server is a virtual server specially used for page testing) can be preset in advance, a return result for a specific test object is preset in the virtual server according to content to be tested, and corresponding testing work is completed in a subsequent process.
For example, if a tester wants to test a case where a transfer failure occurs during a process of transferring 5GB of data from a terminal to a virtual cloud disk (i.e., the above-mentioned virtual server) by a user a (the user is not a real user and may be a user dedicated to testing), a return result may be set in the virtual cloud disk in advance, that is, when the user a transfers 5GB of data from the terminal to the virtual cloud disk, a result of the transfer failure is returned to the terminal, therefore, when testing, the tester can log in the virtual cloud disk through the account number of the user A, and then, selecting corresponding data transfer service in an operation interface returned by the virtual cloud disk to the terminal, determining 5GB data to be transferred according to prompt information displayed by the operation interface, and then sending the 5GB data to the virtual cloud disk after executing the determination operation. And after monitoring the series of operations of the tester, the terminal can generate a service request for correspondingly transferring the 5GB data stored by the user A at the terminal to the virtual cloud disk, and sends the service request and the 5GB data to be transferred by the tester to the virtual cloud disk, and after receiving the service request, the virtual cloud disk can return a transfer failure result to the terminal according to a preset return result, so that the terminal displays the transfer failure result to the tester, and the tester can determine that the execution process of the data transfer service of the current online platform is in a normal state according to the test result. After the testing personnel complete the testing work, the returned result preset in the virtual cloud disk needs to be modified back to the preset normal result, so that other testing personnel can use the result conveniently.
However, in the above-described testing method, before the tester performs a test, it is necessary to set a return result for a specific test object in the virtual server in advance, and then the test can be performed, and after the test is completed, the return result set in the virtual server is restored to a preset normal result, which increases the complexity of the testing process and brings inconvenience to the tester. In addition, because each tester usually shares one virtual server to perform testing, when one tester sets a result to be returned in the virtual server in advance and uses the virtual server to perform testing, because the result returned in the virtual server is modified at this time, other users cannot test the content to be tested according to the returned result, and therefore other testers cannot usually use the virtual server to perform testing in the process, thereby further bringing inconvenience to the testing work of the testers.
Disclosure of Invention
The embodiment of the application provides a testing method and device, which are used for solving the problem that in the prior art, when a tester conducts a page test, the process of the page test brings inconvenience to the tester.
The test method provided by the embodiment of the application comprises the following steps:
receiving a service message sent by a terminal;
extracting specific content in the service message;
determining a result message matched with the specific content according to the specific content;
and returning the result message to the terminal, so that the terminal tests whether the service corresponding to the service message is normal or not according to the result message.
The test method provided by the embodiment of the application comprises the following steps:
sending a service message to a simulation server, so that the simulation server extracts specific content in the service message after receiving the service message, and returns a determined result message matched with the specific content to the terminal;
receiving the result message returned by the simulation server;
and testing whether the service corresponding to the service message is normal or not according to the result message.
The device of test that this application embodiment provided includes:
the receiving module is used for receiving a service message sent by a terminal;
the extracting module is used for extracting the specific content in the service message;
the determining module is used for determining a result message matched with the specific content according to the specific content;
and the return module is used for returning the result message to the terminal, so that the terminal tests whether the service corresponding to the service message is normal or not according to the result message.
The device of test that this application embodiment provided includes:
the sending module is used for sending the service message to the simulation server, so that the simulation server extracts the specific content in the service message after receiving the service message, and returns the determined result message matched with the specific content to the device;
the receiving module is used for receiving the result message returned by the simulation server;
and the testing module is used for testing whether the service corresponding to the service message is normal or not according to the result message.
The embodiment of the application provides a testing method and a testing device, in the method, when a tester conducts a page test, a service message can be sent to a simulation server through a terminal, after the simulation server receives the service message, specific content in the service message can be extracted, a result message matched with the service message is determined, and the result message is returned to the terminal, so that the terminal can test whether a service corresponding to the service message is normal or not according to the result message. It can be seen from the above method that, because the simulation server can return the result message corresponding to the specific content for different specific contents, the tester does not need to manually set the result message to be returned in the simulation server in advance before testing, and because the simulation server can determine the result message to be returned to the terminal according to the specific content in the service message, even if a plurality of terminals send the service message to the simulation server respectively, the simulation server can return the result message corresponding to each specific content to each terminal respectively according to the specific content in each service message, therefore, the requirement that a plurality of testers use one simulation server to perform page testing at the same time is met, and convenience is brought to the testers during page testing work.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a process of testing provided by embodiments of the present application;
FIG. 2 is a process of testing provided by embodiments of the present application;
FIG. 3 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. 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 application.
Fig. 1 is a process of testing provided in the embodiment of the present application, which specifically includes the following steps:
s101: and receiving a service message sent by the terminal.
In practical application, in order to maintain each service of the online platform, a tester usually needs to test each service to find out the problems that will occur in the execution process of each service, wherein, because page testing is an important link in testing, the tester usually needs to test the page that can be displayed in the execution process of each service, that is, when the tester performs page testing on a certain service, the tester can send a service message for testing to the simulation server through the terminal, correspondingly, the simulation server also receives the service message sent by the terminal, and then returns a result message to the terminal in the subsequent process, so that the terminal tests whether the service will have problems in execution according to the result message, wherein, because the processing work of some services in the online platform may be completed by the servers of other online platforms, generally, when testing such services, a tester cannot use a server of another online platform to perform testing operations at will, and therefore, in order to meet the testing requirements of the tester, the tester may preset a simulation server, such as Mock, which is the same as a real server (the real server is a server of another online platform), and service codes and service execution logics used by the simulation server are the same as those of a real service processing server, so that the tester can complete some testing operations for the real service processing server through the simulation server.
Specifically, in the prior art, when a tester performs a test, the tester usually needs to simulate various operations of a user during service processing to complete the whole test, so that the complexity in the test process is increased, and inconvenience is brought to the tester during the process of performing a page test. In order to avoid this situation, in this embodiment of the present application, a tester may write a test script in advance, and the terminal runs the test script, so that after the terminal runs the test script, a service packet for a certain service page test is generated, and then in a subsequent process, the terminal sends the service packet to the simulation server. Because the terminal can replace the tester to complete a series of operations related to the test work when the test script is operated, the complexity of the tester in the process of testing the page is greatly reduced, and convenience is brought to the tester.
For example, if a tester wants to test whether the data transfer service of the online platform can be normally executed, a test object user B (which may be a test object specially used for testing, but not necessarily a real user) and a transferred data volume of 3GB may be determined, and then a test script for the test is written according to an actual data transfer service flow, and the test script is run through a terminal. When the terminal runs the test script, a series of service operations related to the data transfer service can be completed by corresponding replacement test personnel, so that a service message is correspondingly generated, and the service message is further sent to the simulation server in the subsequent process.
It should be noted that the above-mentioned test Script may be a javascript Script written by a tester, and certainly, may also be other scripts such as VB Script, and only needs to ensure that the terminal can smoothly run the Script and generate a corresponding service message.
In practical applications, some services in the online platform need to be supported by servers of other online platforms, and usually also need a local server of the online platform to complete certain processing, that is, in general, after receiving a service request of a user, the online platform may first perform certain service processing in the local server, and then send the service request to servers of other online platforms to complete subsequent processing of the service. Therefore, when testing such services, a tester may also write a test script in advance, and run the test script by the terminal, and when the terminal runs the test script and generates a service message, the service message may be sent to the service server (i.e., the above-mentioned local server of the online platform), and since the service server can only partially process the service message, after receiving the service message, the service server may forward the service message to the simulation server, which is equivalent to the simulation server receiving the service message sent by the terminal through the service server, and then completing the whole testing work through the subsequent steps S102 to S104. Of course, when the service server determines that the service message cannot be processed after receiving the service message sent by the terminal, the service server may also directly send the service message to the simulation server.
S102: and extracting specific content in the service message.
According to the embodiment of the application, when a tester conducts a page test, a return result aiming at a specific test object does not need to be set in the simulation server in advance, so that when the tester establishes the simulation server, a large number of result messages can be stored in the simulation server in advance, wherein each result message can correspond to specific content in one or more service messages, and therefore when the follow-up tester conducts the page test by using the simulation server, the simulation server can determine the result message matched with the specific content according to the specific content in the service messages sent by the terminal, and then the result message is returned to the terminal. Therefore, in the embodiment of the present application, after receiving the service packet sent by the terminal, the simulation server may analyze the service packet according to a preset extraction rule to determine which fields in the service packet will include specific content, then extract the specific content from the determined fields, and further determine a result packet matching the specific content through the subsequent step S103.
For example, continuing to use the above example, after the simulation server receives the service packet sent by the terminal, the simulation server may parse the service packet and determine that the specific content of the service packet is "user B, transfer 3GB data", and then, in subsequent step S103, determine the result packet matching the specific content according to the specific content "user B, transfer 3 GB".
S103: and determining a result message matched with the specific content according to the specific content.
In the embodiment of the application, the simulation server can determine which result message to return to the terminal according to the specific content in the received service message, so that a tester does not need to set a result to be returned in the simulation server in advance, and convenience is brought to the test work of the tester, therefore, after the simulation server determines the specific content contained in the service message, the result message matched with the specific content can be determined according to the result message stored in advance and the mapping relation between the result message and the specific content, and then the result message is returned to the terminal in the subsequent step S104.
Continuing with the above example, when the simulation server determines that the specific content "user B, after transferring data 3 GB" in the service message, the result message matching the specific content can be determined according to the preset mapping relationship table of the specific content and the result message, as shown in table 1.
Figure BDA0000964257040000071
TABLE 1
As can be seen from table 1, if the result message matched with the determined specific content "user B, transfer data 3 GB" is "transfer failure", the simulation server can find the result message "transfer failure" from a large number of pre-stored messages, and then return the result message "transfer failure" to the terminal in the subsequent process.
S104: and returning the result message to the terminal, so that the terminal tests whether the service corresponding to the service message is normal or not according to the result message.
Because the terminal needs to test whether the service corresponding to the previously sent service message is normal according to the result message returned by the simulation server, the simulation server can correspondingly return the result message to the terminal after determining the result message which needs to be returned to the terminal, and for the case that the service server (i.e. the local server of the online platform) is involved in the test process, the simulation server can firstly return the result message to the service server after determining the result message which is returned to the terminal, and then the service server returns the result message to the terminal, wherein the service server can firstly carry out certain processing on the result message and then returns the processed result message (such as a page) to the terminal, and can also directly return the result message to the terminal, so that after the terminal receives the result message, and testing whether the service corresponding to the service message is normal or not according to the result message.
It can be seen from the above method that, because the simulation server can extract the specific content from the service message sent by the terminal, and determine the result message matched with the specific content from the large number of result messages saved in advance according to the specific content, it is not necessary for the tester to set the result to be returned in the simulation server in advance before starting the test work, and because the simulation server can determine the result message to be returned to the terminal according to the specific content in the service message, even if a plurality of testers send their respective service messages to the simulation server through the terminal at the same time, the simulation server can return the result message corresponding to their respective service messages to their respective terminals according to the specific content in their respective service messages, thereby satisfying the requirement that a plurality of testers use one simulation server to perform the page test at the same time, therefore, convenience is brought to the testers when the page testing work is carried out.
After receiving the result message returned by the simulation server, the terminal needs to test whether the service corresponding to the previously sent service message is normal according to the result message, and for clarity, it is explicitly described how the terminal tests whether the service corresponding to the previously sent service message is normal according to the result message, which will be described in detail below.
Fig. 2 is a process of testing provided in the embodiment of the present application, which specifically includes the following steps:
s201: and sending the service message to a simulation server, so that the simulation server extracts the specific content in the service message after receiving the service message, and returns the determined result message matched with the specific content to the terminal.
When a tester performs a page test on a certain service of an online platform, a test script for performing the page test can be compiled in advance, and the test script is run through a terminal, and when the terminal runs the test script, the terminal can replace the tester to complete a series of test operations and correspondingly generate a service message for testing the service, and then the terminal can send the service message to a simulation server, so that the simulation server determines a result message matched with specific content in the service message after receiving the service message. The simulation server mentioned here is a server dedicated to testing, that is, a server built by simulating real servers of other online platforms.
It should be noted that, in practical applications, some services in the online platform need to be supported by servers of other online platforms, and usually also need a local server of the online platform to complete certain processing, so for this case, after the terminal runs the test script and generates the service message, the terminal may send the service message to the service server (i.e., the local server of the online platform) first, and then the service server sends the service message to the simulation server, where after receiving the service message sent by the terminal, the service server may first perform certain processing on the service message and then send the service message to the simulation server, and of course, after receiving the service message sent by the terminal, the service server may also directly send the service message to the simulation server, the specific process is the same as step S101 in fig. 1, and will not be described in detail herein.
S202: and receiving the result message returned by the simulation server.
After receiving a service message sent by a terminal, an analog server can extract specific content from the service message, and then determine a result message matched with the specific content according to the specific content, and then, because the terminal needs to test whether a service corresponding to the previously sent service message is normal according to the result message returned by the analog server, the analog server can return the determined result message to the terminal, and correspondingly, the terminal also receives the result message returned by the analog server.
For the case that the test process involves the service server, the simulation server may return the result message to the service server after determining the result message, and then the service server returns the result message to the terminal, wherein when the service server receives the result message returned by the simulation server, the service server may first perform a certain processing on the result message, and then return the processed result message (e.g., page) to the terminal, and of course, the simulation server may also directly return the result message to the terminal after receiving the result message returned by the simulation server.
S203: and testing whether the service corresponding to the service message is normal or not according to the result message.
The terminal needs to judge whether the service currently being tested has a problem according to the result message returned by the simulation server, so that after receiving the result message returned by the simulation server, the terminal can determine the data information in the result message first, and then can compare the data information with the preset data information, wherein the preset data information can be the data information which should be returned to the terminal by other online platform servers when the tested service is actually and correctly executed, and can also be written by a tester in advance according to the execution logic of the service, the correct service code and the like. When finding that the data information determined from the result message is different from the preset data information, the terminal can test that a problem exists in the service (namely, the currently tested service) corresponding to the previously sent service message, namely, the service cannot be normally executed in the actual execution process; and when the terminal finds that the data information determined from the result message is the same as the preset data information, the terminal can test that the currently tested service can be normally executed, namely, the service does not have problems when actually executing the service processing with the same content as the tested content.
In addition to the above-described manner of testing whether the currently tested service is normal by comparing the data information in the result message, in the embodiment of the present application, the terminal may also test whether the currently tested service is normal according to the page generated by the result message. Specifically, after the terminal receives the result message returned by the simulation server, the page corresponding to the result message can be generated according to the data information contained in the result message, wherein, the page usually includes blocks, some of which display some characters, some display some pictures, and some display some option buttons at some positions, therefore, in order to test whether the current tested service is normal, corresponding text information can be extracted from a specific block displaying the character part in the page, and then the text information can be compared with preset text information, the preset text information may be text information preset by a tester according to a correct service execution logic and a service code, or text information in a page displayed when a currently tested service correctly executes service processing with the same content as the currently tested content in practice. When the terminal finds that the text information extracted from the generated page is the same as the preset text information in the current test process, the terminal can test that no problem occurs in the actual execution process of the currently tested service, namely, the service can be normally executed when the service processing with the same content as the current test content is executed; when the terminal finds that the text information extracted from the generated page is different from the preset text information, the terminal can test that the problem occurs in the actual execution process of the currently tested service, namely, the service cannot be normally executed when the service processing with the same content as the currently tested content is actually executed.
In the service processing process, in addition to the other online platform servers (i.e., the real servers corresponding to the simulation servers), the online platform local servers (i.e., the above-mentioned service servers) are involved, and in practical applications, because the servers of the other online platforms and the local servers of the online platforms have differences in terms of service codes, service logics, and the like, in general, after the service server receives a result message returned to the terminal by the other online platform servers, the data information in the result message needs to be translated, and then, according to the data information in the translated result message, a page corresponding to the result message is generated and returned to the terminal. Therefore, when a tester performs a page test, the tester can receive a page returned by a service server (namely, a local server of an online platform) through a terminal, extract text information from a specific block in the page, and then the terminal can compare the extracted text information with preset text information, wherein when the terminal finds that the text information and the text information are consistent, the tester can correspondingly test that no problem occurs in the process of translating a result message of the currently tested service, and correspondingly, no problem occurs when the service actually executes service processing with the same content as the currently tested service; when the terminal finds that the two are inconsistent, the terminal can test that the currently tested service has problems in the translation process of the result message, and correspondingly, the service may have problems when actually executing the service processing with the same content as the currently tested content.
Of course, in addition to the above-described manner of testing whether the currently tested service is normal through the data information in the result message and the page generated according to the data information, the terminal may also perform the test in the form of a log, that is, after receiving the result message returned by the simulation server, the terminal may generate a corresponding log according to the result message and compare the log with a preset log, so as to test whether the currently tested service is normal, or after receiving the page returned by the service server, the terminal may generate a corresponding log for the page and compare the log with the preset log, so as to test whether the currently tested service is normal.
According to the method, the simulation server can extract the specific content from the service message sent by the terminal, and the result message matched with the specific content is determined from a large number of result messages stored in advance according to the specific content, so that a tester does not need to set a result to be returned in the simulation server in advance before starting test work, and the terminal can automatically complete final test work according to the result message instead of the tester after receiving the result message returned by the simulation server, namely, the tester does not need to test whether the currently tested service is normal according to the result message received by the terminal, and great convenience is brought to the test work performed by the tester.
It should be noted that, in step S203, after the terminal generates the page corresponding to the result message according to the result message returned by the simulation server, whether the currently tested service is normal may also be tested by determining the similarity between the page and the preset page. Specifically, after the terminal generates the page corresponding to the result message, the terminal may compare the page with a preset page, and when the similarity between the two pages reaches a preset threshold, it may be tested that the currently tested service can be normally executed, and when the similarity between the two pages does not reach the preset threshold, it may be tested that the currently tested service cannot be normally executed, that is, the service may have a problem when executing the service processing with the same content as the test content in practice.
The method can be used for various page testing scenarios such as data transfer service, payment service, ticket booking service, etc., for example, for the payment service, a third party server is usually involved, that is, the capital operation involved in the payment service processing of the online platform is actually completed by the bank, but since the bank server (i.e., the third party server) is usually very important, the tester of the online platform can not use the bank server to test at will when testing for the payment service, therefore, in order to meet the testing requirement of the tester, a simulation server similar to the bank server, such as Mock, etc., can be established in advance, wherein the simulation server and the bank server can be the same in terms of service code, service logic, etc., so that, because the simulation server can represent the bank server to a certain extent, the testing accuracy can be met to a certain extent by testing personnel based on the simulation server.
When a tester performs a page test on the payment service of the online platform, a test script for the payment service can be written in advance and input into the terminal, after the terminal runs the test script, a series of test operations can be completed instead of the tester according to the content in the test script, so that a service message corresponding to the currently tested payment service is generated and sent to a service server (i.e. a local server of the online platform for the payment service), after the service server receives the service message, the service message can be sent to an analog server (i.e. an analog server corresponding to a bank server), when the analog server receives the service message, the specific content contained in the service message can be determined correspondingly, and according to the specific content, determining a result message matched with the specific content from a large number of prestored result messages, and then returning the result message to the service server, after receiving the result message, the service server can directly return the result message to the terminal, so that in the subsequent process, testing whether the payment service corresponding to the service message sent previously is normal or not according to the result message, of course, after receiving the result message returned by the simulation server, the service server may also perform certain processing on the result message (e.g., translate the data information in the result message), and then, returning the result message or the page generated according to the result message to the terminal, so that the terminal can test whether the payment service corresponding to the previously sent service message is normal or not according to the result message or the page in the subsequent process.
Based on the same idea, the method for testing provided by the embodiment of the present application further provides a device for testing, as shown in fig. 3 and 4.
Fig. 3 is a schematic structural diagram of a testing apparatus provided in an embodiment of the present application, which specifically includes:
a receiving module 301, configured to receive a service packet sent by a terminal;
an extracting module 302, configured to extract specific content in the service message;
a determining module 303, configured to determine, according to the specific content, a result packet matched with the specific content;
a returning module 304, configured to return the result packet to the terminal, so that the terminal tests whether a service corresponding to the service packet is normal according to the result packet.
The receiving module 301 is specifically configured to receive a service packet sent by the terminal through a service server, where the service packet is sent to the service server after the terminal runs a test Script, and the test Script is a javascript Script.
The returning module 304 is specifically configured to return the result packet to the terminal through the service server.
Fig. 4 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure.
A sending module 401, configured to send a service packet to an analog server, so that after receiving the service packet, the analog server extracts a specific content in the service packet, and returns a determined result packet matching the specific content to the device;
a receiving module 402, configured to receive the result packet returned by the simulation server;
the testing module 403 is configured to test whether a service corresponding to the service packet is normal according to the result packet.
The sending module 401 is specifically configured to run a test Script to generate a service packet, where the test Script is a javascript Script; and sending the service message to the simulation server through a service server.
The test module 403 is specifically configured to determine data information included in the result message; comparing the data information with preset data information to obtain a comparison result; and testing whether the service corresponding to the service message is normal or not according to the comparison result.
The test module 403 is specifically configured to determine data information included in the result message; generating a page corresponding to the result message according to the data information; extracting text information of a specific block in the page; comparing the text information with preset text information to obtain a comparison result; and testing whether the service corresponding to the service message is normal or not according to the comparison result.
The embodiment of the application provides a testing method and a testing device, in the method, when a tester conducts a page test, a service message can be sent to a simulation server through a terminal, after the simulation server receives the service message, specific content in the service message can be extracted, a result message matched with the service message is determined, and the result message is returned to the terminal, so that the terminal can test whether a service corresponding to the service message is normal or not according to the result message. It can be seen from the above method that, because the simulation server can return the result message corresponding to the specific content for different specific contents, the tester does not need to manually set the result message to be returned in the simulation server in advance before testing, and because the simulation server can determine the result message to be returned to the terminal according to the specific content in the service message, even if a plurality of terminals send the service message to the simulation server respectively, the simulation server can return the result message corresponding to each specific content to each terminal respectively according to the specific content in each service message, therefore, the requirement that a plurality of testers use one simulation server to perform page testing at the same time is met, and convenience is brought to the testers during page testing work.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A method for testing, wherein the method is used for page testing, and comprises the following steps:
receiving a service message which is sent by a terminal and used for page testing;
extracting specific content in the service message, wherein the specific content comprises a user name and data transfer amount;
determining a result message matched with the specific content according to the specific content;
returning the result message to the terminal or returning the result message to a service server, processing the result message by the service server and returning the processed result message to the terminal, so that the terminal tests whether the service corresponding to the service message is normal or not according to the result message;
wherein determining the result message matched with the specific content comprises:
and determining a result message matched with the specific content from result messages prestored by the simulation server according to the mapping relation between the specific content and the result message.
2. The method of claim 1, wherein receiving the service packet sent by the terminal specifically includes:
and receiving a service message sent by the terminal through a service server, wherein the service message is sent to the service server after the terminal runs a test Script, and the test Script is a Java Script.
3. The method of claim 2, wherein returning the result message to the terminal specifically comprises:
and returning the result message to the terminal through the service server.
4. A method for testing, wherein the method is used for page testing, and comprises the following steps:
sending a service message for page testing to a simulation server, so that the simulation server extracts specific content in the service message after receiving the service message, and returns a determined result message matched with the specific content to a terminal, or the simulation server returns a determined result message matched with the specific content to the service server, and the service server processes the result message and returns the processed result message to the terminal; wherein the specific content comprises a user name and a data transfer amount;
receiving the result message;
testing whether the service corresponding to the service message is normal or not according to the result message;
wherein, the simulation server determines that the result message matched with the specific content comprises:
and the simulation server determines a result message matched with the specific content from result messages prestored by the simulation server according to the mapping relation between the specific content and the result message.
5. The method of claim 4, wherein sending the service packet to the simulation server specifically comprises:
running a test Script to generate a service message, wherein the test Script is a Java Script;
and sending the service message to the simulation server through a service server.
6. The method according to claim 4, wherein testing whether the service corresponding to the service packet is normal according to the result packet specifically comprises:
determining data information contained in the result message;
comparing the data information with preset data information to obtain a comparison result;
and testing whether the service corresponding to the service message is normal or not according to the comparison result.
7. The method according to claim 4, wherein testing whether the service corresponding to the service packet is normal according to the result packet specifically comprises:
determining data information contained in the result message;
generating a page corresponding to the result message according to the data information;
extracting text information of a specific block in the page;
comparing the text information with preset text information to obtain a comparison result;
and testing whether the service corresponding to the service message is normal or not according to the comparison result.
8. An apparatus for testing, wherein the apparatus is used for page testing, comprising:
the receiving module is used for receiving a service message which is sent by the terminal and used for page testing;
the extracting module is used for extracting specific content in the service message, wherein the specific content comprises a user name and data transfer amount;
the determining module is used for determining a result message matched with the specific content according to the specific content;
a return module, configured to return the result packet to the terminal, or return the result packet to a service server, where the service server processes the result packet and returns the processed result packet to the terminal, so that the terminal tests, according to the result packet, whether a service corresponding to the service packet is normal or not
Wherein determining the result message matched with the specific content comprises:
and determining a result message matched with the specific content from result messages prestored by the simulation server according to the mapping relation between the specific content and the result message.
9. The apparatus according to claim 8, wherein the receiving module is specifically configured to receive a service packet sent by the terminal through a service server, where the service packet is sent to the service server after the terminal runs a test Script, and the test Script is a javascript Script.
10. The apparatus according to claim 9, wherein the returning module is specifically configured to return the result packet to the terminal through the service server.
11. An apparatus for testing, wherein the apparatus is used for page testing, comprising:
a sending module, configured to send a service packet for page testing to a simulation server, so that after receiving the service packet, the simulation server extracts a specific content in the service packet and returns a determined result packet matching the specific content to the device, or the simulation server returns a determined result packet matching the specific content to the service server, and the service server processes the result packet and returns the processed result packet to the device; wherein the specific content comprises a user name and a data transfer amount;
a receiving module, configured to receive the result packet;
the test module is used for testing whether the service corresponding to the service message is normal or not according to the result message;
wherein, the simulation server determines that the result message matched with the specific content comprises:
and the simulation server determines a result message matched with the specific content from result messages prestored by the simulation server according to the mapping relation between the specific content and the result message.
12. The apparatus according to claim 11, wherein the sending module is specifically configured to run a test Script to generate the service packet, wherein the test Script is a javascript Script; and sending the service message to the simulation server through a service server.
13. The apparatus of claim 11, wherein the testing module is specifically configured to determine data information contained in the result message; comparing the data information with preset data information to obtain a comparison result; and testing whether the service corresponding to the service message is normal or not according to the comparison result.
14. The apparatus of claim 11, wherein the testing module is specifically configured to determine data information contained in the result message; generating a page corresponding to the result message according to the data information; extracting text information of a specific block in the page; comparing the text information with preset text information to obtain a comparison result; and testing whether the service corresponding to the service message is normal or not according to the comparison result.
CN201610228255.2A 2016-04-13 2016-04-13 Test method and device Active CN107291612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610228255.2A CN107291612B (en) 2016-04-13 2016-04-13 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610228255.2A CN107291612B (en) 2016-04-13 2016-04-13 Test method and device

Publications (2)

Publication Number Publication Date
CN107291612A CN107291612A (en) 2017-10-24
CN107291612B true CN107291612B (en) 2021-01-05

Family

ID=60093770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610228255.2A Active CN107291612B (en) 2016-04-13 2016-04-13 Test method and device

Country Status (1)

Country Link
CN (1) CN107291612B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101430B (en) * 2018-08-24 2022-08-09 创新先进技术有限公司 Test method, device and equipment
CN110912856A (en) * 2018-09-14 2020-03-24 千寻位置网络有限公司 Non-invasive mock payment method and system, payment server and mock server
CN111382062B (en) * 2018-12-30 2023-09-15 贝壳技术有限公司 Joint debugging test method and device for real estate transaction system and external institution business system
CN110162464A (en) * 2019-04-19 2019-08-23 平安普惠企业管理有限公司 Mcok test method and system, electronic equipment and readable storage medium storing program for executing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621456A (en) * 2008-06-30 2010-01-06 华为技术有限公司 Method and system for signaling treatment among internal nodes of network
CN105095061A (en) * 2014-04-21 2015-11-25 阿里巴巴集团控股有限公司 Page test method and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005222130A (en) * 2004-02-03 2005-08-18 Hitachi Ltd Program managing method, execution device, and processing program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621456A (en) * 2008-06-30 2010-01-06 华为技术有限公司 Method and system for signaling treatment among internal nodes of network
CN105095061A (en) * 2014-04-21 2015-11-25 阿里巴巴集团控股有限公司 Page test method and equipment

Also Published As

Publication number Publication date
CN107291612A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN107957957B (en) Test case obtaining method and device
US10013416B1 (en) Language based solution agent
CN111177005B (en) Service application testing method, device, server and storage medium
CN107291612B (en) Test method and device
CN109033772B (en) Verification information input method and device
CN108572823B (en) Front-end and back-end development management method and system based on interface engine
CN108427731B (en) Page code processing method and device, terminal equipment and medium
CN109901968A (en) A kind of automation page data method of calibration and device
CN108363634B (en) Method, device and equipment for identifying service processing failure reason
US10331947B2 (en) Automatic detection on string and column delimiters in tabular data files
CN110955409B (en) Method and device for creating resources on cloud platform
CN105100029A (en) Method and device for user identity verification
CN111435367A (en) Knowledge graph construction method, system, equipment and storage medium
CN108809896A (en) A kind of information calibration method, device and electronic equipment
CN106547658B (en) Automatic testing method and device
US9501390B1 (en) Enhancing automated mobile application testing
CN106990974B (en) APP updating method and device and electronic equipment
CN107016028B (en) Data processing method and apparatus thereof
CN113408254A (en) Page form information filling method, device, equipment and readable medium
JP6563001B2 (en) System and method for detecting and alerting to risks in replenishment transactions
CN110781191B (en) Processing method of layout data and server
CN115237810A (en) Test data construction method, text sending test method, device, equipment and medium
CN114218098A (en) Software system testing method and device, computer equipment and readable storage medium
CN116541626A (en) Service data consistency detection method, device and equipment
CN112948219A (en) Link tracking method and device

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
TA01 Transfer of patent application right

Effective date of registration: 20201014

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201014

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220425

Address after: Room 602, No. 618 Wai Road, Huangpu District, Shanghai

Patentee after: Ant fortune (Shanghai) Financial Information Service Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Innovative advanced technology Co.,Ltd.

TR01 Transfer of patent right