CN111352832B - Method and device for automatically testing page - Google Patents

Method and device for automatically testing page Download PDF

Info

Publication number
CN111352832B
CN111352832B CN202010111332.2A CN202010111332A CN111352832B CN 111352832 B CN111352832 B CN 111352832B CN 202010111332 A CN202010111332 A CN 202010111332A CN 111352832 B CN111352832 B CN 111352832B
Authority
CN
China
Prior art keywords
page
test
rule
data
condition
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
CN202010111332.2A
Other languages
Chinese (zh)
Other versions
CN111352832A (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.)
Tencent Technology Chengdu Co Ltd
Original Assignee
Tencent Technology Chengdu 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 Tencent Technology Chengdu Co Ltd filed Critical Tencent Technology Chengdu Co Ltd
Priority to CN202010111332.2A priority Critical patent/CN111352832B/en
Publication of CN111352832A publication Critical patent/CN111352832A/en
Application granted granted Critical
Publication of CN111352832B publication Critical patent/CN111352832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a method and a device for automatically testing pages. The method comprises the steps of obtaining activity configuration data of a page, obtaining function points of the page based on the activity configuration data, generating test cases of the page based on the function points, generating test data based on the test cases, executing the test cases based on the test data to test the page, and obtaining a test result. According to the method, the function points of the page are automatically obtained based on the activity configuration data by obtaining the activity configuration data of the page, and the function points of the page are automatically tested, so that the page is automatically tested, a test result is automatically obtained, a process of manual participation is omitted, and the test efficiency is improved.

Description

