Web Page Automated Testing Method and Apparatus
20170277622 · 2017-09-28
Inventors
Cpc classification
G06F11/36
PHYSICS
H04L67/02
ELECTRICITY
G06F16/958
PHYSICS
International classification
Abstract
A web page automated testing method and apparatus. In the web page automated testing method, target network interaction data sent by a browser to a server is obtained using a network proxy server. Then, a web page automated testing tool validates the target network interaction data, thereby implementing validation on network interaction data between the browser or a web page and the server. A network request in the target network interaction data is validated, which improves a capability of finding a web page defect, and a response message returned by the server is validated, which improves accuracy of a web page display validation result.
Claims
1.-26. (canceled)
27. A web page automated testing method, comprising: obtaining, by a terminal, target network interaction data between the terminal and a server, wherein the target network interaction data comprises a network request sent by the terminal to the server, and a response message that is received by the terminal and is returned by the server, and wherein the response message is a response of the server to the network request sent by the terminal; and validating, by the terminal, the target network interaction data.
28. The method according to claim 27, wherein obtaining the target network interaction data comprises: obtaining, by the terminal, specified network interaction data from network interaction data that is obtained by the terminal and is between the terminal and the server, wherein the specified network interaction data is network interaction data that comprises a filter keyword; and obtaining, by the terminal from the specified network interaction data, network interaction data that comprises a query keyword in order to obtain the target network interaction data, wherein the query keyword comprises a character of the filter keyword.
29. The method according to claim 27, wherein obtaining the target network interaction data comprises obtaining, by the terminal from network interaction data that is obtained by the terminal and is between the terminal and the server, network interaction data that comprises a query keyword in order to obtain the target network interaction data.
30. The method according to claim 27, Wherein obtaining the target network interaction data comprises: sending, by the terminal, a filter keyword to the server, wherein the filter keyword enables the server to obtain specified network interaction data from obtained network interaction data between the terminal and the server, and wherein the specified network interaction data is network interaction data that comprises the filter keyword; sending, by the terminal, a query keyword to the server, wherein the query keyword enables the server to obtain the target network interaction data from the specified network interaction data, wherein the target network interaction data is network interaction data that comprises the query keyword, and wherein the query keyword comprises at least a character of the filter keyword; and receiving, by the terminal, the target network interaction data sent by the server.
31. The method according to claim 27, wherein obtaining the target network interaction data comprises: sending, by the terminal, a query keyword to the server, wherein the query keyword enables the server to obtain the target network interaction data from obtained network interaction data between the terminal and the server, and wherein the target network interaction data is network interaction data that comprises the query keyword; and receiving, by the terminal, the target network interaction data sent by the server.
32. A web page automated testing method, comprising: obtaining, by a server, target network interaction data between the server and a terminal, wherein the target network interaction data comprises a network request that is received by the server and is sent by the terminal, and a response message sent by the server to the terminal, and wherein the response message is a response of the server to the network request sent by the terminal; and sending, by the server, the target network interaction data to the terminal, wherein the target network interaction data is used by the terminal to validate the target network interaction data.
33. The method according to claim 32, wherein obtaining the target network interaction data comprises: receiving, by the server, a query keyword sent by the terminal; and obtaining, by the server, the target network interaction data from obtained network interaction data between the server and the terminal, wherein the target network interaction data is network interaction data that comprises the query keyword.
34. The method according to claim 32, wherein obtaining the target network interaction data comprises: receiving, by the server, a filter keyword sent by the terminal; obtaining, by the server, specified network interaction data from obtained network interaction data between the server and the terminal, wherein the specified network interaction data is network interaction data that comprises the filter keyword; receiving, by the server, a query keyword sent by the terminal, wherein the query keyword comprises a character of the filter keyword; and obtaining, by the server, the target network interaction data from the specified network interaction data, wherein the target network interaction data is network interaction data that comprises the query keyword.
35. A terminal, comprising: a memory; and a processor coupled to the memory and configured to: obtain target network interaction data between the terminal and a server, wherein the target network interaction data comprises a network request sent by the terminal to the server, and a response message that is received by the terminal and is returned by the server, and wherein the response message is a response of the server to the network request sent by the terminal; and validate the target network interaction data.
36. The terminal according to claim 35, wherein the processor is further configured to: obtain specified network interaction data from network interaction data that is obtained by the terminal and is between the terminal and the server, wherein the specified network interaction data is network interaction data that comprises a filter keyword; and obtain, from the specified network interaction data, network interaction data that comprises a query keyword in order to obtain the target network interaction data, wherein the query keyword comprises a character of the filter keyword.
37. The terminal according to claim 35, wherein the processor is further configured to obtain, from network interaction data that is obtained by the terminal and is between the terminal and the server, network interaction data that comprises a query keyword in order to obtain the target network interaction data.
38. The terminal according to claim 35, further comprising a transmitter connected to the processor and configured to: send a filter keyword to the server, wherein the filter keyword enables the server to obtain specified network interaction data from obtained network interaction data between the terminal and the server, and wherein the specified network interaction data is network interaction data that comprises the filter keyword; send a query keyword to the server, wherein the query keyword enables the server to obtain the target network interaction data from the specified network interaction data, wherein the target network interaction data is network interaction data that comprises the query keyword, and wherein the query keyword comprises at least a character of the filter keyword, and wherein the terminal further comprises a receiver connected to the processor and configured to: receive the target network interaction data sent by the server; and send the target network interaction data to the processor.
39. The to a according to claim 35, further comprising a transmitter connected to the processor and configured to send a query keyword to the server, wherein the query keyword enables the server to obtain the target network interaction data from obtained network interaction data between the terminal and the server, wherein the target network interaction data is network interaction data that comprises the query keyword, and wherein the terminal further comprises a receiver connected to the processor and configured to: receive the target network interaction data sent by the server; and provide the target network interaction data for the processor.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0037] Drawings of the specification that constitute a part of the present application are used to provide further understanding of the present disclosure, and schematic embodiments of the present disclosure and descriptions thereof are used to explain the present disclosure, which do not constitute an improper limitation to the present disclosure.
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052] To describe the technical solutions in the embodiments of the present disclosure more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments. A person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
DESCRIPTION OF EMBODIMENTS
[0053] To make a person skilled in the art understand the technical solutions in the present disclosure better, the following clearly and completely describes the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. The described embodiments are merely a part rather than all of the embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0054] Referring to
[0055] The filter unit 3 has a function of performing initial filtering on network interaction data. A browser generates many requests in a process of loading a web page, for example, a request for a cascading style sheet (CSS), JAVASCRIPT (JS), a picture, music, and service data (for example, data included in a table of the web page). The network proxy server needs to store a network request and a response message that are concerned by a web page test engineer. Further, the network request and the response message may be obtained by means of filtering by the filter unit 3. The storage unit 4 is configured to store the network request and the response message, and provide the network request and the response message for a web page automated testing tool through the open interface 5.
[0056] Referring to
[0057] The terminal in this embodiment is integrated with a web page automated testing tool. The network proxy server shown in
[0058] As shown in
[0059] Step S110: The terminal obtains target network interaction data between the terminal and the server.
[0060] The target network interaction data includes a network request sent by the terminal to the server, and a response message that is received by the terminal and is returned by the server. The response message is a response of the server to the network request sent by the terminal.
[0061] The web page automated testing tool in the terminal enables the network proxy server, then invokes the browser, and sets an address of the network proxy server for the browser. The web page automated testing tool operates the browser, and the browser sends a corresponding network request using the terminal. The network proxy server receives the network request, and forwards the network request to the server. After receiving a response message returned by the server in response to the network request, when sending the response message to the browser, the network proxy server replicates and stores the target network interaction data between the terminal and the server.
[0062] When the network proxy server is integrated into the web page automated testing tool, the web page automated testing tool enables the network proxy server in an initialization manner. When the network proxy server is integrated into another software of the terminal, the network automated testing tool enables the network proxy server using a start command.
[0063] Network interaction data that a network engineer actually wants to test may be only a specific type of network interaction data in the network interaction data between the terminal and the server. Therefore, the terminal only needs to obtain the network interaction data that the web page test engineer actually wants to test.
[0064] For example, the web page test engineer sets one or more query keywords using the web page automated testing tool in the terminal, and transfers the query keyword to the network proxy server through an open interface of the network proxy server. The network proxy server obtains the target network interaction data from obtained network interaction data between the terminal and the server. The target network interaction data is network interaction data that includes the query keyword.
[0065] Step S120: The terminal validates the target network interaction data.
[0066] After obtaining the target network interaction data, the web page automated testing tool determines whether an operation on the browser or the web page is consistent with a parameter in the network request. It indicates that a network request sent by the browser or the web page is accurate if the parameters are consistent, and it indicates that the network request sent by the browser or the web page is inaccurate if the parameters are inconsistent. For example, when a user enters a character “abc” in a search field of a web page, a network request sent by the terminal to the server is obtained, and it is determined whether the network request is consistent with an operation of the user on the web page. The web page automated testing tool resolves a response message, and determines whether a message obtained by means of resolution is consistent with content displayed on the web page in order to validate accuracy of the content displayed on the web page.
[0067] In the web page automated testing method provided in this embodiment, a terminal obtains target network interaction data between the terminal and a server using a network proxy server, validates a network request in the target network interaction data using a web page automated testing tool in order to improve a capability of finding a web page defect, and validates a response message returned by the server in order to improve accuracy of a web page display validation result.
[0068] In an embodiment provided by the present disclosure, according to different integration locations of the network proxy server, a specific process of step S110 that the terminal obtains target network interaction data between the terminal and the server in
[0069] (1) The network proxy server is integrated on a terminal side.
[0070] Referring to
[0071] Step S1111: Obtain specified network interaction data from network interaction data obtained by the terminal, where the specified network interaction data is network interaction data that includes a filter keyword.
[0072] A network proxy server obtains, from received network interaction data between the terminal and a server by means of filtering, the network interaction data that includes the filter keyword in order to obtain the specified network interaction data.
[0073] A network test engineer may set one or more filter keywords using a web page automated testing tool, and transfer the filter keyword to the network proxy server through an open interface of the network proxy server. The network proxy server obtains only network interaction data that includes the filter keyword in order to obtain specified network interaction data. That is, the specified network interaction data is a part of the network interaction data between the terminal and the server.
[0074] The network proxy server determines whether the received network interaction data between the terminal and the server includes the filter keyword. The network interaction data that includes the filter keyword is replicated and stored in a storage unit if the received network interaction data includes the filter keyword, and no processing is performed on the network interaction data if the received network interaction data does not include the filter keyword. Then the network proxy server continues to determine whether a next pair of network interaction data includes the filter keyword. For example, the network proxy server obtains, from the received network interaction data between the terminal and the server by means of filtering, the following two pairs of network interaction data, when the filter keyword is “wd=” and stores the two pairs of network interaction data into the storage unit.
[0075] Network request 1:
[0076] http://www.baidu.com/s?wd=1&rsv_bp=0&tn=baidu&rsv_spt=3&ie=utf-8&rsv_enter=1&rsv_sug3=2&rsv_sug4=16&rsv_sug1=1&rsv_sug2=0&inputT=864&rsv_sug=2;
[0077] A corresponding response message also includes the filter keyword “wd=”, and the response message is not shown herein.
[0078] Network request 2:
[0079] http://suggestion.baidu.com/su?wd=&cb=window.bdsug.sugPreRequest&sid=4301_1425_4414_4261_4202_4450_4587&t=1387161319508;
[0080] Response message 2:
[0081] window.bdsug. sugPreRequest({ q:““,p:false,s: []}).
[0082] In this embodiment, if no filter keyword is set, no network interaction data is stored.
[0083] It should be noted that the web page test engineer may set the filter keyword at any time. For example, the filter keyword may be set when the network proxy server is enabled, or may be set after the network proxy server runs for a period of time. Only after receiving the filter keyword, the network proxy server performs filtering on the network interaction data, and replicates and saves the network interaction data that includes the filter keyword.
[0084] Step S1112: Obtain target network interaction data from the specified network interaction data.
[0085] The target network interaction data is network interaction data that includes a query keyword. The query keyword includes a character of the filter keyword.
[0086] The network test engineer may set the query keyword using the web page automated testing tool, and transfer the query keyword to the network proxy server through the open interface of the network proxy server.
[0087] The network proxy server determines whether the network interaction data that includes the query keyword exists in the specified network interaction data stored in the storage unit. If there exists the network interaction data that includes the query keyword, the network interaction data that includes the query keyword is fed back to the web page automated testing tool to obtain the target network interaction data. If there does not exist the network interaction data that includes the query keyword, null is returned to the web page automated testing tool. It can be learned from this that, the target network interaction data is partial network interaction data in the specified network interaction data.
[0088] The foregoing example is continued, and the network proxy server stores the two pairs of network interaction data that includes the filter keyword “wd=”. It is assumed that the query keyword is “wd=1”. If the network proxy server finds that the network request 1 and a response message 1 in the storage unit include “wd=1”, the network request 1 and the response message 1 are fed back to the web page automated testing tool.
[0089] In the method for obtaining target network interaction data provided in this embodiment, a filter keyword is set, and a network proxy server in a terminal obtains specified network interaction data from received network interaction data between the terminal and a server. Then a query keyword is set, and the network proxy server in the terminal obtains target network interaction data from the obtained specified network interaction data. In this way, a storage unit of the network proxy server needs to store only network interaction data that includes the filter keyword, which greatly saves storage space.
[0090] In another embodiment of the present disclosure, the terminal obtains, from obtained network interaction data, network interaction data that includes the query keyword in order to obtain the target network interaction data. That is, the terminal obtains the target network interaction data only using the query keyword.
[0091] In specific implementation, a network proxy server in a terminal obtains network interaction data between the terminal and a server, and replicates and stores the network interaction data into a storage unit, after receiving a query keyword transferred by a web page automated testing tool, obtains network interaction data that includes the query keyword from the storage unit, and sends the network interaction data to the web page automated testing tool such that the web page automated testing tool validates a network request and a corresponding response message that are in target network interaction data.
[0092] (2) The network proxy server is integrated on a server side.
[0093] Referring to
[0094] Step S1121: The terminal sends a filter keyword to the server.
[0095] The filter keyword enables the server to obtain specified network interaction data from obtained network interaction data between the terminal and the server. The specified network interaction data is network interaction data that includes the filter keyword.
[0096] Step S1122: The terminal sends a query keyword to the server.
[0097] The query keyword enables the server to obtain target network interaction data from the specified network interaction data. The target network interaction data is network interaction data that includes the query keyword, and the query keyword includes at least a character of the filter keyword.
[0098] Step S1123: The terminal receives the target network interaction data sent by the server.
[0099] In all network interaction data between the terminal and the server, the network interaction data that includes the filter keyword is the specified network interaction data. In the specified network interaction data, the network interaction data that includes the query keyword is the target network interaction data. The target network interaction data is network interaction data that needs to be validated by a web page automated testing tool. Therefore, only the target network interaction data needs to be sent to the terminal, and the specified network interaction data does not need to be sent to the terminal.
[0100] In the method for obtaining target network interaction data provided in this embodiment, a terminal transfers a filter keyword to a server such that the server obtains only specified network interaction data from received network interaction data between the terminal and the server. Then, the terminal transfers a query keyword to the server, and the server obtains target network interaction data from the obtained specified network interaction data. In this way, only the specified network interaction data needs to be stored on a server side, which greatly saves storage space.
[0101] In another embodiment of the present disclosure, only a query keyword is set. A network proxy server in a server obtains target network interaction data by performing filtering on received network interaction data between the server and the terminal. The target network interaction data is network interaction data that includes the query keyword. As shown in
[0102] Step S1131: The terminal sends a query keyword to the server. The query keyword is used to enable the server to query target network interaction data from obtained network interaction data, where the target network interaction data is network interaction data that includes the query keyword.
[0103] Step S1132: The terminal receives the target network interaction data sent by the server.
[0104] In the method for obtaining target network interaction data provided in this embodiment, a terminal transfers a query keyword to a server such that the server obtains, from network interaction data between the terminal and the server, network interaction data that includes the query keyword, and feeds back the network interaction data that includes the query keyword to the terminal.
[0105] Referring to
[0106] Step S210: The terminal deletes network interaction data that includes a feature character.
[0107] In specific implementation, if a network proxy server is integrated into the terminal, a web page automated testing tool in the terminal sends a delete instruction to the network proxy server in the terminal through an open interface. The delete instruction includes the feature character. The network proxy server deletes the network interaction data that includes the feature character when receiving the delete instruction.
[0108] The feature character may be any segment of character string in a network request or a response message. For example, when the web page automated testing tool repeatedly performs a completely same operation twice on a browser or a web page, and needs to validate network interaction data generated during the second operation, before performing the second operation, the web page automated testing tool needs to delete a network request and a response message generated during the first operation.
[0109] Step S220: The terminal deletes all obtained network interaction data between the terminal and the server.
[0110] If the network proxy server is integrated into the terminal, the web page automated testing tool in the terminal sends an empty instruction to the network proxy server through the open interface. After receiving the empty instruction, the network proxy server empties all network interaction data stored in a storage unit in order to save storage space.
[0111] An execution sequence of steps S210 and S220 is not strictly limited. Step S220 may be first performed and then step S210 provided that steps S210 and S220 are performed after the network proxy server stores the network interaction data.
[0112] In the web page automated testing method provided in this embodiment, network interaction data that has been stored in a network proxy server of a terminal and includes a feature character can be deleted, and all stored network interaction data can be emptied, thereby saving storage space of the network proxy server.
[0113] Corresponding to the foregoing embodiments of the web page automated testing method applied to the terminal, if the network proxy server is integrated into the server, the present disclosure further provides an embodiment of a web page automated testing method applied to a server side.
[0114] Referring to
[0115] Step S310: The server obtains target network interaction data between the server and a terminal.
[0116] The target network interaction data includes a network request that is received by the server and is sent by the terminal, and a response message sent by the server to the terminal. The response message is a response of the server to the network request sent by the terminal.
[0117] Step S310 may be implemented in the following two manners.
[0118] (1) The first implementation manner of step S310:
[0119] Step 1: The server receives a query keyword sent by the terminal.
[0120] Step 2: The server obtains the target network interaction data from obtained network interaction data between the server and the terminal, where the target network interaction data is network interaction data that includes the query keyword.
[0121] The query keyword is set on a terminal side. The server obtains, from the obtained network interaction data between the server and the terminal by means of filtering, the network interaction data that includes the query keyword.
[0122] (2) The second implementation manner of step S310:
[0123] Step 11: The server receives a filter keyword sent by the terminal.
[0124] Step 12: The server obtains specified network interaction data from obtained network interaction data between the server and the terminal, where the specified network interaction data is network interaction data that includes the filter keyword.
[0125] Step 13: The server receives a query keyword sent by the terminal, where the query keyword includes a character of the filter keyword.
[0126] Step 14: The server obtains the target network interaction data from the specified network interaction data. The target network interaction data is network interaction data that includes the query keyword.
[0127] Step S320: The server sends the target network interaction data to the terminal such that the terminal validates the target network interaction data.
[0128] In the web page automated testing method provided in this embodiment, a server obtains target network interaction data between the server and a terminal, and then sends the target network interaction data to the terminal such that the terminal validates the target network interaction data, thereby implementing validation on a web page or a browser.
[0129] Preferably, as shown in
[0130] Step S330: The server receives a delete instruction sent by the terminal, where the delete instruction includes a feature character.
[0131] Step S340: The server deletes, according to the delete instruction, network interaction data that includes the feature character.
[0132] Step S350: The server receives an empty instruction sent by the terminal.
[0133] Step S360: The server deletes all stored network interaction data.
[0134] A server provided in this embodiment obtains, using a network proxy server, specified network interaction data sent by a browser to the server, obtains target network interaction data from the specified network interaction data, and provides the target network interaction data for a web page automated testing tool. The web page automated testing tool validates the target network interaction data, thereby implementing validation on network interaction data between the browser or a web page and the server in order to improve a capability of testing a web page defect.
[0135] The foregoing method embodiments applied to a network proxy server and the method embodiments applied to a web page automated testing tool may be all integrated into the web page automated testing tool for implementation, or may be separately and independently implemented.
[0136] Referring to
[0137] Step S410: A web page automated testing tool enables a network proxy server.
[0138] The web page automated testing tool is integrated into a terminal. If the network proxy server is integrated into the web page automated testing tool in the terminal, the web page automated testing tool initializes the network proxy server, and the web page automated testing tool enables the network proxy server using a command if the network proxy server is integrated into a server.
[0139] Step S420: The web page automated testing tool transfers a filter keyword to a filter unit in the network proxy server. For example, the filter keyword is “wd=”.
[0140] Step S430: The web page automated testing tool invokes a browser and sets a proxy address of the browser.
[0141] Step S440: The web page automated testing tool operates a web page so that the browser sends a network request.
[0142] For example, when the web page automated testing tool opens a web page “http://www.baidu.com” in the browser, and searches for “1” using the search engine BAIDU, the browser sends a network request, receives a response message returned by the server, and displays a search result page.
[0143] Step S450: The network proxy server receives the network request and forwards the network request to service server.
[0144] Step S460: The network proxy server receives a response message returned by the service server, where the response message is a response of the server to the network request sent by the terminal.
[0145] Step S470: The network proxy server determines whether the network request and the response message include the filter keyword, if the network request and the response message include the filter keyword, step S480 is performed, and if the network request and the response message do not include the filter keyword, step S490 is performed.
[0146] Step S480: The network proxy server replicates the network request and the response message, and saves the network request and the response message into a storage unit.
[0147] Step S490: The network proxy server returns, to the browser, the response message returned by the service server.
[0148] Step S4100: The web page automated testing tool transfers a query keyword to the filter unit. For example, the query keyword is “wd=1”.
[0149] Step S4110: The filter unit determines whether the storage unit includes a network request and a response message that include the query keyword, if the storage unit includes a network request and a response message that include the query keyword, step S4120 is performed, and if the storage unit does not include a network request and a response message that include the query keyword, step S4130 is performed, where network interaction data that includes “wd=1” is obtained by filtering from stored network interaction data.
[0150] Step S4120: Return the network request and the response message that include the query keyword to the web page automated testing tool.
[0151] If the storage unit includes multiple pairs of network requests and response messages that include the query keyword, only the first pair of network request and response message that include the query keyword is returned.
[0152] Step S4130: Return null to the web page automated testing tool.
[0153] Step S4140: The web page automated testing tool validates the received network request and response message.
[0154] Then, steps S440-S4140 are repeatedly performed to validate multiple pairs of network requests and response messages.
[0155] Step S4150: The web page automated testing tool sends a delete instruction to the network proxy server. The delete instruction includes a feature character.
[0156] Step S4160: The network proxy server deletes, according to the delete instruction, a network request and a corresponding response message that include the feature character.
[0157] Step S4170: The web page automated testing tool sends an empty instruction to the network proxy server.
[0158] Step S4180: The network proxy server deletes all network requests and response messages in the storage unit according to the empty instruction.
[0159] Corresponding to the foregoing web page automated testing method embodiments, the present disclosure further provides a web page automated testing apparatus.
[0160] Referring to
[0161] The obtaining unit 110 is configured to obtain target network interaction data between the terminal and a server.
[0162] In this embodiment of the present disclosure, network interaction data between the terminal and the server may be obtained using a network proxy server.
[0163] The target network interaction data includes a network request sent by the terminal to the server, and a response message that is received by the terminal and is returned by the server. The response message is a response of the server to the network request sent by the terminal.
[0164] In an embodiment of the present disclosure, the network proxy server is integrated into the terminal, and the obtaining unit 110 may include a first obtaining subunit (not shown) and a second obtaining subunit (not shown).
[0165] The first obtaining subunit is configured to obtain specified network interaction data from obtained network interaction data between the terminal and the server. The specified network interaction data is network interaction data that includes a filter keyword.
[0166] The second obtaining subunit is configured to obtain, from the specified network interaction data obtained by the first obtaining subunit, network interaction data that includes a query keyword in order to obtain the target network interaction data. The query keyword includes a character of the filter keyword.
[0167] In another embodiment of the present disclosure, the network proxy server is integrated into the terminal, and the obtaining unit 110 includes a third obtaining subunit (not shown).
[0168] The third obtaining subunit is configured to obtain, from obtained network interaction data between the terminal and the server, network interaction data that includes the query keyword in order to obtain the target network interaction data.
[0169] In still another embodiment of the present disclosure, the network proxy server is integrated on a server side, and the obtaining unit 110 includes a sending subunit (not shown) and a receiving subunit (not shown).
[0170] The sending subunit is configured to send a filter keyword to the server. The filter keyword enables the server to obtain specified network interaction data from obtained network interaction data between the terminal and the server. The specified network interaction data is network interaction data that includes the filter keyword.
[0171] The sending subunit is further configured to send a query keyword to the server. The query keyword enables the server to obtain the target network interaction data from the specified network interaction data. The target network interaction data is network interaction data that includes the query keyword, and the query keyword includes at least a character of the filter keyword.
[0172] The receiving subunit is configured to receive the target network interaction data sent by the server.
[0173] In yet another embodiment of the present disclosure, the network proxy server is integrated into the server, and the obtaining unit 110 includes a sending subunit (not shown) and a receiving subunit (not shown).
[0174] The sending subunit is configured to send a query keyword to the server. The query keyword enables the server to obtain the target network interaction data from obtained network interaction data between the terminal and the server. The target network interaction data is network interaction data that includes the query keyword.
[0175] The receiving subunit is configured to receive the target network interaction data sent by the server.
[0176] The validation unit 120 is configured to validate the target network interaction data obtained by the obtaining unit 110.
[0177] The web page automated testing apparatus provided in this embodiment obtains target network interaction data between the terminal and a server using an obtaining unit 110. Then validates a network request in the target network interaction data using a validation unit 120, which improves a capability of finding a web page defect, and validates a response message returned by the server, which improves accuracy of a web page display validation result.
[0178] Corresponding to the foregoing web page automated testing method embodiment applied to the server, an embodiment of the present disclosure further provides a web page automated testing apparatus embodiment applied to the server.
[0179] Referring to
[0180] The obtaining unit 210 is configured to obtain target network interaction data between the server and a terminal.
[0181] The target network interaction data includes a network request that is received by the server and is sent by the terminal, and a response message sent by the server to the terminal. The response message is a response of the server to the network request sent by the terminal.
[0182] In an embodiment of the present disclosure, the obtaining unit 210 may include a receiving subunit (not shown) and an obtaining subunit (not shown).
[0183] The receiving subunit is configured to receive a query keyword sent by the terminal.
[0184] The obtaining subunit is configured to obtain the target network interaction data from obtained network interaction data between the server and the terminal, where the target network interaction data is network interaction data that includes the query keyword.
[0185] In another embodiment of the present disclosure, the obtaining unit 210 may include a receiving subunit (not shown) and an obtaining subunit (not shown).
[0186] The receiving subunit is configured to receive a filter keyword sent by the terminal.
[0187] The obtaining subunit is configured to obtain specified network interaction data from obtained network interaction data between the server and the terminal, where the specified network interaction data is network interaction data that includes the filter keyword received by the receiving subunit.
[0188] The receiving subunit is further configured to receive a query keyword sent by the terminal, where the query keyword includes a character of the filter keyword.
[0189] The obtaining subunit is further configured to obtain the target network interaction data from the specified network interaction data. The target network interaction data is network interaction data that includes the query keyword received by the receiving subunit.
[0190] The sending unit 220 is configured to send the target network interaction data obtained by the obtaining unit 210 to the terminal, where the target network interaction data is used by the terminal to validate the target network interaction data.
[0191] Corresponding to the foregoing web page automated testing apparatus embodiment, the present disclosure further provides a terminal, where the terminal includes a processor.
[0192] The processor is configured to obtain target network interaction data between the terminal and a server, and validate the target network interaction data.
[0193] The target network interaction data includes a network request sent by the terminal to the server, and a response message that is received by the terminal and is returned by the server. The response message is a response of the server to the network request sent by the terminal.
[0194] In an embodiment of the present disclosure, the processor is further configured to obtain specified network interaction data from network interaction data that is obtained by the terminal and is between the terminal and the server. The specified network interaction data is network interaction data that includes a filter keyword, and obtain, from the specified network interaction data, network interaction data that includes a query keyword in order to obtain the target network interaction data, where the query keyword includes a character of the filter keyword.
[0195] In another embodiment of the present disclosure, the processor is further configured to obtain, from network interaction data that is obtained by the terminal and is between the terminal and the server, network interaction data that includes the query keyword in order to obtain the target network interaction data.
[0196] Referring to
[0197] The transmitter 330 is configured to send a filter keyword to the server. The filter keyword enables the server to obtain specified network interaction data from obtained network interaction data between the terminal and the server. The specified network interaction data is network interaction data that includes the filter keyword.
[0198] The server is integrated with a network proxy server, and obtains the network interaction data between the terminal and the server using the network proxy server.
[0199] The transmitter 330 is further configured to send a query keyword to the server. The query keyword enables the server to obtain target network interaction data from the specified network interaction data. The target network interaction data is network interaction data that includes the query keyword, and the query keyword includes at least a character of the filter keyword.
[0200] The receiver 310 is configured to receive the target network interaction data sent by the server.
[0201] The processor 320 is configured to validate the target network interaction data received by the receiver 310.
[0202] Referring to
[0203] The transmitter 430 is configured to send a query keyword to the server. The query keyword enables the server to obtain target network interaction data from obtained network interaction data between the terminal and the server. The target network interaction data is network interaction data that includes the query keyword.
[0204] The receiver 410 is configured to receive the target network interaction data sent by the server.
[0205] The processor 420 is configured to validate the target network interaction data received by the receiver 410.
[0206] Corresponding to the foregoing terminal embodiment, the present disclosure further provides a server. As shown in
[0207] The receiver 510 is configured to receive a query keyword sent by a terminal.
[0208] The processor 520 is configured to obtain target network interaction data from obtained network interaction data between the server and the terminal.
[0209] The target network interaction data is network interaction data that includes the query keyword. The target network interaction data includes a network request that is received by the server and is sent by the terminal, and a response message sent by the server to the terminal. The response message is a response of the server to the network request sent by the terminal.
[0210] The transmitter 530 is configured to send the target network interaction data obtained by the processor 520 to the terminal such that the terminal validates the target network interaction data.
[0211] The server provided in this embodiment receives, a query keyword set by a terminal, obtains, from network interaction data between the terminal and the server using an internal integrated network proxy server, target network interaction data that includes the query keyword, and sends the target network interaction data to the terminal. The terminal validates the target network interaction data. This implements validation on network interaction data between a web page or a browser and the server, thereby improving a testing capability of a web page automated testing tool.
[0212] Referring to
[0213] The receiver 610 is configured to receive a filter keyword sent by the terminal.
[0214] The processor 620 is configured to obtain specified network interaction data from obtained network interaction data between the server and the terminal.
[0215] The specified network interaction data is network interaction data that includes the filter keyword.
[0216] The receiver 610 is further configured to receive a query keyword sent by the terminal.
[0217] The query keyword includes a character of the filter keyword.
[0218] The processor 620 is further configured to obtain target network interaction data from the specified network interaction data. The target network interaction data is network interaction data that includes the query keyword received by the receiver 610.
[0219] The transmitter 630 is configured to send the target network interaction data obtained by the processor 620 to the terminal, where the target network interaction data is used by the terminal to validate the target network interaction data.
[0220] The server provided in this embodiment receives, a filter keyword sent by a terminal, obtains, using an internal integrated network proxy server, specified network interaction data that includes the filter keyword, then receives, using the receiver, a query keyword sent by the terminal, obtains, from the specified network interaction data using the network proxy server, target network interaction data that includes the query keyword, and sends the target network interaction data to the terminal. The terminal validates the target network interaction data. This implements validation on network interaction data between a web page or a browser and the server, thereby improving a testing capability of a web page automated testing tool.
[0221] In another aspect, an embodiment of the present disclosure further provides a computer storage medium, where the computer storage medium may store a program, and the program may execute the method embodiments shown in
[0222] In still another aspect, an embodiment of the present disclosure further provides a computer storage medium, where the computer storage medium may store a program, and the program may execute the method embodiment shown in
[0223] The embodiments in this specification are all described in a progressive manner, for same or similar parts in the embodiments, reference may be made to these embodiments, and each embodiment focuses on a difference from other embodiments. Especially, apparatus or system embodiments are basically similar to a method embodiment, and therefore are described briefly. For related parts, reference may be made to partial descriptions in the method embodiment. The described apparatus and system embodiments are merely examples. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual requirements to achieve the objectives of the solutions of the embodiments. A person of ordinary skill in the art may understand and implement the embodiments of the present disclosure without creative efforts.
[0224] The present disclosure can be described in the general context of executable computer instructions executed by a computer, for example, a program module. Generally, the program unit includes a routine, program, object, component, data structure, and the like for executing a particular task or implementing a particular abstract data type. The present disclosure may also be practiced in distributed computing environments in which tasks are performed by remote processing devices that are connected using a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
[0225] It should be noted that in this specification, relational terms such as “first” and “second” are only used to distinguish one entity or operation from another, and do not necessarily require or imply that any actual relationship or sequence exists between these entities or operations. Moreover, the terms “include,” “include,” or their any other variant is intended to cover a non-exclusive inclusion such that a process, a method, an article, or a device that includes a list of elements not only includes those elements but also includes other elements that are not expressly listed, or further includes elements inherent to such a process, method, article, or device. An element preceded by “includes a . . . ” does not, without more constraints, preclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0226] The foregoing descriptions are merely specific implementation manners of the present disclosure. It should be noted that a person of ordinary skill in the art may make several improvements or polishing without departing from the principle of the present disclosure and the improvements or polishing shall fall within the protection scope of the present disclosure.