Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one from another device, module, or unit, and are not intended to limit the device, module, or unit to the particular device, module, or unit or to limit the order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
For the purposes of clarity, technical solutions and advantages of the present disclosure, the following further details the embodiments of the present disclosure with reference to the accompanying drawings.
First, an application scenario of the present disclosure is introduced and explained:
the disclosure relates to data interaction among a terminal, a server and a proxy, and the architecture of each terminal is shown in fig. 1.
Specifically, a test client and a test program are installed in the terminal, and the test client performs data interaction with the server through the test program; the test client may also interact with the proxy.
Further, the test program is used for starting a test for the test client, acquiring a path from the server and sending the path to the test client, recording a time stamp and a behavior action identifier of the test client when the behavior action is executed in the path recording process, and sending the time stamp and the behavior action identifier to the proxy. Wherein the behavior action identification is used for distinguishing the individual behavior actions.
The agent end is used for constructing page data in the test process and sending the constructed page data to the test client end for testing; and the method is also used for receiving the timestamp reported by the test client before executing the current behavior action in the path recording process, acquiring corresponding interface data based on the timestamp, storing a first corresponding relation between the timestamp and the interface data, receiving a second corresponding relation between the behavior action reported by the server and the timestamp when the path recording is finished, and generating the corresponding relation between the behavior action and the interface data based on the second corresponding relation and the first corresponding relation. Any page of the test client comprises at least one interface data, and the page data of any page can be constructed through all the interface data in the page.
In practical applications, if each page in an application program is defined as a state, the pages are connected by individual actions. Then the test procedure of the test client can be seen as a Model of a directed graph, as shown in fig. 2. Based on the model, a series of continuous action sequences between different pages can be recorded, and the action sequences can be utilized to play back the operation scene of the user at the moment.
Wherein 201 is a schematic diagram of the structure of each GUI in state 1 and the processing information of state 1, and 202 is a schematic diagram of the related parameter information of action 1. Further, state 1 performs action1 jumps to state 2, state 2 performs action 2 jumps to state 1, and state 1 performs action 3 jumps to state 3.
Further, in the present disclosure, the page data is page data supporting Feed streams. That is, the same page may display different pages by feeding different page data. Feed is typically done while the page is refreshed. For example, the currently displayed page data includes A, B, C and when the page is refreshed, the displayed page data includes D, E, F.
The present disclosure provides a method, an apparatus, an electronic device, and a computer-readable storage medium for testing an application program, which aim to solve the above technical problems in the prior art.
The following describes the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
In one embodiment, a test method of an application program is provided, as shown in fig. 3, the method can be applied to a proxy end; the method comprises the following steps:
step S301, receiving a page data construction request sent by a test client, wherein the page data construction request is used for requesting construction of target page data corresponding to target behavior execution in a recording process;
specifically, the test client may generate a target page data construction request based on each target behavior action in the path before executing each target behavior action, and then send the target page data construction request to the proxy. The target page data construction request is used for requesting construction of target page data corresponding to target behavior actions executed in the recording process. After receiving the target page data construction request, the proxy end can construct target page data required by the test client end when executing the target behavior action.
In a preferred embodiment of the present disclosure, receiving a page data construction request sent by a test client includes:
receiving a page data construction request sent by a testing client according to a target behavior action to be executed currently in a playback path which is checked by information issued by a server, wherein the information check playback path comprises a path between a page state corresponding to when target information on a page starts to be checked and a page state corresponding to when the target information detail page starts to be checked, and the path comprises a behavior action sequence from the beginning to the target information detail page.
Specifically, before executing the target behavior action, the test client may send a page data construction request required by the target behavior action to be executed currently to the proxy, where the target behavior action to be executed currently may be obtained from an information viewing playback path issued by the server, where the information viewing playback path includes a path between a page state corresponding to when viewing of target information on a page begins to a page state corresponding to when viewing of a target information detail page begins, and one path includes a behavior action sequence from when viewing of the target information detail page begins.
For example, state 1 in fig. 2 is a page state corresponding to when viewing target information on a page is started, state 3 is a page state corresponding to when viewing target information detail page, and paths from state 1 to state 3 are action 1 > action 2 > action 3.
In a preferred embodiment of the present disclosure, receiving a page data construction request sent by a test client includes:
and receiving a page data construction request sent by the test client according to the target behavior action to be executed currently in a login link playback path issued by the server, wherein the login link playback path comprises a path from a corresponding page state when an application program starts to be logged in to a corresponding page state when the application program starts to be logged in successfully, and the path comprises a behavior action sequence from the start to the login success.
Specifically, before executing the target behavior action, the test client may send a page data construction request required by the target behavior action to be executed currently to the proxy, where the target behavior action to be executed currently may be obtained from a login link playback path issued by the server, where the login link playback path includes a path between a corresponding page state when the application program starts to be logged in and a corresponding page state when the application program starts to be logged in, and one path includes a behavior action sequence from the start to view the target information detail page.
For example, state 4 is the corresponding page state when the application starts to log in, state 6 is the corresponding page state when the login is successful, and the path from state 4 to state 5 is action 4 > action 5 > action 6.
Step S302, responding to a page data construction request, and constructing target page data corresponding to a target behavior action based on a corresponding relation between the pre-stored behavior action generated in a use case recording stage and interface data;
after receiving the page data construction request, the proxy receives the page data construction request, and can construct and obtain target page data corresponding to the target behavior action based on the corresponding relation between the behavior action and the interface data which are pre-stored in the use case recording stage.
In a preferred embodiment of the present disclosure, the correspondence between the behavior actions and the interface data may be generated by:
in the path recording process, receiving a time stamp reported by a test client before executing the current behavior action, acquiring corresponding interface data based on the time stamp, and storing a first corresponding relation between the time stamp and the interface data;
and when the path recording is finished, receiving a second corresponding relation of the behavior action and the time stamp reported by the server side, and generating a corresponding relation of the behavior action and the interface data based on the second corresponding relation and the first corresponding relation.
Specifically, in the path recording process, the server side can initiate an action instruction to the test client side, the test client side can execute the corresponding action after receiving the action instruction, at the moment, the test program obtains a time stamp reported by the test client side before executing the current action, obtains corresponding interface data based on the time stamp, reports the time stamp and the interface data to the proxy side, and the proxy side stores a first corresponding relation between the time stamp and the interface data.
Further, in the path recording process, the test client needs to report the timestamp of the last executed behavior action to the server before requesting the behavior action, and the server stores the second corresponding relation between the behavior action and the timestamp. And when the path recording is finished, the proxy end receives a second corresponding relation of the behavior action and the time stamp reported by the server end, and generates a corresponding relation of the behavior action and the interface data based on the second corresponding relation and the first corresponding relation.
In a preferred embodiment of the present disclosure, the page data construction request includes an action identifier of the target behavioral action; the agent end specifically stores the corresponding relation between the action identification of at least one action and the interface data;
responding to a page data construction request, constructing target page data corresponding to target behavior action based on a corresponding relation between the pre-stored behavior action generated in a use case recording stage and interface data, and comprising the following steps:
matching the action identifier of the target action with the corresponding relation between the action identifier of at least one action and the interface data, and taking the interface data corresponding to the matched action identifier as target interface data;
and constructing page data corresponding to the target behavior according to the target interface data.
Specifically, a page data construction request may include an action identifier of a target action, such as action 1, action 2, etc.; the agent end also stores the corresponding relation between the action identification of at least one action and the interface data; wherein the page data of the application program comprises at least one interface data.
Further, for any page data construction request, after receiving the page data construction request, the proxy receives the page data construction request, extracts the action identifier of the target action therein, then matches the action identifier with each action identifier in the corresponding relation between each action and the interface data stored in advance, determines the matched target action identifier, then determines the target corresponding relation containing the target action identifier, and constructs the corresponding target page data based on the interface data in the target corresponding relation.
It should be noted that, the number of interface data in one corresponding relationship may be one or more, which is determined during development of the application program, and in practical application, all interface data including page data in each corresponding relationship may be required.
Step S303, returning the target page data to the test client, and indicating the test client to perform path playback based on the target page data and the target behavior action.
After constructing the target page data, the proxy end sends the target page data to the test client end, and the test client end can play back the path based on the target page data and the target behavior action after acquiring the target page data. If the target behavior action is successfully executed, judging that playback is successful, and generating a test result of successful test; if the target behavior action fails to be executed, playback failure can be judged, and a test result of test failure is generated.
In the embodiment of the disclosure, the proxy receives a page data construction request sent by the test client, where the page data construction request is used for requesting construction of target page data corresponding to execution of target behavior actions in the recording process; then, responding to a page data construction request, and constructing target page data corresponding to the target behavior action based on a corresponding relation between the behavior action and interface data which are generated in a pre-stored use case recording stage; and returning the target page data to the test client to instruct the test client to play back the path based on the target page data and the target behavior action. Therefore, when the path playback is carried out on the test client, even if the original page data corresponding to the target behavior action does not exist, the proxy end can still construct the original page data corresponding to the target behavior action executed in the recording process, so that the condition that the test for the test client fails due to the fact that the path cannot be played back under the condition that the original page data is updated due to refreshing is avoided, the success rate of the playback is improved, and the success rate of the test is further improved.
For easy understanding, in another embodiment, a method for testing an application program is provided, as shown in fig. 4, and the method may be applied to a test client in a terminal; the method comprises the following steps:
step S401, obtaining a path for a test client in a terminal; the path includes at least one behavioral action;
in practical application, after the terminal obtains the path for the test client, the path can be sent to the test client. Wherein the test client may be connected to the internet; one path may also be referred to as a path, which is a path that finds an effective path on the model that is executable between two states, including a series of action sequences. For example, the user starts a series of actions from the start of login (start state) to the success of login (stop state) in the application.
In a preferred embodiment of the present disclosure, acquiring a path for a test client in a terminal includes:
receiving a path sent by a preset server; the server sends a path to a test client in the terminal based on a test request, wherein the test request is generated by a preset test program based on receiving a test instruction aiming at the test client.
Specifically, a test client and a test program are installed in the terminal, a user can initiate a test instruction aiming at the test client in the test program, the test program generates a test request based on the test instruction, then the test request is sent to the server, the test request can include an identifier of a path, the server receives the test request and then obtains a corresponding path based on the identifier query, then the path is sent to the terminal, and the terminal sends the path to the test client.
Step S402, acquiring page data corresponding to at least one behavior action;
the path includes at least one action, as shown in fig. 2, each action has corresponding page data, so the page data corresponding to each action needs to be acquired before each action is executed.
In practical applications, an application program that can connect to the internet can automatically refresh the content displayed in the page, that is, the content displayed at different times may be different in the same page, so in order to avoid that the original page data cannot be found at the time of playback path, the original page data needs to be stored.
For example, at a certain moment, when the user clicks (behavioural action) on the top page of the application program shown in fig. 5A and the application program jumps to the page shown in fig. 5B, the behavioural action of "clicking" may be recorded as a path, and the page data corresponding to the behavioural action may be the top page shown in fig. 5A.
The first page as shown in fig. 5A may be refreshed after the time of testing the application program, and the content shown in the first page does not include the content 2, so that the behavior action of "clicking" cannot be performed in the refreshed page and the application program page as shown in fig. 5B is skipped, and thus the behavior action cannot be tested. Therefore, in the embodiment of the present disclosure, the top page as shown in fig. 5A may be stored. Thus, when testing the application program, the top page as shown in fig. 5A can be constructed even if the top page is refreshed.
In a preferred embodiment of the present disclosure, acquiring page data corresponding to each of at least one behavioral action includes:
sending a page data construction request to a preset proxy terminal based on at least one behavior action, so that the proxy terminal constructs page data corresponding to the at least one behavior action respectively based on the page data construction request;
and receiving page data corresponding to at least one behavior action sent by the proxy terminal.
Specifically, before executing each behavior action, the test client can generate a page data construction request based on each behavior action in the path, then send the page data construction request to the proxy, and the proxy responds to the data construction request to construct page data corresponding to each behavior action, and then send the page data corresponding to each behavior action to the test client.
For example, the path of fig. 2 includes action 1- > action 2- > action 3, the page data of state 1 is acquired before execution of action1, the page data of state 2 is acquired before execution of action 2, and the page data of state 1 is acquired before execution of action 3.
Step S403, the path is replayed based on the page data to obtain a replay result, and a corresponding test result is generated based on the replay result.
Wherein playback refers to testing individual behavioral actions in the client execution path to reveal a complete operation. For example, the path of fig. 2 is played back, and under normal conditions, each behavior is performed, and the test client sequentially shows state 1, state 2, state 1, and state 3.
Specifically, after each page data is acquired, the test client can execute the corresponding behavior action to play back, and if each behavior action is executed successfully, the playback can be judged to be successful, and a test result of successful test is generated; if at least one behavior action fails to be executed, playback failure can be judged, and a test result of test failure is generated.
In the embodiment of the disclosure, when testing a test client in a terminal, firstly acquiring a path of the test client, wherein the path comprises at least one behavior action; before executing each behavior action, firstly acquiring page data corresponding to each behavior action, and then, if each behavior action in the sequential execution path is executed successfully based on each page data, judging that playback is successful, and generating a test result of successful test; if at least one behavior action fails to be executed, playback failure can be judged, and a test result of test failure is generated. Therefore, when the path playback is carried out on the test client, even if the original page data corresponding to the target behavior action does not exist, the proxy end can still construct the original page data corresponding to the target behavior action executed in the recording process, so that the condition that the test for the test client fails due to the fact that the path cannot be played back under the condition that the original page data is updated due to refreshing is avoided, the success rate of the playback is improved, and the success rate of the test is further improved.
Fig. 6 is a schematic structural diagram of a testing device for an application according to another embodiment of the present disclosure, and as shown in fig. 6, the device of this embodiment may include:
the receiving module 601 is configured to receive a page data construction request sent by the test client, where the page data construction request is used to request construction of target page data corresponding to a target behavior executed in the recording process;
the first processing module 602 is configured to, in response to a page data construction request, construct target page data corresponding to a target behavior action based on a correspondence between a pre-stored behavior action generated in a use case recording stage and interface data;
and the sending module 603 is configured to return target page data to the test client, and instruct the test client to perform path playback based on the target page data and the target behavior action.
In a preferred embodiment of the present disclosure, the apparatus further comprises:
the second processing module is used for receiving the time stamp reported by the test client before executing the current behavior action in the path recording process, acquiring corresponding interface data based on the time stamp, and storing a first corresponding relation between the time stamp and the interface data;
and the third processing module is used for receiving the second corresponding relation of the behavior action and the time stamp reported by the server side when the path recording is finished, and generating the corresponding relation of the behavior action and the interface data based on the second corresponding relation and the first corresponding relation.
In a preferred embodiment of the present disclosure, the page data construction request includes an action identifier of the target behavioral action; the agent end specifically stores the corresponding relation between the action identification of at least one action and the interface data;
the first processing module is specifically configured to:
matching the action identifier of the target action with the corresponding relation between the action identifier of at least one action and the interface data, and taking the interface data corresponding to the matched action identifier as target interface data; and constructing page data corresponding to the target behavior according to the target interface data.
In a preferred embodiment of the present disclosure, the receiving module is specifically configured to:
and receiving a page data construction request sent by the test client according to the target behavior action to be executed currently in a login link playback path issued by the server, wherein the login link playback path comprises a path from a corresponding page state when an application program starts to be logged in to a corresponding page state when the application program starts to be logged in successfully, and the path comprises a behavior action sequence from the start to the login success.
In a preferred embodiment of the present disclosure, the receiving module is specifically configured to:
receiving a page data construction request sent by a testing client according to a target behavior action to be executed currently in a playback path which is checked by information issued by a server, wherein the information check playback path comprises a path between a page state corresponding to when target information on a page starts to be checked and a page state corresponding to when the target information detail page starts to be checked, and the path comprises a behavior action sequence from the beginning to the target information detail page.
In a preferred embodiment of the present disclosure, the page data is page data supporting Feed streams.
The test device for an application program in this embodiment may execute the test method for an application program in the first embodiment of the present disclosure, and the implementation principle is similar, and will not be described herein.
In the embodiment of the disclosure, the proxy receives a page data construction request sent by the test client, where the page data construction request is used for requesting construction of target page data corresponding to execution of target behavior actions in the recording process; then, responding to a page data construction request, and constructing target page data corresponding to the target behavior action based on a corresponding relation between the behavior action and interface data which are generated in a pre-stored use case recording stage; and returning the target page data to the test client to instruct the test client to play back the path based on the target page data and the target behavior action. Therefore, when the path playback is carried out on the test client, even if the original page data corresponding to the target behavior action does not exist, the proxy end can still construct the original page data corresponding to the target behavior action executed in the recording process, so that the condition that the test for the test client fails due to the fact that the path cannot be played back under the condition that the original page data is updated due to refreshing is avoided, the success rate of the playback is improved, and the success rate of the test is further improved.
Referring now to fig. 7, a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 701 described below, the memory may include at least one of a Read Only Memory (ROM) 702, a Random Access Memory (RAM) 703, and a storage device 708 described below, as follows: as shown in fig. 7, the electronic device 700 may include a processing means (e.g., a central processor, a graphics processor, etc.) 701, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage means 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
In general, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 shows an electronic device 700 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 709, or installed from storage 708, or installed from ROM 702. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 701.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but 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 of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-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. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a page data construction request sent by a test client, wherein the page data construction request is used for requesting construction of target page data corresponding to target behavior execution in the recording process; responding to a page data construction request, and constructing target page data corresponding to the target behavior action based on a corresponding relation between the behavior action and interface data which are generated in a use case recording stage and stored in advance; and returning the target page data to the test client, and indicating the test client to play back the path based on the target page data and the target behavior action.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ 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 computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of a module or unit does not in some cases constitute a limitation of the unit itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a test method of an application program, including:
receiving a page data construction request sent by a test client, wherein the page data construction request is used for requesting construction of target page data corresponding to target behavior execution in a recording process;
responding to the page data construction request, and constructing target page data corresponding to the target behavior action based on a corresponding relation between the pre-stored behavior action generated in a use case recording stage and interface data;
and returning the target page data to the test client, and indicating the test client to play back a path based on the target page data and the target behavior action.
In a preferred embodiment of the present disclosure, the method further comprises:
in the path recording process, receiving a time stamp reported by the test client before executing the current behavior action, acquiring corresponding interface data based on the time stamp, and storing a first corresponding relation between the time stamp and the interface data;
and when the path recording is finished, receiving a second corresponding relation of the behavior action and the time stamp reported by the server side, and generating a corresponding relation of the behavior action and the interface data based on the second corresponding relation and the first corresponding relation.
In a preferred embodiment of the present disclosure, the page data construction request includes an action identifier of a target action; the agent end specifically stores the corresponding relation between the action identification of at least one action and the interface data;
the responding to the page data construction request, based on the corresponding relation between the pre-stored behavior action generated in the use case recording stage and the interface data, constructs the target page data corresponding to the target behavior action, comprising:
matching the action identifier of the target behavior action with the corresponding relation between the action identifier of the at least one behavior action and the interface data, and taking the interface data corresponding to the matched action identifier as target interface data;
and constructing page data corresponding to the target behavior action according to the target interface data.
In a preferred embodiment of the present disclosure, the receiving a page data construction request sent by a test client includes:
and receiving a page data construction request sent by the test client according to the target behavior action to be executed currently in the login link playback path issued by the server, wherein the login link playback path comprises a path from the corresponding page state when the application program starts to be logged in to the corresponding page state when the application program starts to be logged in successfully, and the path comprises a behavior action sequence from the start of login to the successful login.
In a preferred embodiment of the present disclosure, the receiving a page data construction request sent by a test client includes:
receiving a page data construction request sent by a test client according to a target behavior action to be executed currently in an information checking playback path sent by the server, wherein the information checking playback path comprises a path from a page state corresponding to when target information on a page starts to be checked to a page state corresponding to when the target information detail page starts to be checked, and the path comprises a behavior action sequence from the beginning to the target information detail page.
In a preferred embodiment of the present disclosure, the page data is page data supporting Feed streams.
According to one or more embodiments of the present disclosure, there is provided an apparatus of example one, comprising:
a receiving module 601, configured to receive a page data construction request sent by a test client, where the page data construction request is used to request construction of target page data corresponding to a target behavior executed in a recording process;
the first processing module 602 is configured to respond to the page data construction request, and construct target page data corresponding to the target behavior action based on a corresponding relation between the pre-stored behavior action and interface data generated in a use case recording stage;
And the sending module 603 is configured to return the target page data to the test client, and instruct the test client to perform path playback based on the target page data and the target behavior action.
In a preferred embodiment of the present disclosure, the apparatus further comprises:
the second processing module is used for receiving the time stamp reported by the test client before executing the current behavior action in the path recording process, acquiring corresponding interface data based on the time stamp, and storing a first corresponding relation between the time stamp and the interface data;
and the third processing module is used for receiving a second corresponding relation of the behavior action and the time stamp reported by the server when the path recording is finished, and generating a corresponding relation of the behavior action and the interface data based on the second corresponding relation and the first corresponding relation.
In a preferred embodiment of the present disclosure, the page data construction request includes an action identifier of a target action; the agent end specifically stores the corresponding relation between the action identification of at least one action and the interface data;
the first processing module is specifically configured to:
matching the action identifier of the target behavior action with the corresponding relation between the action identifier of the at least one behavior action and the interface data, and taking the interface data corresponding to the matched action identifier as target interface data; and constructing page data corresponding to the target behavior action according to the target interface data.
In a preferred embodiment of the present disclosure, the receiving module is specifically configured to:
and receiving a page data construction request sent by the test client according to the target behavior action to be executed currently in the login link playback path issued by the server, wherein the login link playback path comprises a path from the corresponding page state when the application program starts to be logged in to the corresponding page state when the application program starts to be logged in successfully, and the path comprises a behavior action sequence from the start of login to the successful login.
In a preferred embodiment of the present disclosure, the receiving module is specifically configured to:
receiving a page data construction request sent by a test client according to a target behavior action to be executed currently in an information checking playback path sent by the server, wherein the information checking playback path comprises a path from a page state corresponding to when target information on a page starts to be checked to a page state corresponding to when the target information detail page starts to be checked, and the path comprises a behavior action sequence from the beginning to the target information detail page.
In a preferred embodiment of the present disclosure, the page data is page data supporting Feed streams.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.