Method and device for automatically testing page
Technical Field
The present application relates to the field of computers and communications technologies, and in particular, to a method and an apparatus for automatically testing a page.
Background
With the continuous development of internet technology, the demands of various network application software are becoming more and more extensive, and correspondingly, various different kinds of software are also being continuously developed and applied. In order for software developers to ensure the reliability of software, the software needs to be tested in detail and comprehensively before the software is marketed.
Currently, in practical applications, a developer usually interprets the content of a software source code and manually tests the software. But this test method is extremely inefficient.
Disclosure of Invention
The application aims to provide a method and a device for automatically testing pages, which can improve the efficiency of page testing.
According to one aspect of the embodiment of the application, there is provided a method for automatically testing a page, including: acquiring activity configuration data of a page; obtaining a function point of the page based on the activity configuration data; generating a test case of the page based on the function point; generating test data based on the test cases; and executing the test case based on the test data to test the page, thereby obtaining a test result.
According to an aspect of an embodiment of the present application, there is provided an apparatus for automatically testing a page, including: the acquisition module is used for acquiring the activity configuration data of the page and acquiring the function points of the page based on the activity configuration data; the generating module is used for generating test cases of the page based on the function points and generating test data based on the test cases; and the execution module is used for executing the test case based on the test data to test the page so as to obtain a test result.
In some embodiments of the present application, based on the foregoing scheme, the acquiring module is configured to: and acquiring the identification of the page, and searching an active configuration database based on the identification of the page to obtain the active configuration data of the page.
In some embodiments of the application, based on the foregoing scheme, the acquisition module is further configured to: and searching keywords in the activity configuration data, and obtaining function points corresponding to the keywords based on the keywords and a preset keyword and function point comparison table.
In some embodiments of the application, based on the foregoing scheme, the generating module is configured to: analyzing the function points to obtain a rule set of the function points; and generating the test case based on the rule set of the function point.
In some embodiments of the application, based on the foregoing scheme, the generating module is further configured to: the rule set of the function points comprises a multi-condition relation of the function points; acquiring conditions related to the multi-condition relation, and combining the related conditions based on the multi-condition relation to obtain a multi-condition combination; and generating the test case based on the multi-condition combination.
In some embodiments of the application, based on the foregoing scheme, the generating module is further configured to: the rule set of function points further includes: qualification, condition, action of the function point; and respectively generating the test cases based on the qualification, the condition, the multi-condition relation and the action of the functional points.
In some embodiments of the application, based on the foregoing scheme, the generating module is further configured to: obtaining a multi-interface relation of the function points based on the function points; acquiring interfaces related to the multi-interface relationship; combining the related interfaces based on the multi-interface relation to obtain a multi-interface combination; and generating the test case based on the multi-interface combination.
In some embodiments of the application, based on the foregoing scheme, the generating module is further configured to: and generating the test data through an interface construction mode or a data simulation mode.
In some embodiments of the application, based on the foregoing, the execution module is configured to: and executing a plurality of test cases in parallel.
According to an aspect of an embodiment of the present application, there is provided a computer-readable program medium storing computer program instructions that, when executed by a computer, cause the computer to perform the method of any one of the above.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; a memory having stored thereon computer readable instructions which, when executed by the processor, implement a method as claimed in any one of the preceding claims.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
According to the technical scheme provided by the embodiments of the application, the functional points of the page are automatically obtained based on the activity configuration data by obtaining the activity configuration data of the page, and the functional points of the page are automatically tested, so that the page is automatically tested, the test result is further automatically obtained, and the process of manual participation is omitted. The process for automatically testing the page by the functional point of the page comprises the following steps: firstly, generating test cases of pages based on functional points, then generating test data based on the test cases, and finally executing the test cases based on the test data to test the pages, wherein the execution of the test cases can test the functional points corresponding to the test cases, so that the functional points of the pages are automatically tested, and the purpose of automatically testing the pages is realized. Compared with manual testing, the method for automatically testing the page improves testing efficiency.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1A shows a schematic diagram of an exemplary system architecture to which the technical solution of an embodiment of the present application may be applied;
FIG. 1B shows a schematic diagram of a data sharing system to which the technical scheme of one embodiment of the present application may be applied;
FIG. 1C illustrates a blockchain schematic in which one embodiment of the application may be used;
FIG. 1D illustrates a schematic diagram of new block generation in a blockchain to which one embodiment of the present application may be applied;
FIG. 2 schematically illustrates a flow diagram of a method of automatically testing a page in accordance with one embodiment of the application;
FIG. 3 schematically illustrates a configuration tree constructed from active configuration data of a page in accordance with one embodiment of the present application;
FIG. 4 schematically illustrates a configuration tree constructed from active configuration data of a page in accordance with one embodiment of the present application;
FIG. 5 schematically illustrates a configuration tree constructed from active configuration data of a page in accordance with one embodiment of the present application;
FIG. 6 schematically illustrates a process of executing test cases after placing the test cases into a message queue in accordance with one embodiment of the application;
FIG. 7 schematically illustrates a test results presentation page of one embodiment of the application;
FIG. 8 schematically illustrates a functional automatic test system architecture diagram of a method of automatically testing pages of one embodiment of the present application;
FIG. 9A schematically illustrates an interactive interface diagram of a method of automatically testing pages in accordance with one embodiment of the application;
FIG. 9B schematically illustrates an interactive interface diagram of a method of automatically testing pages in accordance with one embodiment of the application;
FIG. 9C schematically illustrates an interactive interface diagram of a method of automatically testing pages in accordance with one embodiment of the application;
FIG. 9D schematically illustrates an interactive interface diagram of a method of automatically testing pages in accordance with one embodiment of the application;
FIG. 10 schematically illustrates a block diagram of an apparatus for automatically testing pages in accordance with one embodiment of the application;
fig. 11 is a hardware diagram of an electronic device, according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Fig. 1A shows a schematic diagram of an exemplary system architecture 100A to which the technical solution of an embodiment of the present application may be applied.
As shown in fig. 1A, the system architecture 100A may include a terminal device 101A (which may be one or more of a smartphone, a tablet, a portable computer, a desktop computer), a network 102A, and a server 103A. Network 102A is the medium used to provide communication links between terminal device 101A and server 103A. Network 102A may include various connection types, such as wired communication links, wireless communication links, and the like.
It should be understood that the number of terminal devices 101A, networks 102A, and servers 103A in fig. 1A are merely illustrative. There may be any number of terminal devices 101A, networks 102A, and servers 103A, as desired for implementation. For example, the server 103A may be a server cluster formed by a plurality of servers.
In one embodiment of the present application, the server 103A automatically obtains the functional points of the page based on the activity configuration data by obtaining the activity configuration data of the page, and automatically tests the functional points of the page, thereby automatically testing the page, further automatically obtaining the test result, and avoiding the process of manual participation. The process for automatically testing the page by the functional point of the page comprises the following steps: firstly, generating test cases of pages based on functional points, then generating test data based on the test cases, and finally executing the test cases based on the test data to test the pages, wherein the execution of the test cases can test the functional points corresponding to the test cases, so that the functional points of the pages are automatically tested, and the purpose of automatically testing the pages is realized. Compared with manual testing, the method for automatically testing the page improves testing efficiency.
It should be noted that, the method for automatically testing a page according to the embodiment of the present application is generally executed by the server 103A, and accordingly, the device for automatically testing a page is generally disposed in the server 103A. In other embodiments of the present application, however, the terminal device 101A may also have similar functions to the server 103A, so as to perform the method for automatically testing pages provided by the embodiments of the present application.
Fig. 1B shows a schematic diagram of an exemplary data sharing system 100B to which the technical solution of the embodiment of the present invention may be applied.
Referring to the data sharing system 100B shown in fig. 1B, the data sharing system 100B refers to a system for performing data sharing between nodes, each node 101B may receive input information while performing normal operation, and maintain shared data within the data sharing system 100B based on the received input information. In order to ensure information interworking within the data sharing system 100B, there may be an information connection between each node 101B in the data sharing system 100B, through which information transmission may be performed between the nodes 101B. For example, when any node 101B in the data sharing system 100B receives input information, other nodes 101B in the data sharing system 100B acquire the input information according to a consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes 101B in the data sharing system 100B are consistent.
For each node 101B in the data sharing system 100B, there is a node identification corresponding thereto, and each node 101B in the data sharing system 100B may store the node identifications of other nodes 101B in the data sharing system 100B, so that the generated block is subsequently broadcast to other nodes 101B in the data sharing system 100B according to the node identifications of other nodes 101B. Each node 101B may maintain a list of node identifiers as shown in the following table, and store the node names and node identifiers in the list of node identifiers. The node identifier may be an IP (Internet Protocol, protocol interconnected between networks) address and any other information that can be used to identify the node, and the IP address is only illustrated in table 1.
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
TABLE 1
FIG. 1C illustrates a schematic diagram of a blockchain to which one embodiment of the present application may be applied.
Each node in the data sharing system 100B stores one and the same blockchain. The blockchain is composed of a plurality of blocks, referring to fig. 1C, the blockchain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the father block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
FIG. 1D illustrates a schematic diagram of new block generation in a blockchain to which one embodiment of the present application may be applied.
When each block in the blockchain is generated, referring to fig. 1D, when the node where the blockchain is located receives input information, checking the input information, after the checking is completed, storing the input information into a memory pool, and updating a hash tree used for recording the input information; then, updating the update time stamp to the time of receiving the input information, trying different random numbers, and calculating the characteristic value for a plurality of times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
Wherein SHA256 is a eigenvalue algorithm used to calculate eigenvalues; version (version number) is version information of the related block protocol in the block chain; the prev_hash is the block header characteristic value of the parent block of the current block; merkle _root is a characteristic value of input information; ntime is the update time of the update timestamp; the nbits is the current difficulty, is a fixed value in a period of time, and is determined again after exceeding a fixed period of time; x is a random number; TARGET is a eigenvalue threshold that can be determined from nbits.
Thus, when the random number meeting the formula is calculated, the information can be correspondingly stored to generate the block head and the block main body, and the current block is obtained. Then, the node where the blockchain is located sends the newly generated blocks to other nodes 101B in the data sharing system 100B where the newly generated blocks are located according to the node identifications of other nodes 101B in the data sharing system 100B, the other nodes 101B verify the newly generated blocks, and after the verification is completed, the newly generated blocks are added into the blockchain stored in the newly generated blocks.
In one embodiment of the application, the input information stored in the data sharing system 100B may be active configuration data for a page, which may be obtained from a blockchain.
In one embodiment of the present application, the test cases corresponding to the function points and the test data corresponding to the test cases stored in advance in the blockchain may be searched based on the function points.
The implementation details of the technical scheme of the embodiment of the application are described in detail below:
fig. 2 schematically illustrates a flow chart of a method of automatically testing a page, which may be performed by a server, such as the server 103A shown in fig. 1A, according to one embodiment of the application.
Referring to fig. 2, the method for automatically testing a page at least includes steps S210 to S250, which are described in detail as follows:
in step S210, active configuration data of a page is acquired.
In one embodiment of the application, the identification of the page can be obtained, and the active configuration database is searched based on the identification of the page to obtain the active configuration data of the page.
In one embodiment of the application, a page identifier may be set for a page, and the active configuration data of the page may be found from the active configuration database according to the page identifier.
In one embodiment of the application, UUIDs (Universally Unique Identifier, unique machine-generated identifiers) can be generated according to network card MAC addresses of devices used for writing pages, time stamps, namespaces, random or pseudo-random numbers, time sequences and other elements when the pages are generated, the UUIDs can be used as page identifiers, and the possibility of setting the same identifiers for different pages can be greatly reduced compared with manually setting the identifiers for the pages.
In one embodiment of the application, the active configuration database may be a database of a robban system. The Luban system is used for generating pages, and can provide a one-stop marketing activity online service platform for game operators, and the functions of demand writing, page design reconstruction, development, online release and the like can be completed through the platform. And after the page is generated in the robust system, correspondingly, generating the activity configuration data of the page in a database of the robust system.
In step S220, the function point of the page is obtained based on the activity configuration data.
In one embodiment of the application, function identifiers may be set for the function points in the page, and the function points may be found by finding the function identifiers.
In one embodiment of the present application, the function identifier may be a keyword included in the function point, and the keyword in the activity configuration data may be searched, and the function point corresponding to the keyword is obtained based on the keyword and a preset keyword and function point comparison table.
In one embodiment of the present application, if the active configuration data is from the database of the robban system, each function point in the active configuration data may obtain the data located at the setting position of the "function" two words as one function point of the page by searching the "function" of the function key word.
In one embodiment of the application, the function points of the page may be obtained by looking up the shorthand for the function key "function" and the different language versions.
In one embodiment of the application, the function points may be distinguished by identifying a sequence number located after the function key.
In one embodiment of the application, for the functional points which need to be realized by multi-interface cooperation, the multi-interface relation of the functional points can be obtained based on the functional points, the interfaces related to the multi-interface relation are obtained, the related interfaces are combined based on the multi-interface relation to obtain multi-interface combination, and the test case is generated based on the multi-interface combination, so that the automatic test of the functional points realized by the multi-interface cooperation is realized.
In step S230, a test case of the page is generated based on the function point.
In one embodiment of the present application, the function points may be parsed to obtain a rule set of function points; and generating the test case based on the rule set of the function points.
In one embodiment of the application, the rule set of function points may include: qualification of function points, conditions, multi-condition relationships, actions.
In one embodiment of the application, the function points can be analyzed from four aspects of qualification, condition, multi-condition relation and action of the function points, the function points are split, and then test cases of the function points are respectively generated according to the qualification, condition, multi-condition relation and action of each function point after the split.
In one embodiment of the present application, rules of each function point may be parsed first, and then qualifications, conditions, multi-condition relationships, actions contained by each rule may be parsed.
In one embodiment of the present application, a configuration tree may be constructed according to the activity configuration data of the page, as shown in fig. 3, where the top layer of the configuration tree is a functional point of the page, the next layer of each functional point is a rule for implementing the function, the next layer of each rule is a rule set contained in the rule, and each rule set contains factors such as qualification, condition, multi-condition relation, action, and the like of each rule. And generating test cases corresponding to each factor according to each factor.
In one embodiment of the present application, as shown in fig. 4, a configuration tree may be constructed according to activity configuration data of a page, for each factor, relevant information of each factor may be obtained, and a test case corresponding to the factor may be generated according to the relevant information more accurately. For example: for the condition factors, the name, the return value and other related information of the condition factors can be obtained; for the multi-condition relation factors, the related information such as conditions, logic and the like in the multi-condition relation can be obtained; for action factors, the type of action, action object information and other relevant information can be obtained; for qualification factors, information about the type, number, etc. in the qualification may be acquired.
In one embodiment of the application, for example, one of the functional points of the page is a "retrievable prop reward". Rule one can be that a character plays a daily attractive prop rewards, and only can get a daily reward; rule two may be "character wins ten retrievable property rewards".
In this embodiment, in the rule set of rule one, the qualification of rule one may be the qualification to join the rule: "during activity" and "once daily"; the condition of rule one may be a condition for performing an action: "Login game" and "game play", the multi-conditional relationship of rule one may be "AND", and the action of rule one may be "get prop awards".
In this embodiment, in the rule set of rule two, the qualification of rule two may be the qualification to join the rule: "during an activity" and "game ten"; the condition of rule two may be a condition for performing an action: the multi-condition relationship of "continuous win" and "ten victory", rule two may be "and", and rule two may be "get prop rewards".
In one embodiment of the application, the top level of the configuration tree is the function points of the page, and the next level of each function point is the rule relationship, qualification, condition, multi-condition relationship, action, etc. that implements this function. And generating test cases corresponding to each factor according to each factor.
In one embodiment of the present application, building a configuration tree from the active configuration data of a page may be as shown in fig. 5, and the rule relation of the function points may include: exit if successful, exit if failed, all execution, etc. Qualification of the function point may include: quantity qualifications, type qualifications, relationship qualifications, common qualifications, and the like. The conditions of the function point may include: availability conditions, logic conditions, return value comparison symbol conditions, return value threshold conditions, etc., wherein the logic conditions may include business module class conditions and other conditions, and the business module class conditions may include: cloud point, sign in, white list, etc.; other conditions may include third party interface conditions, and the like. The multi-conditional relationship of the function points may include: and, or a combination expression, and the like. The actions of the function point may include availability actions and logical actions, wherein the logical actions may include: the functions of the functions can also include purchasing, submitting subscription, sharing custom actions and other modules. The lottery drawing action may include: an account-checking action, a quantity-limiting action, a probability action, an advanced configuration action, etc., wherein the account-checking action may include: in-game prop checkout, cloud integration checkout, physical checkout, magic point checkout, activation Code (CDKEY) checkout, and the like; the high level configuration actions may include: temporary storage box, non-repeated lottery drawing, multi-gift box continuous drawing and other actions.
In this embodiment, a configuration tree is set for each functional point in the page, and test cases are generated according to the endmost factors of each branch in the configuration tree, so that the structure of each generated test case can be simplified, the difficulty of generating the test cases can be simplified, and the test cases can be generated more conveniently.
In one embodiment of the present application, test cases may be generated using methods such as equivalence class classification, boundary value analysis, causal graph, decision table, orthogonal test, scenario method, state transition, misspeculation, etc.
In one embodiment of the present application, each test case may include a page identifier, a function identifier, a test target, a factor corresponding to the test case, a test case number, a test case name, input test data, and output test data.
In one embodiment of the present application, generating test cases based on multi-conditional relationships of functional points may include: acquiring conditions related to the multi-condition relation, combining the related conditions based on the multi-condition relation to obtain a multi-condition combination, and generating a test case based on the multi-condition combination.
In one embodiment of the application, the execution conditions of the actions may be: and when the number of the plurality of conditions which meet the condition reaches a set value, the operation is performed. The multi-condition relationship may include all combinations, among the combinations of the plurality of conditions, in which the number of satisfied conditions reaches the set value. For example, if the action of a function point is performed when any two of the three conditions A, B, C are met, then the multi-condition relationship for this function point may include: four combinations of A and B and C, A and B and C not, A and B not and C not, and B and C are satisfied. Corresponding test cases may be generated for each combination to test the multi-conditional relationship in which the action is performed.
In one embodiment of the present application, the obtained multi-condition relationship may be classified, and a corresponding test case may be generated according to the classified multi-condition relationship. For example, if the action of the function point is performed when any two of the three conditions A, B, C are satisfied, where condition a and condition B are traffic conditions and condition C is a common condition. The four combinations meeting the conditions in A, B, C can be divided into two types according to the condition that C meets the conditions and the condition that C does not meet the conditions, the combination when C does not meet the conditions is a multi-condition relation in the service, and the combination when C meets the conditions is not a multi-condition relation in the service.
In one embodiment of the application, when testing a single condition, the limits associated with achieving that condition may be set to pass state for testing and then increased progressively for a single condition. For example, when the test condition is "one game of a character is a daily game of a retrievable prop bonus" in which only one bonus can be retrieved per day, "the character may be set to pass through all of the in-game data (e.g., one game time does not exceed one day), the retrieval action, the lottery action, the limit of gift bags, and the like.
With continued reference to FIG. 2, in step S240, test data is generated based on the test cases.
In one embodiment of the application, the test data may be generated by way of interface construction or data simulation.
In one embodiment of the application, taking the integration function as an example, if the integration condition is tested by the interface construction mode, we directly use the interface to add the integration of the account number to the set value. If the integration conditions are tested by data simulation, we will issue the preset value of the conditions to the configuration center and then replace the condition return value with the interface.
In one embodiment of the application, the test data may include campaign qualification data and in-service data.
In one embodiment of the application, the in-service data may include in-game character data.
In step S250, a test case is executed based on the test data to test the page, resulting in a test result.
In one embodiment of the application, use cases may be executed using an AME or paas test interface.
In one embodiment of the application, different task objects can be constructed according to each test case, and the task objects are mutually independent and isolated to prevent data collision.
In one embodiment of the application, a special test number can be allocated to each task object so as to realize that each test number can only execute one test case at the same time, thereby realizing isolation among the test cases.
In one embodiment of the application, the test number may be a QQ number.
In one embodiment of the application, multiple test cases may be executed in parallel. Multiple task objects can be processed in parallel to achieve the purpose of executing multiple test cases in parallel, and the purpose of shortening test time while preventing data collision can be achieved.
In one embodiment of the application, multiple test cases may be executed in parallel through the Master-Worker mode.
In one embodiment of the application, the consumption workbench may be implemented using a programming language with a coroutine mechanism to enable faster consumption speeds.
In one embodiment of the application, the generated multiple test cases can be sent to a message queue, the message queue then sends the multiple test cases to multiple threads running in parallel, and the multiple threads execute the test simultaneously.
In one embodiment of the application, the process of executing the test case may include: firstly, constructing test data according to the content of the test case, and executing the test data on the interface according to the flow of the test data in the test case.
In one embodiment of the present application, executing test cases to test pages based on the test data in step S250 may include a process as shown in fig. 6. FIG. 6 schematically illustrates a process of executing test cases after placing the test cases into a message queue in accordance with one embodiment of the application. Firstly, a message queue sends a test case to a task processing thread; the task processing thread logs in first, can simulate ptlogin to log in, obtain cookie and skey after logging in order to check the logging state; after successful login, test data can be constructed in a test data module according to the test cases; the task processing thread sends the test purpose to a corresponding test interface, the test interface judges whether the test data module has simulation test data according to the test purpose, if so, the simulation test data is obtained for execution, and if not, the test case is executed by using the test data constructed according to the test case; returning an execution result to the task processing thread; and after the task processing process is finished, sending a confirmation instruction to the queue, and ending the execution of the test case.
In one embodiment of the present application, the test case may include input test data and output test data, and the test result may be determined according to the actual output test data and the output test data. Test results may include test pass and test fail.
In one embodiment of the application, each test result is stored on the server and attached with a unique version number and displayed by a test report.
In one embodiment of the present application, as shown in FIG. 7, which schematically illustrates test results for 5 test cases, test qualifications "once-a-day qualification" may include test quantity qualifications and test type qualifications. When the qualification of the quantity is tested, judging whether the residual quantity of the qualification meets or does not meet two conditions; when testing type qualifications, it may be verified whether the type qualification is during an activity, rather than daily, weekly, or monthly.
In one embodiment of the present application, a functional automatic test system architecture diagram of a method of automatically testing pages may be represented by fig. 8.
In the embodiment of fig. 8, after the method for automatically testing a page is started, active configuration data of the page is obtained from an active configuration database, the active configuration is analyzed to generate test cases, the test cases are sent to a message queue, the message queue distributes different test cases to a plurality of task processing threads which execute in parallel, the task processing threads construct test data according to the test cases, and execute the test cases based on the test data, and the task processing threads generate test reports and display the test reports according to execution results.
In one embodiment of the present application, the method of automatically testing a page as shown in fig. 2 provides a visual operation interface through which a user can perform related operations. The following is a detailed description of the interactive interface schematic diagrams 9A through 9D.
As shown in fig. 9A, an automatic test may be initiated by one button via the "automatic test" button in fig. 9A. After the automatic test is started, the operation interface pops up a progress preview button, and the test progress can be checked in real time through the progress preview, as shown in fig. 9B. After the test is completed, the operation interface pops up a "retest" button and a "test report" button, and the test can be retested by the "retest" button, and the result can be checked by the "test report" button, as shown in fig. 9C. Fig. 9D schematically illustrates a test report of an embodiment of the present application, in which the final page test results are shown, and the test details of the respective functional points may be shown in the red box section of fig. 9D.
In one embodiment of the application, the method of the automatic test page can be used for testing game officer network marketing activity pages, a novel function automatic test scheme of game officer network marketing activity is formed, a test case is generated by one key, the logic boundary condition is completely covered, the actual participation environment execution case of the background simulation activity is used for automatically completing the activity function tests such as qualification, logic, gift package accounting and the like, the unnecessary environment is reduced in the test flow, the background function test steps are simplified, and the activity test efficiency is improved. It is used in the marketing activities of several games to obtain excellent effect.
The following describes embodiments of the apparatus of the present application that may be used to perform the method of automatically testing pages in the above-described embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method for automatically testing pages according to the present application.
Fig. 10 schematically illustrates a block diagram of an apparatus for automatically testing pages in accordance with one embodiment of the application.
Referring to fig. 10, an apparatus 1000 for automatically testing a page according to an embodiment of the present application includes an acquisition module 1001, a generation module 1002, and an execution module 1003.
In some embodiments of the present application, based on the foregoing solution, the obtaining module 1001 is configured to obtain activity configuration data of a page, and obtain a function point of the page based on the activity configuration data; the generating module 1002 is configured to generate test cases of the page based on the function points, and generate test data based on the test cases; the execution module 1003 is configured to execute a test case based on the test data to test the page, so as to obtain a test result.
In some embodiments of the present application, based on the foregoing scheme, the acquisition module 1001 is configured to: and acquiring the identification of the page, and searching an active configuration database based on the identification of the page to obtain the active configuration data of the page.
In some embodiments of the present application, based on the foregoing scheme, the acquisition module 1001 is further configured to: and searching keywords in the activity configuration data, and obtaining function points corresponding to the keywords based on the keywords and a preset keyword and function point comparison table.
In some embodiments of the present application, based on the foregoing scheme, the generating module 1002 is configured to: analyzing the function points to obtain a rule set of the function points; and generating the test case based on the rule set of the function points.
In some embodiments of the present application, based on the foregoing scheme, the generating module 1002 is further configured to: the rule set of the function points comprises multi-condition relation of the function points; acquiring conditions related to the multi-condition relation, and combining the related conditions based on the multi-condition relation to obtain a multi-condition combination; test cases are generated based on the multi-condition combination.
In some embodiments of the present application, based on the foregoing scheme, the generating module 1002 is further configured to: the rule set of function points further includes: qualification, condition, action of the function point; test cases are generated based on qualification, conditions, multi-condition relation and actions of the functional points respectively.
In some embodiments of the present application, based on the foregoing scheme, the generating module 1002 is further configured to: obtaining a multi-interface relation of the function points based on the function points; acquiring interfaces related to the multi-interface relationship; combining related interfaces based on the multi-interface relation to obtain multi-interface combination; test cases are generated based on multi-interface combinations.
In some embodiments of the present application, based on the foregoing scheme, the generating module 1002 is further configured to: and generating test data through an interface construction mode or a data simulation mode.
In some embodiments of the present application, based on the foregoing scheme, the execution module 1003 is configured to: multiple test cases are executed in parallel.
Those skilled in the art will appreciate that the various aspects of the application may be implemented as a system, method, or program product. Accordingly, aspects of the application may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 110 according to this embodiment of the present application is described below with reference to fig. 11. The electronic device 110 shown in fig. 11 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in FIG. 11, the electronic device 110 is in the form of a general purpose computing device. Components of electronic device 110 may include, but are not limited to: the at least one processing unit 111, the at least one memory unit 112, a bus 113 connecting the different system components (including the memory unit 112 and the processing unit 111), a display unit 114.
Wherein the storage unit stores program code that is executable by the processing unit 111 such that the processing unit 111 performs the steps according to various exemplary embodiments of the present application described in the above-mentioned "example methods" section of the present specification.
The storage unit 112 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 1121 and/or cache memory 1122, and may further include Read Only Memory (ROM) 1123.
The storage unit 112 may also include a program/utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 113 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a memory unit using any of a variety of bus architectures.
Electronic device 110 may also communicate with one or more external devices (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with electronic device 110, and/or with any device (e.g., router, modem, etc.) that enables electronic device 110 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 115. Also, the electronic device 110 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 116. As shown, network adapter 116 communicates with other modules of electronic device 110 over bus 113. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 110, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present application.
According to an embodiment of the present application, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification. In some possible embodiments, the various aspects of the application may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the application as described in the "exemplary methods" section of this specification, when said program product is run on the terminal device.
In some embodiments of the present application, a program product for implementing the above-described method of an embodiment of the present application is provided, which may employ a portable compact disc read-only memory (CD-ROM) and comprise program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Furthermore, the above-described drawings are only schematic illustrations of processes included in the method according to the exemplary embodiment of the present application, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (12)

1. A method for automatically testing a page, comprising:
acquiring activity configuration data of a page;
If the functional points of the page do not need to be realized by multi-interface cooperation, constructing a configuration tree according to the active configuration data; the function points of the page are obtained according to the active configuration data, the top layer of the configuration tree is the function point of the page, the next layer of each function point in the configuration tree is a rule for realizing the function, the next layer of each rule is a rule set contained in the rule, and any rule set contains at least one of the following factors: qualification of the rule, condition of the rule, multi-condition relationship of the rule, action of the rule;
generating test cases corresponding to each factor aiming at each factor in the configuration tree;
generating test data based on the test cases;
and executing the test case based on the test data to test the page, thereby obtaining a test result.
2. The method for automatically testing a page according to claim 1, wherein the acquiring active configuration data of the page comprises:
and acquiring the identification of the page, and searching an active configuration database based on the identification of the page to obtain the active configuration data of the page.
3. The method of automatically testing a page of claim 1, further comprising:
And searching keywords in the activity configuration data, and obtaining function points corresponding to the keywords based on the keywords and a preset keyword and function point comparison table.
4. The method of automatically testing a page of claim 1, wherein any one of the rule sets includes a multi-conditional relationship for the rule;
generating a test case corresponding to each factor aiming at each factor in the configuration tree, wherein the test case comprises the following steps:
acquiring conditions related to the multi-condition relation, and combining the related conditions based on the multi-condition relation to obtain a multi-condition combination;
And generating the test case based on the multi-condition combination.
5. The method for automatically testing a page according to claim 4, wherein any one of the rule sets further comprises: qualification of the rule, condition of the rule, action of the rule;
generating a test case corresponding to each factor aiming at each factor in the configuration tree, wherein the test case comprises the following steps:
Test cases are generated based on qualification, conditions, multi-condition relationships, actions in each rule set.
6. The method for automatically testing a page according to claim 1, wherein if there is a target functional point which needs to be implemented by multi-interface cooperation among the functional points of the page, the method further comprises:
Obtaining a multi-interface relation of the target function point based on the target function point;
Acquiring interfaces related to the multi-interface relationship;
Combining the related interfaces based on the multi-interface relation to obtain a multi-interface combination;
And generating the test case of the target function point based on the multi-interface combination.
7. The method of automatically testing a page of claim 1, wherein the generating test data based on the test case comprises:
and generating the test data through an interface construction mode or a data simulation mode.
8. The method of automatically testing a page according to claim 1, wherein the executing the test case based on the test data to test the page comprises:
And executing a plurality of test cases in parallel.
9. An apparatus for automatically testing a page, comprising:
the acquisition module is used for acquiring the activity configuration data of the page and acquiring the function points of the page based on the activity configuration data;
The generation module is used for constructing a configuration tree according to the active configuration data if the functional points of the page do not need multi-interface cooperation; the function points of the page are obtained according to the active configuration data, the top layer of the configuration tree is the function point of the page, the next layer of each function point in the configuration tree is a rule for realizing the function, the next layer of each rule is a rule set contained in the rule, and any rule set contains at least one of the following factors: qualification of the rule, condition of the rule, multi-condition relationship of the rule, action of the rule;
The test cases corresponding to each factor are generated aiming at each factor in the configuration tree;
the method comprises the steps of generating test data based on the test cases;
And the execution module is used for executing the test case based on the test data to test the page so as to obtain a test result.
10. A computer device, comprising:
a memory in which a computer program is stored;
a processor for loading the computer program for implementing the method according to any of claims 1-8.
11. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor and to perform the method according to any of claims 1-8.
12. A computer program product, characterized in that the computer program product comprises a computer program adapted to be loaded by a processor and to perform the method according to any of claims 1-8.
CN202010111332.2A 2020-02-24 2020-02-24 Method and device for automatically testing page Active CN111352832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010111332.2A CN111352832B (en) 2020-02-24 2020-02-24 Method and device for automatically testing page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010111332.2A CN111352832B (en) 2020-02-24 2020-02-24 Method and device for automatically testing page

Publications (2)

Publication Number Publication Date
CN111352832A CN111352832A (en) 2020-06-30
CN111352832B true CN111352832B (en) 2024-06-07

Family

ID=71197121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010111332.2A Active CN111352832B (en) 2020-02-24 2020-02-24 Method and device for automatically testing page

Country Status (1)

Country Link
CN (1) CN111352832B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797026A (en) * 2020-07-17 2020-10-20 上海复深蓝软件股份有限公司 Test case generation method and device, computer equipment and storage medium
CN113672518B (en) * 2021-09-07 2024-06-18 京东科技控股股份有限公司 Test case construction method and related equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8126686B2 (en) * 2005-12-23 2012-02-28 Centre National De La Recherche Scientifique Universal method for modeling the interactions between at least one wave and at least one object, the surface of each object defining an interface between at least two media
CN103810091A (en) * 2012-11-12 2014-05-21 百度在线网络技术(北京)有限公司 Method and device for carrying out page testing
CN106033389A (en) * 2015-03-11 2016-10-19 腾讯科技(深圳)有限公司 A test use case display method and device
CN103902275B (en) * 2012-12-28 2017-11-28 北京新媒传信科技有限公司 A kind of method and system for the language version switching for realizing application
CN107704384A (en) * 2017-09-14 2018-02-16 郑州云海信息技术有限公司 A kind of convergent method and system of speed-up chip functional verification
CN107925587A (en) * 2015-08-21 2018-04-17 华为技术有限公司 Method and apparatus for network section
CN108427632A (en) * 2017-02-14 2018-08-21 腾讯科技(深圳)有限公司 Automatic test approach and device
CN108733557A (en) * 2018-03-28 2018-11-02 新华三信息安全技术有限公司 A kind of test point generation method and device
CN105160163B (en) * 2015-08-24 2019-03-26 珠海格力电器股份有限公司 Coverage testing method, device and system for unit
CN110262909A (en) * 2019-06-21 2019-09-20 李翀 RabbitMQ multi-zone supervision and message dilivery method, system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9424167B2 (en) * 2014-05-21 2016-08-23 Cgi Technologies And Solutions Inc. Automated testing of an application system
CN108519944B (en) * 2018-03-07 2019-04-05 北京航空航天大学 A kind of construction method of the software acceleration measuring technology based on noise resonance

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8126686B2 (en) * 2005-12-23 2012-02-28 Centre National De La Recherche Scientifique Universal method for modeling the interactions between at least one wave and at least one object, the surface of each object defining an interface between at least two media
CN103810091A (en) * 2012-11-12 2014-05-21 百度在线网络技术(北京)有限公司 Method and device for carrying out page testing
CN103902275B (en) * 2012-12-28 2017-11-28 北京新媒传信科技有限公司 A kind of method and system for the language version switching for realizing application
CN106033389A (en) * 2015-03-11 2016-10-19 腾讯科技(深圳)有限公司 A test use case display method and device
CN107925587A (en) * 2015-08-21 2018-04-17 华为技术有限公司 Method and apparatus for network section
CN105160163B (en) * 2015-08-24 2019-03-26 珠海格力电器股份有限公司 Coverage testing method, device and system for unit
CN108427632A (en) * 2017-02-14 2018-08-21 腾讯科技(深圳)有限公司 Automatic test approach and device
CN107704384A (en) * 2017-09-14 2018-02-16 郑州云海信息技术有限公司 A kind of convergent method and system of speed-up chip functional verification
CN108733557A (en) * 2018-03-28 2018-11-02 新华三信息安全技术有限公司 A kind of test point generation method and device
CN110262909A (en) * 2019-06-21 2019-09-20 李翀 RabbitMQ multi-zone supervision and message dilivery method, system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Classification Trees for Random Tests and Functional Coverage;A. Krupp;《Proceedings of the Design Automation & Test in Europe Conference》;20160724;1-2 *
面向Android应用的持续集成自动化测试系统设计与实现;杨人豪;《中国优秀硕士学位论文全文数据库 信息科技辑》;20190515;I138-568 *

Also Published As

Publication number Publication date
CN111352832A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
US10311050B2 (en) Crowdsourced discovery of paths in a knowledge graph
CN107807982B (en) Consistency checking method and device for heterogeneous database
CN108897691A (en) Data processing method, device, server and medium based on interface analog service
CN112187585B (en) Network protocol testing method and device
US20180276111A1 (en) Mock services for software infrastructures
CN108492108A (en) Across the chain communication means of block chain, system and computer readable storage medium
CN108900382B (en) Test method and device thereof
WO2018169573A1 (en) Determining application test results using screenshot metadata
KR102024694B1 (en) Decentralized service platform using multiple service nodes based on block chain
CN109522228B (en) Interface automation test data construction method, device, platform and storage medium
US7636740B2 (en) Database cache system
CN111352832B (en) Method and device for automatically testing page
CN111309343A (en) Development deployment method and device
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN111259066A (en) Server cluster data synchronization method and device
CN111580855A (en) Strategy issuing method and system based on full-flow gray level issuing and electronic equipment
CN108847948B (en) Method and device for creating activity group, medium and computing equipment
CN115994085A (en) Code coverage rate test processing method, device, equipment and storage medium
CN111026371B (en) Game development method and device, electronic equipment and storage medium
CN110650063A (en) Centralized bank third-party software simulation system and method
CN113821443B (en) Function detection method, device, equipment and storage medium of application program
CN115712571A (en) Interactive service test device, interactive service test device, computer equipment and storage medium
CN111405297B (en) Activity list settlement method and device and storage medium
CN111859985A (en) AI customer service model testing method, device, electronic equipment and storage medium
CN111767222A (en) Data model verification method and device, electronic equipment and storage medium

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40024212

Country of ref document: HK

GR01 Patent grant