WO2016033765A1 - 网页自动化测试方法及装置 - Google Patents

网页自动化测试方法及装置 Download PDF

Info

Publication number
WO2016033765A1
WO2016033765A1 PCT/CN2014/085876 CN2014085876W WO2016033765A1 WO 2016033765 A1 WO2016033765 A1 WO 2016033765A1 CN 2014085876 W CN2014085876 W CN 2014085876W WO 2016033765 A1 WO2016033765 A1 WO 2016033765A1
Authority
WO
WIPO (PCT)
Prior art keywords
interaction data
network interaction
terminal
server
target network
Prior art date
Application number
PCT/CN2014/085876
Other languages
English (en)
French (fr)
Inventor
高旭东
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP14901286.6A priority Critical patent/EP3179370A4/en
Priority to CN201480045943.4A priority patent/CN105579976B/zh
Priority to PCT/CN2014/085876 priority patent/WO2016033765A1/zh
Priority to US15/508,648 priority patent/US20170277622A1/en
Publication of WO2016033765A1 publication Critical patent/WO2016033765A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/033Test or assess software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2119Authenticating web pages, e.g. with suspicious links
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1433Vulnerability analysis

Definitions

  • the present invention relates to the field of webpage testing technology, and in particular, to a webpage automated testing method and apparatus.
  • the webpage is an important platform for network information exchange. Because of the diversity and uncertainty of the content and functions it carries, it needs to design its content according to different application requirements and network environment. To ensure the reliability of webpage performance, it also needs Test the designed web page.
  • Web page automation test is an automated verification of the input and output of the web page being tested.
  • webpage automated testing work is done through webpage automated testing tools.
  • the working principle of webpage automated testing tools is recording and playback. Recording refers to the use of webpage automated testing tools to record user operations on browsers and web pages in chronological order.
  • the recognized script; the playback is the webpage automated test tool to read the previously recorded script, simulate the behavior of the user before, and operate the browser and the webpage.
  • the user's operation on the browser and the webpage is input, and the result of the operation is output, and the operation result also changes with the content of the webpage.
  • the automated test of the web page is to simulate the user's input and verify the output, that is, verify the result of the input operation.
  • a user In a specific network environment, a user usually operates a web page through a browser at a network terminal, and the content and functions of the web page need to be supported by the server. Therefore, for the data interaction between the browser and the server, it is also a part of the input and output of the web page.
  • the network request sent by the browser to the server is an output; the response fed back by the server is an input.
  • This interaction process affects the presentation of the web page and is part of the test.
  • only the operation of the webpage by the user through the browser can be recorded, the operation between the browser or the webpage and the server cannot be recorded, and the response of the server cannot be verified.
  • the lack of verification of network requests will inevitably lead to low ability to discover webpage defects, and even some defects cannot be found.
  • the user enters the character "abc" in the search box of the webpage, and then clicks the search button on the webpage, and the search character in the web request sent by the webpage is "abc+space", and the webpage finally displays the search "abc+space” to get
  • the search content is much smaller than the search content obtained by searching for "abc”.
  • the current webpage automated test method cannot find such problems.
  • the lack of verification of the response message to the server will inevitably lead to a decrease in the accuracy of the verification result displayed on the web page, and even some pages may not be verified due to lack of judgment basis.
  • the current webpage automated testing method has low ability to find webpage defects, and the webpage displays The accuracy of the verification result is low.
  • a method and a device for automatically testing a webpage are provided to solve the problem that the defect in the prior art is low, and the accuracy of the verification result of the webpage display is low.
  • the present invention provides a webpage automated testing method, including:
  • the terminal acquires target network interaction data between the terminal and the server;
  • the target network interaction data includes a network request sent by the terminal to the server, and a response message returned by the terminal received by the terminal;
  • the response message is a response of the server to a network request sent by the terminal;
  • the terminal verifies the target network interaction data.
  • the acquiring, by the terminal, the target network interaction data between the terminal and the server includes:
  • the terminal obtains the network interaction data including the query keyword from the specified network interaction data, and obtains the target network interaction data; the query keyword includes the character of the filter keyword.
  • the acquiring, by the terminal, the target network interaction data between the terminal and the server includes:
  • the terminal obtains network interaction data including the query keyword from the network interaction data between the terminal and the server obtained by the terminal, and obtains target network interaction data.
  • the acquiring, by the terminal, the target network interaction data between the terminal and the server includes:
  • the terminal sends a filtering keyword to the server, where the filtering keyword is used to enable the server to obtain specified network interaction data from the obtained network interaction data between the terminal and the server, where the specified network interaction data is included
  • the network interaction data of the filtering keyword
  • the terminal sends a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from the specified network interaction data, where the target network interaction data is a network including the query keyword.
  • the terminal receives the target network interaction data sent by the server.
  • the acquiring, by the terminal, the target network interaction data between the terminal and the server includes:
  • the terminal sends a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from the obtained network interaction data between the terminal and the server, where the target network interacts
  • the data is network interaction data including the query keyword
  • the terminal receives the target network interaction data sent by the server.
  • the present invention also provides a webpage automated testing method, including:
  • the server acquires target network interaction data between the server and the terminal;
  • the target network interaction data includes a network request sent by the terminal received by the server, 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;
  • the server sends the target network interaction data to the terminal, where the target network interaction data is used by the terminal to verify the target network interaction data.
  • the server acquires target network interaction data between the server and the terminal, including:
  • the server obtains target network interaction data from the obtained network interaction data between the server and the terminal, where the target network interaction data is network interaction data including the query keyword.
  • the server acquires target network interaction data between the server and the terminal, including:
  • the server obtains specified network interaction data from the obtained network interaction data between the server and the terminal, where the specified network interaction data is network interaction data including the filtering keyword;
  • the server receives a query keyword sent by the terminal; the query keyword includes a character of the filter keyword;
  • the server obtains target network interaction data from the specified network interaction data, where the target network interaction data is network interaction data including the query keyword.
  • the present invention provides a webpage automatic testing device, which is applied to a terminal, and includes:
  • An acquiring unit configured to acquire target network interaction data between the terminal and the server;
  • the target network interaction data includes a network request sent by the terminal to the server, and a response message returned by the terminal received by the terminal
  • the response message is a response of the server to a network request sent by the terminal;
  • a verification unit configured to perform verification on the target network interaction data obtained by the acquiring unit.
  • the acquiring unit includes:
  • a first obtaining subunit configured to use, in the network interaction data between the obtained terminal and the server, Obtaining specified network interaction data, where the specified network interaction data is network interaction data including a filtering keyword;
  • a second obtaining subunit configured to obtain, from the specified network interaction data obtained by the first acquiring subunit, network interaction data including a query keyword, to obtain the target network interaction data; and the query keyword includes The character of the filtering keyword.
  • the acquiring unit includes:
  • a third obtaining subunit configured to obtain network interaction data including the query keyword from the obtained network interaction data between the terminal and the server, to obtain target network interaction data.
  • the acquiring unit includes: a sending subunit and a receiving subunit;
  • the sending subunit is configured to send a filtering keyword to the server, where the filtering keyword is used to enable the server to obtain specified network interaction data from the obtained network interaction data between the terminal and the server. Specifying network interaction data as network interaction data including the filtering keyword;
  • the sending subunit is further configured to send a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from the specified network interaction data, where the target network interaction data is Network interaction data including the query keyword; the query keyword includes at least characters of the filter keyword;
  • the receiving subunit is configured to receive the target network interaction data sent by the server.
  • the acquiring unit includes: a sending subunit and a receiving subunit;
  • the sending subunit is configured to send a query keyword to the server, where the query keyword is used to enable the server to acquire a target network interaction from the obtained network interaction data between the terminal and the server.
  • Data, the target network interaction data is network interaction data including the query keyword;
  • the receiving subunit is configured to receive the target network interaction data sent by the server.
  • the present invention further provides a terminal, including:
  • a processor configured to acquire target network interaction data between the terminal and the server;
  • the target network interaction data includes a network request sent by the terminal to the server, and a response returned by the terminal received by the terminal a message;
  • the response message is a response of the server to a network request sent by the terminal;
  • the processor is further configured to verify the target network interaction data.
  • the processor is specifically configured to:
  • the network interaction data including the query keyword from the specified network interaction data, and obtaining the target network interaction data; the query keyword includes the character of the filtering keyword.
  • the processor is specifically configured to:
  • the method further includes: a transmitter and a receiver; the transmitter is connected to the processor; and the receiver is connected to the processor;
  • the sender is configured to send, to the server, a filtering keyword, where the filtering keyword is used to enable the server to obtain specified network interaction data from the obtained network interaction data between the terminal and the server, where Specifying network interaction data as network interaction data including the filtering keyword;
  • the sender is further configured to send a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from the specified network interaction data, where the target network interaction data is included
  • the network interaction data of the query keyword includes at least a character of the filter keyword
  • the receiver is configured to receive the target network interaction data sent by the server, and send the target network interaction data to the processor.
  • the method further includes: a transmitter and a receiver, where the transmitter is connected to the processor, and the receiver is connected to the processor;
  • the sender is configured to send a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from network interaction data between the obtained terminal and the server,
  • the target network interaction data is network interaction data including the query keyword;
  • the receiver is configured to receive the target network interaction data sent by the server, and provide the target network interaction data to the processor.
  • the present invention provides a webpage automatic testing device, including:
  • An acquiring unit configured to acquire target network interaction data between the server and the terminal;
  • the target network interaction data includes a network request sent by the terminal received by the server, and a response message sent by the server to the terminal;
  • the response message is a response of the server to a network request sent by the terminal;
  • a sending unit configured to send the target network interaction data obtained by the acquiring unit to the terminal, where the target network interaction data is used by the terminal to verify the target network interaction data.
  • the acquiring unit includes: a receiving subunit and an acquiring subunit;
  • a receiving subunit configured to receive a query keyword sent by the terminal
  • Obtaining a subunit configured to acquire target network interaction data from the obtained network interaction data between the server and the terminal, where the target network interaction data is the query keyword received by the receiving subunit Network interaction data.
  • the acquiring unit includes: a receiving subunit and an acquiring subunit;
  • the receiving subunit is configured to receive a filtering keyword sent by the terminal;
  • the acquiring subunit is configured to obtain specified network interaction data from the obtained network interaction data between the server and the terminal, where the specified network interaction data is the filtering included in the receiving subunit Network interaction data for keywords;
  • the receiving subunit is further configured to receive a query keyword sent by the terminal; the query keyword includes a character of the filtering keyword;
  • the acquiring subunit is further configured to obtain target network interaction data from the specified network interaction data, where the target network interaction data is network interaction data that includes the query keyword received by the receiving subunit.
  • the present invention provides a server, including a processor and a transmitter, the transmitter being connected to the processor:
  • the processor is configured to acquire target network interaction data between the server and the terminal;
  • the target network interaction data includes a network request sent by the terminal received by the server, and the server sends the network request to the terminal Response message;
  • the response message is a response of the server to a network request sent by the terminal;
  • the transmitter is configured to send the target network interaction data obtained by the processor to the terminal, where the target network interaction data is used by the terminal to verify the target network interaction data.
  • the method further includes: a receiver, where the receiver is connected to the processor;
  • the receiver is configured to receive a query keyword sent by the terminal
  • the processor is configured to obtain target network interaction data from network interaction data between the obtained server and the terminal, where the target network interaction data is the query keyword that is sent by the receiver. Network interaction data.
  • the method further includes: a receiver, where the receiver is connected to the processor;
  • the receiver is configured to receive a filtering keyword sent by the terminal
  • the processor is configured to obtain specified network interaction data from the obtained network interaction data between the server and the terminal, where the specified network interaction data is the filtering keyword that is sent by the receiver.
  • Network interaction data is the filtering keyword that is sent by the receiver.
  • the receiver is further configured to receive a query keyword sent by the terminal; the query keyword includes a character of the filter keyword;
  • the processor is configured to obtain target network interaction data from the specified network interaction data, where the target network interaction data is network interaction data that includes the query keyword sent by the receiver.
  • the present invention also provides a computer storage medium, the computer storage medium storing a program, the program comprising the steps of any of the possible implementations of the first aspect.
  • the present invention further provides a computer storage medium, the computer storage medium storing a program, the program comprising the steps of any of the possible implementations of the second aspect.
  • the webpage automatic testing method obtained by the embodiment of the invention obtains the specified network interaction data between the browser and the server in the terminal. Then, the target network interaction data is determined from the specified network interaction data, and the parameters of the network request in the target network interaction data are parsed, and the network request sent by the terminal is verified to be correct, thereby improving the capability of detecting webpage defects. And parsing the parameters of the response message returned by the server, verifying whether the content displayed on the webpage on the browser is accurate, and improving the accuracy of the verification result displayed by the webpage.
  • FIG. 1 is a block diagram of a network proxy module according to an embodiment of the present invention.
  • FIG. 2 is a schematic flow chart of a method for automatically testing a webpage according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart diagram of a method of S110 in FIG. 2 according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart diagram of another method of S110 in FIG. 2 according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart diagram of still another method of S110 in FIG. 2 according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart diagram of another webpage automatic testing method according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart diagram of still another method for automatically testing a webpage according to an embodiment of the present invention.
  • FIG. 8 is a schematic flowchart diagram of still another method for automatically testing a webpage according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a webpage automatic testing device according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another webpage automatic testing device according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of another terminal according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a server according to an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of a server according to an embodiment of the present invention.
  • FIG. 1 a structural diagram of a network proxy module provided by an embodiment of the present application is shown. As shown in FIG. 1 , unlike a conventional network proxy module, except that the receiving unit 1 and the sending unit 2 are included, Also included is a filter unit 3, a storage unit 4, and an open interface 5.
  • the filtering unit 3 has a function of performing preliminary filtering on network interaction data.
  • the browser generates a lot of requests during the loading of the web page, for example, CSS (Cascading Style Sheets), JS (JavaScript), images, music, business data requests (for example, the pages contained in the web page) Data) and so on.
  • the network proxy module needs to save the network request and response message that the webpage test engineer pays attention to.
  • the network request and response message can be filtered by the filtering unit 3.
  • the storage unit 4 is configured to store network request and response messages and provide them to the webpage automated testing tool through the open interface 5.
  • FIG. 2 a schematic flowchart of a method for automatically testing a webpage according to an embodiment of the present invention is shown.
  • the method is applied to a terminal, and the terminal may be a PC, a laptop, a tablet, a smart phone, or the like capable of browsing a webpage.
  • Terminal Equipment a PC, a laptop, a tablet, a smart phone, or the like capable of browsing a webpage.
  • the terminal in this embodiment is integrated with a webpage automation testing tool, wherein the network proxy module shown in FIG. 1 acquires network interaction data between the terminal and the server, and then provides the network interaction data to the webpage automation testing tool. Finally, the network interaction data is verified by a webpage automated testing tool.
  • the method includes steps S110-S120:
  • the terminal acquires target network interaction data between the terminal and the server.
  • the target network interaction data includes a network request sent by the terminal to the server, and the terminal receives the The response message returned by the server; wherein the response message is a response of the server to a network request sent by the terminal.
  • the webpage automation test tool in the terminal starts the network proxy module, then calls the browser, and sets the address of the network proxy module to the browser.
  • the webpage automation test tool operates the browser, the browser sends a corresponding network request through the terminal, the network proxy module receives the network request, and forwards the network request to the server; the network proxy module receives the response returned by the server to the network After the response message is requested, the network proxy module copies and stores the target network interaction data between the terminal and the server while transmitting the response message to the browser.
  • the network automation test tool starts the network proxy module by means of initialization.
  • the network automation test tool starts the network proxy module by a startup command.
  • the network interaction data that the network engineer really wants to test may be only a certain 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 webpage test engineer really wants to test.
  • the webpage test engineer sets one or more query keywords by using a webpage automation test tool in the terminal, and passes the query keyword to the network proxy module through the open interface of the network proxy module, and the obtained by the network proxy module Obtaining target network interaction data in the network interaction data between the terminal and the server, where the target network interaction data is network interaction data including the query keyword.
  • the terminal checks the target network interaction data.
  • the webpage automation test tool determines whether the operation of the browser or the webpage is consistent with the parameter in the network request, and if consistent, the network request sent by the browser or the webpage is accurate; otherwise, the browser is indicated. Or the web request from the web page is inaccurate.
  • the user inputs the character “abc” in the search bar of the webpage to obtain a network request sent by the terminal to the server, and determines whether the network request is consistent with the operation of the webpage by the user; the webpage automated testing tool parses the response message, and determines the parsed message and Whether the content displayed on the web page is consistent, so as to verify whether the content displayed on the webpage is accurate.
  • the terminal acquires target network interaction data between the terminal and the server through a network proxy module. Then, the webpage automation test tool is used to check the network request in the target network interaction data, thereby improving the ability to discover webpage defects; and verifying the response message returned by the server, thereby improving the accuracy of the verification result displayed on the webpage. rate.
  • the specific process for the terminal in FIG. 2 to acquire the target network interaction data between the terminal and the server may be classified into the following two categories:
  • the network proxy module is integrated on the terminal side
  • FIG. 3 a schematic flowchart of a method for acquiring target network interaction data according to an embodiment of the present invention is shown.
  • the method is applied to a terminal, where the method obtains target network interaction data by filtering keywords and query keywords.
  • the method includes the following steps:
  • S1111 Obtain the specified network interaction data from the network interaction data obtained by the terminal, and specify the network interaction data as the network interaction data that includes the filtering keyword.
  • the network proxy module filters the network interaction data including the filtering keyword from the received network interaction data between the terminal and the server, and obtains the specified network interaction data.
  • the network test engineer can set one or more filter keywords through the webpage automation test tool and pass the filter keywords to the network proxy module through the open interface of the network proxy module.
  • the network proxy module only obtains the network interaction data including the filtering keyword, and obtains the specified network interaction data. That is, the specified network interaction data is part of the network interaction data between the terminal and the server.
  • the network proxy module determines whether the received network interaction data between the terminal and the server includes a filtering keyword, and if the filtering keyword is included, copies and stores the network interaction data including the filtering keyword into the storage In the unit; if no filter keyword is included, no processing is performed on the network interaction data. Then, continue to determine whether the next pair of network interaction data contains filtering keywords.
  • the webpage test engineer can set the filtering keyword at any time. For example, it can be set when the network proxy module is started, and the filtering keyword can be set after the network proxy module runs for a period of time, and the network proxy module receives the filtering key. After the word is used, the network interaction data is filtered, copied and saved. Filter network interaction data for keywords.
  • S1112 Obtain target network interaction data from the specified network interaction data.
  • the target network interaction data is network interaction data including a query keyword; the query keyword includes characters of the filter keyword.
  • the network test engineer can set the query keyword through the webpage automation test tool, and pass the query keyword to the network proxy module through the open interface of the network proxy module.
  • the network proxy module determines whether there is network interaction data including a query keyword in the specified network interaction data stored in the storage unit; if there is network interaction data including the query keyword, the network interaction including the query keyword is included The data is fed back to the webpage automated testing tool to obtain the target network interaction data; if there is no network interaction data including the query keyword, the web automation test tool returns null. It can be seen that the target network interaction data is a part of the network interaction data in the specified network interaction data.
  • the method for obtaining target network interaction data provided by this embodiment, setting a filtering keyword, and the network proxy module in the terminal acquires specified network interaction data from the received network interaction data between the terminal and the server; and then setting The query keyword obtains the target network interaction data from the obtained network interaction data obtained by the network proxy module in the terminal.
  • the storage unit of the network proxy module only needs to store network interaction data including the filtering keyword, which greatly saves storage space.
  • the terminal obtains network interaction data including the query keyword from the obtained network interaction data, and obtains target network interaction data. That is, the terminal obtains the target network interaction data only by querying the keyword.
  • the network proxy module in the terminal acquires network interaction data between the terminal and the server, and copies the network interaction data and stores the data in the storage unit, and receives the query keyword transmitted by the webpage automated testing tool. Then, the network interaction data including the query keyword is obtained from the storage unit and sent to the webpage automation testing tool, so that the webpage automated testing tool verifies the network request and the corresponding response message in the target network interaction data.
  • FIG. 4 a flowchart of another method for acquiring target network interaction data according to an embodiment of the present invention is shown.
  • the method is applied to a terminal, and the method is similar to the embodiment shown in FIG. 3, as shown in FIG.
  • the method can Includes the following steps:
  • the terminal sends a filtering keyword to the server.
  • the filtering keyword is used to enable the server to obtain specified network interaction data from the obtained network interaction data between the terminal and the server, where the specified network interaction data is network interaction data including the filtering keyword.
  • S1122 The terminal sends a query keyword to the server.
  • the query keyword is used to enable the server to obtain target network interaction data from the specified network interaction data, where the target network interaction data is network interaction data including the query keyword; the query keyword includes at least The character of the filtering keyword.
  • S1123 The terminal receives the target network interaction data sent by the server.
  • the network interaction data including the filtering keyword is specified network interaction data; and the network interaction data including the query keyword in the network interaction data is specified as the target network interaction data.
  • the target network interaction data is the network interaction data that the webpage automation test tool needs to verify. Therefore, the target network interaction data only needs to be sent to the terminal, and the specified network interaction data does not need to be sent to the terminal.
  • the terminal transmits the filtering keyword to the server, so that the server only obtains the specified network interaction data from the received network interaction data between the terminal and the server; then, the terminal sends the data to the server.
  • the query keyword is passed, and the server obtains the target network interaction data from the obtained specified network interaction data. In this way, the server side only needs to store the specified network interaction data, which greatly saves storage space.
  • the network proxy module in the server filters the received network interaction data between the server and the terminal to obtain target network interaction data, the target network.
  • the interaction data is network interaction data containing the query keywords.
  • S1131 The terminal sends a query keyword to the server, where the query keyword is used to enable the server to query target network interaction data from the obtained network interaction data, where the target network interaction data is included in the query keyword.
  • Network interaction data is used to enable the server to query target network interaction data from the obtained network interaction data, where the target network interaction data is included in the query keyword.
  • the terminal receives the target network interaction data sent by the server.
  • the terminal transmits the query keyword to the server, so that the server obtains the network interaction data including the query keyword from the network interaction data between the terminal and the server, and includes the query keyword.
  • the network interaction data is fed back to the terminal.
  • FIG. 6 a flow chart of another webpage automatic testing method according to an embodiment of the present invention is shown.
  • the method is applied to the terminal, and the method may further include steps S210 to S220 on the basis of the embodiment shown in FIG. 2; wherein S110 to S120 in FIG. 6 are the same as those shown in FIG. 2, and details are not described herein again.
  • the terminal deletes network interaction data that includes the feature characters.
  • the webpage automation test tool in the terminal sends a delete instruction to the network proxy module in the terminal through the open interface, where the delete instruction includes the feature character.
  • the network proxy module receives the delete instruction, the network interaction data including the feature character is deleted.
  • the feature character may be any one of a network request or a response message, for example, when the webpage automated test tool performs two identical operations on the browser or the webpage, and requires a network for the second operation.
  • the webpage automated test tool performs two identical operations on the browser or the webpage, and requires a network for the second operation.
  • the last network request and response message needs to be deleted before the second operation.
  • the terminal deletes all obtained network interaction data between itself and the server.
  • the webpage automation test tool in the terminal sends an empty command to the network proxy module through the open interface, and after receiving the clearing instruction, the network proxy module clears all network interaction data stored in the storage unit, thereby Save storage space.
  • S210 and S220 are not strictly limited, and S220 may be executed first, and then S210 may be executed. It is only necessary to ensure that S210 to S220 are executed after the network proxy module stores the network interaction data.
  • the webpage automatic testing method provided by the embodiment can delete the network interaction data of the features already stored in the network proxy module in the terminal, and can clear all the stored network interaction data, thereby saving the storage space of the network proxy module.
  • the present invention also provides an embodiment of the webpage automation test method applied to the server side.
  • FIG. 7 a schematic flowchart of another method for automatically testing a webpage according to an embodiment of the present invention is shown.
  • the method is applied to a server. As shown in FIG. 7, the method includes the following steps:
  • the server acquires target network interaction data between the server and the terminal.
  • the target network interaction data includes a network request sent by the terminal received by the server, and a response message sent by the server to the terminal; the response message is a network request sent by the server to the terminal. response.
  • S310 can be implemented in the following two ways:
  • Step 1) The server receives the query keyword sent by the terminal;
  • Step 2) the server obtains the mesh from the obtained network interaction data between the server and the terminal.
  • the target network interaction data is network interaction data including the query keyword.
  • the terminal side sets a query keyword
  • the server filters the network interaction data including the query keyword from the obtained network interaction data between the terminal and the terminal.
  • Step 12 The server acquires specified network interaction data from the obtained network interaction data between the server and the terminal, where the specified network interaction data is network interaction data including the filtering keyword.
  • the server sends the target network interaction data to the terminal, so that the terminal checks the target network interaction data.
  • the server obtains the target network interaction data between itself and the terminal, and then sends the target network interaction data to the terminal, and the terminal checks the target network interaction data to implement the Verification of a web page or browser.
  • the method may further include:
  • the server receives a delete instruction sent by the terminal, where the delete instruction includes a feature character.
  • the server deletes network interaction data that includes the feature character according to the deletion instruction.
  • the server receives an empty instruction sent by the terminal.
  • S360 The server deletes all stored network interaction data.
  • the server provided in this embodiment obtains the specified network interaction data sent by the browser to the server through the network proxy module.
  • the target network interaction data is then obtained from the specified network interaction data and provided to the webpage automated testing tool.
  • the webpage automation test tool verifies the target network interaction data, thereby verifying the network interaction between the browser or the webpage and the server, and improving the ability to test webpage defects.
  • the foregoing method embodiments applied to the network proxy module and the method embodiments applied to the webpage automation test tool may all be integrated into the webpage automation test tool, or may be independently implemented.
  • FIG. 8 a schematic flowchart of a webpage automated testing method is shown. As shown in FIG. 8, the method includes the following steps:
  • Web automation test tools are integrated into the terminal. Web automation if the network proxy module is integrated in the terminal Within the test tool, the webpage automation test tool initializes the network proxy module; if the network proxy module is integrated in the server, the webpage automation test tool starts the network proxy module by command.
  • the webpage automation test tool delivers the filtering keyword to the filtering unit in the network proxy module.
  • the filter keyword is "wd##
  • the web automation test tool invokes the browser and sets the browser's proxy address.
  • the webpage automated testing tool operates the webpage to cause the browser to make a network request.
  • the webpage automated testing tool opens the webpage "http://www.baidu.com” on the browser and searches for "1" through the Baidu search engine.
  • the browser sends a web request and receives a response message returned by the server, displaying the search result. page.
  • the network proxy module receives the network request and forwards the request to the corresponding server.
  • the network proxy module receives a response message returned by the server, where the response message is a response of the server to a network request sent by the terminal.
  • step S470 The network proxy module determines whether the filtering keyword is included in the network request and response message. If yes, step S480 is performed; if not, step S490 is performed.
  • the network proxy module copies the network request and response message and saves it to the storage unit. Then execute S490.
  • the network proxy module returns a response message returned by the server to the browser.
  • the webpage automation test tool passes the query keyword to the filtering unit.
  • the filtering unit determines whether a network request and response message including the query keyword exists in the storage unit. If yes, execute S4120; if not, execute S4130.
  • S4120 Return a network request and response message including the query keyword to a webpage automated testing tool.
  • the storage unit contains multiple pairs of network request and response messages containing the query key, only the first pair of network request and response messages containing the query key are returned.
  • the webpage automation test tool verifies the receipt of the network request and response message.
  • steps S440 to S4140 are repeatedly performed to implement verification of multiple pairs of network request and response messages.
  • the webpage automation test tool sends a delete instruction to the network proxy module, where the delete instruction includes a feature character.
  • the network proxy module deletes a network request including the feature character and a corresponding response message according to the deletion instruction.
  • the webpage automation test tool sends an empty instruction to the network proxy module.
  • the network proxy module deletes all network request and response messages in the storage unit according to the clearing instruction.
  • the present invention also provides a webpage automatic test apparatus.
  • FIG. 9 a schematic structural diagram of a webpage automatic testing device according to an embodiment of the present invention is shown.
  • the device is applied to a terminal.
  • the device includes: an obtaining unit 110 and a checking unit 120.
  • the obtaining unit 110 is configured to acquire target network interaction data between the terminal and the server.
  • the network interaction data between the terminal and the server may be obtained by using a network proxy module.
  • the target network interaction data includes a network request sent by the terminal to the server, and a response message returned by the server received by the terminal; the response message is a network request sent by the server to the terminal. response;
  • the network proxy module is integrated in the terminal, and the obtaining unit may include: a first acquiring subunit and a second acquiring subunit.
  • the first obtaining sub-unit is configured to obtain, according to the obtained network interaction data between the terminal and the server, specified network interaction data, where the specified network interaction data is network interaction data including a filtering keyword;
  • the second obtaining subunit is configured to obtain, from the specified network interaction data obtained by the first acquiring subunit, network interaction data including a query keyword, to obtain the target network interaction data;
  • the word contains the characters of the filtered keyword.
  • the network proxy module is integrated in the terminal, and the obtaining unit includes a third acquiring subunit;
  • the third obtaining subunit is configured to obtain network interaction data including the query keyword from the obtained network interaction data between the terminal and the server, to obtain target network interaction data.
  • the network proxy module is integrated on the server side, and the obtaining unit includes: a sending subunit and a receiving subunit;
  • the sending subunit is configured to send a filtering keyword to the server, where the filtering keyword is used to enable the server to obtain specified network interaction data from the obtained network interaction data between the terminal and the server,
  • the specified network interaction data is network interaction data including the filtering keyword;
  • the sending subunit is further configured to send a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from the specified network interaction data, where the target network interaction data is Network interaction data including the query keyword; the query keyword includes at least characters of the filter keyword;
  • the receiving subunit is configured to receive the target network interaction data sent by the server.
  • the network proxy module is integrated in a server, and the obtaining unit includes: a sending subunit and a receiving subunit;
  • the sending subunit is configured to send a query keyword to the server, where the query keyword is used to enable the server to acquire a target network interaction from the obtained network interaction data between the terminal and the server.
  • Data, the target network interaction data is network interaction data including the query keyword;
  • the receiving subunit is configured to receive the target network interaction data sent by the server.
  • the checking unit 120 is configured to check the target network interaction data obtained by the acquiring unit 110.
  • the webpage automatic testing device obtained in this embodiment obtains target network interaction data between the terminal and the server by using an acquiring unit. Then, the verification unit performs verification on the network request in the target network interaction data, thereby improving the ability to discover webpage defects; and verifying the response message returned by the server, thereby improving the accuracy of the verification result displayed on the webpage. .
  • the embodiment of the invention further provides an embodiment of the webpage automatic testing device applied to the server.
  • FIG. 10 a schematic structural diagram of another webpage automatic testing apparatus according to an embodiment of the present invention is shown.
  • the apparatus is applied to a server, and the apparatus includes: an obtaining unit 210 and a sending unit 220.
  • the obtaining unit 210 is configured to acquire target network interaction data between the server and the terminal.
  • the target network interaction data includes a network request sent by the terminal received by the server, and a response message sent by the server to the terminal; the response message is a network request sent by the server to the terminal. response.
  • the obtaining unit 210 may include: a receiving subunit and an obtaining subunit.
  • the receiving subunit is configured to receive a query keyword sent by the terminal.
  • the obtaining subunit is configured to obtain target network interaction data from the obtained network interaction data between the server and the terminal, where the target network interaction data is a network interaction number including the query keyword. according to.
  • the obtaining unit 210 may include: a receiving subunit and an obtaining subunit.
  • the receiving subunit is configured to receive a filtering keyword sent by the terminal.
  • the acquiring subunit is configured to obtain specified network interaction data from the obtained network interaction data between the server and the terminal, where the specified network interaction data is the filtering keyword received by the receiving subunit Network interaction data.
  • the receiving subunit is further configured to receive a query keyword sent by the terminal; the query keyword includes a character of the filtering keyword.
  • the acquiring subunit is further configured to obtain target network interaction data from the specified network interaction data, where the target network interaction data is network interaction data that includes the query keyword received by the receiving subunit.
  • the sending unit 220 is configured to send the target network interaction data obtained by the acquiring unit 210 to the terminal, where the target network interaction data is used by the terminal to verify the target network interaction data.
  • the present invention further provides a terminal, the terminal comprising: a processor;
  • the processor is configured to acquire target network interaction data between the terminal and the server; and verify the target network interaction data.
  • the target network interaction data includes a network request sent by the terminal to the server, and a response message returned by the server received by the terminal; the response message is a network request sent by the server to the terminal. response;
  • the processor is specifically configured to:
  • the specified network interaction data is network interaction data including a filtering keyword
  • the network interaction data including the query keyword from the specified network interaction data, and obtaining the target network interaction data; the query keyword includes the character of the filtering keyword.
  • the processor is specifically configured to: obtain network interaction data including the query keyword from network interaction data between the terminal and the server obtained by the terminal , get the target network interaction data.
  • FIG. 11 it is a schematic structural diagram of another terminal according to an embodiment of the present invention.
  • the terminal is integrated with a webpage automatic testing tool.
  • the terminal includes: a transmitter 330 and a processor 320. And a receiver 310, wherein the transmitter 330 is connected to the processor 320, and the receiver 310 is connected to the processor 320;
  • the sender 330 is configured to send, to the server, a filtering keyword, where the filtering keyword is used to enable the server to obtain specified network interaction data from the obtained network interaction data between the terminal and the server.
  • the specified network interaction data is network interaction data including the filtering keyword.
  • a network proxy module is integrated in the server, and network interaction data between the terminal and the server is obtained through a network proxy module.
  • the sender 330 is further configured to send a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from the specified network interaction data, where the target network interaction data is Network interaction data including the query keyword; the query keyword includes at least characters of the filter keyword.
  • the receiver 310 is configured to receive the target network interaction data sent by the server.
  • the processor 320 is configured to perform verification on the target network interaction data received by the receiver 310.
  • the terminal includes: a transmitter 430, a processor 420, and a receiver 410, where the transmitter 430 is coupled to the processor 420, and the receiver 410 is coupled to the processor 420.
  • the sender 430 is configured to send a query keyword to the server, where the query keyword is used to enable the server to obtain target network interaction data from network interaction data between the obtained terminal and the server.
  • the target network interaction data is network interaction data including the query keyword;
  • the receiver 410 is configured to receive the target network interaction data sent by the server.
  • the processor 420 is configured to perform verification on the target network interaction data received by the receiver 410.
  • the present invention further provides a server.
  • the server includes: a receiver 510, a processor 520, and a transmitter 530, wherein the transmitter 530 and the server The processor 520 is connected, and the receiver 510 is connected to the processor 520.
  • the receiver 510 is configured to receive a query keyword sent by the terminal.
  • the processor 520 is specifically configured to obtain target network interaction data from the obtained network interaction data between the server and the terminal.
  • the target network interaction data is network interaction data including the query keyword.
  • the target network interaction data includes a network request sent by the terminal received by the server, and the server sends the terminal to the terminal.
  • the response message sent; the response message is a response of the server to a network request sent by the terminal.
  • the transmitter 530 is configured to send the target network interaction data obtained by the processor 520 to the terminal, so that the terminal checks the target network interaction data.
  • the server provided in this embodiment receives the query keyword set by the terminal through the receiver.
  • the target network interaction data including the query keyword in the network interaction data between the server and the terminal is obtained by the internally integrated network proxy module, and the target network interaction data is sent to the terminal.
  • the target network interaction data is verified by the terminal, thereby realizing verification of network interaction data between the webpage or the browser and the server, and improving the testing capability of the webpage automatic testing tool.
  • FIG. 14 a schematic structural diagram of another server according to an embodiment of the present invention is shown.
  • the server is integrated with a network proxy module.
  • the server includes: a receiver 610, a processor 620, and a transmitter. 630, wherein the transmitter 630 is connected to the processor 620, and the receiver 610 is connected to the processor 620.
  • the receiver 610 is configured to receive a filtering keyword sent by the terminal.
  • the processor 620 is configured to obtain specified network interaction data from the obtained network interaction data between the server and the terminal.
  • the specified network interaction data is network interaction data including the filtering keyword.
  • the receiver 610 is further configured to receive a query keyword sent by the terminal.
  • the query keyword contains characters of the filtered keyword.
  • the processor 620 is further configured to obtain target network interaction data from the specified network interaction data, where the target network interaction data is network interaction data that includes the query keyword received by the receiver 610.
  • 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 verify the target network interaction data.
  • the server receives the filtering keyword sent by the terminal through the receiver. Obtaining, by the internally integrated network proxy module, specified network interaction data including the filtering keyword; then, the receiver receives a query keyword sent by the terminal, and obtains, by using the network proxy module, the specified network interaction data Determining the target network interaction data of the query keyword, and sending the target network interaction data to the terminal, and verifying, by the terminal, the target network interaction data, thereby implementing a webpage or a browser and a server The verification of the network interaction data improves the testing ability of the webpage automated testing tool.
  • an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a program, and the program can execute the method embodiment shown in FIG. 2-6.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium can store a program, and the program can execute the method embodiment shown in FIG. 7.
  • the invention may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

提供了一种网页自动化测试方法及装置,所述网页自动化测试方法通过网络代理模块获取浏览器发送给服务器的目标网络交互数据。然后,由网页自动化测试工具对所述目标网络交互数据进行校验。从而实现对浏览器或网页与服务器之间的网络交互的校验,对所述目标网络交互数据中的网络请求进行校验,提高发现网页缺陷的能力;以及,对服务器返回的响应消息进行校验,提高对网页显示的校验结果的准确率。

Description

网页自动化测试方法及装置 技术领域
本发明涉及网页测试技术领域,尤其涉及网页自动化测试方法及装置。
背景技术
网页是网络信息交流的重要平台,由于它承载的内容和功能具有多样性和不确定性的特点,就需要根据不同的应用需求和网络环境设计它的内容,为保证网页性能的可靠,也需要对设计后的网页进行测试。
网页自动化测试是对被测试网页的输入、输出进行自动化验证。目前,网页自动化测试工作通过网页自动化测试工具完成,网页自动化测试工具的工作原理是录制和回放,其中,录制是指利用网页自动化测试工具按时间顺序记录用户对浏览器、网页的操作,形成可识别的脚本;回放就是网页自动化测试工具读取之前录制好的脚本,模拟之前用户的行为,对浏览器、网页进行操作。根据上述测试流程可知,用户对浏览器、网页的操作是输入,操作的结果是输出,而且,随着网页内容的不同,操作结果也会发生变化。可见,网页的自动化测试就是模拟用户的输入,验证输出,即验证输入操作的结果。
在具体的网络环境中,用户通常在网络终端处通过浏览器操作网页,而网页的内容和功能需要由服务器支撑。因此,对于浏览器和服务器之间的数据交互,也是网页的一部分输入和输出。其中,浏览器向服务器发送的网络请求是输出;服务器反馈的响应是输入。这个交互过程影响网页的展示结果,也是测试的一部分。但是,按照目前的网页自动化测试方法,只能记录用户通过浏览器对网页的操作,不能记录浏览器或网页与服务器之间的操作,也无法验证服务器的响应。
缺少对网络请求的校验,必然导致发现网页缺陷的能力较低,甚至无法发现部分缺陷。例如,用户在网页的搜索框中输入字符“abc”,然后点击网页上的搜索按钮,而网页发出的网络请求中的搜索字符是“abc+空格”,网页最终显示的是搜索“abc+空格”得到的搜索内容,比搜索“abc”得到的搜索内容的范围小很多,目前的网页自动化测试方法无法发现此类问题。缺少对服务器的响应消息的校验,必然导致对网页显示的校验结果准确率降低,甚至部分页面由于缺少判断依据导致无法校验。
综上所述,目前的网页自动化测试方法发现网页缺陷的能力较低,且网页显示的 校验结果准确率低。
发明内容
本发明实施例中提供了一种网页自动化测试方法及装置,以解决现有技术中发现网页缺陷能力低,且网页显示的校验结果准确率低的问题。
为了解决上述技术问题,本发明实施例公开了如下技术方案:
第一方面,本发明提供一种网页自动化测试方法,包括:
终端获取所述终端与服务器之间的目标网络交互数据;所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收到的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
终端对所述目标网络交互数据进行校验。
结合第一方面,在第一方面的第一种可能的实现方式中,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
终端从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交互数据;
终端从所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
结合第一方面,在第一方面的第二种可能的实现方式中,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
终端从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
结合第一方面,在第一方面的第三种可能的实现方式中,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
终端向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
终端向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
终端接收所述服务器发送的所述目标网络交互数据。
结合第一方面,在第一方面的第四种可能的实现方式中,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
终端向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中,获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
终端接收所述服务器发送的所述目标网络交互数据。
第二方面,本发明还提供一种网页自动化测试方法,包括:
服务器获取所述服务器与终端之间的目标网络交互数据;所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
所述服务器向所述终端发送所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
结合第二方面,在第二方面的第一种可能的实现方式中,所述服务器获取所述服务器与终端之间的目标网络交互数据,包括:
所述服务器接收所述终端发送的查询关键字;
所述服务器从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
结合第二方面,在第二方面的第二种可能的实现方式中,所述服务器获取所述服务器与终端之间的目标网络交互数据,包括:
所述服务器接收所述终端发送的过滤关键字;
所述服务器从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
所述服务器接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符;
所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
第三方面,本发明提供一种网页自动化测试装置,应用于终端,包括:
获取单元,用于获取终端与服务器之间的目标网络交互数据;所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收到的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
校验单元,用于对所述获取单元获得的所述目标网络交互数据进行校验。
结合第三方面,在第三方面的第一种可能的实现方式中,所述获取单元包括:
第一获取子单元,用于从获得的所述终端与所述服务器之间的网络交互数据中, 获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交互数据;
第二获取子单元,用于从所述第一获取子单元获得的所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
结合第三方面,在第三方面的第二种可能的实现方式中,所述获取单元包括:
第三获取子单元,用于从获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
结合第三方面,在第三方面的第三种可能的实现方式中,所述获取单元包括:发送子单元和接收子单元;
所述发送子单元,用于向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
所述发送子单元,还用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
所示接收子单元,用于接收所述服务器发送的所述目标网络交互数据。
结合第三方面,在第三方面的第四种可能的实现方式中,所述获取单元包括:发送子单元和接收子单元;
所述发送子单元,用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中,获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
所述接收子单元,用于接收所述服务器发送的所述目标网络交互数据。
第四方面,本发明还提供一种终端,包括:
处理器,用于获取所述终端与服务器之间的目标网络交互数据;所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
所述处理器,还用于对所述目标网络交互数据进行校验。
结合第四方面,在第四方面的第一种可能的实现方式中,所述处理器具体用于:
从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交互数据;
从所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
结合第四方面,在第四方面的第二种可能的实现方式中,所述处理器具体用于:
从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
结合第四方面,在第四方面的第三种可能的实现方式中,还包括:发送器和接收器;所述发送器与所述处理器连接;所述接收器与所述处理器连接;
所述发送器,用于向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
所述发送器,还用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
所述接收器,用于接收所述服务器发送的所述目标网络交互数据,并将所述目标网络交互数据发送给所述处理器。
结合第四方面,在第四方面的第四种可能的实现方式中,还包括:发送器和接收器,所述发送器与所述处理器连接,所述接收器与所述处理器连接;
所述发送器,用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
所述接收器,用于接收所述服务器发送的所述目标网络交互数据,并将所述目标网络交互数据提供给所述处理器。
第五方面,本发明提供一种网页自动化测试装置,包括:
获取单元,用于获取服务器与终端之间的目标网络交互数据;所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
发送单元,用于向所述终端发送所述获取单元获得的所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
结合第五方面,在第五方面的第一种可能的实现方式中,所述获取单元包括:接收子单元和获取子单元;
接收子单元,用于接收所述终端发送的查询关键字;
获取子单元,用于从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收子单元接收到的所述查询关键字的网络交互数据。
结合第五方面,在第五方面的第二种可能的实现方式中,所述获取单元包括:接收子单元和获取子单元;
所述接收子单元,用于接收所述终端发送的过滤关键字;
所述获取子单元,用于从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述接收子单元接收到的所述过滤关键字的网络交互数据;
所述接收子单元,还用于接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符;
所述获取子单元,还用于从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收子单元接收到的所述查询关键字的网络交互数据。
第六方面,本发明提供一种服务器,包括处理器和发送器,所述发送器与所述处理器连接:
所述处理器,用于获取所述服务器与终端之间的目标网络交互数据;所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
所述发送器,用于向所述终端发送所述处理器获得的所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
结合第六方面,在第六方面的第一种可能的实现方式中,还包括:接收器,所述接收器与所述处理器连接;
所述接收器,用于接收所述终端发送的查询关键字;
所述处理器,具体用于从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收器发送的所述查询关键字的网络交互数据。
结合第六方面,在第六方面的第二种可能的实现方式中,还包括:接收器,所述接收器与所述处理器连接;
所述接收器,用于接收所述终端发送的过滤关键字;
所述处理器,具体用于从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述接收器发送的所述过滤关键字的网络交互数据;
所述接收器,还用于接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符;
所述处理器,具体用于从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收器发送的所述查询关键字的网络交互数据。
第七方面,本发明还提供一种计算机存储介质,所述计算机存储介质可存储有程序,该程序执行时包括如第一方面的任一种可能的实现方式所述的步骤。
第八方面,本发明还提供一种计算机存储介质,所述计算机存储介质可存储有程序,该程序执行时包括如第二方面的任一种可能的实现方式所述的步骤。
由以上技术方案可见,本发明实施例提供的网页自动化测试方法,终端获取自身内的浏览器与服务器之间的指定网络交互数据。然后,从所述指定网络交互数据中确定目标网络交互数据,并解析目标网络交互数据中的网络请求的参数,校验终端发送的网络请求是否正确,提高了发现网页缺陷的能力。以及,解析服务器返回的响应消息的参数,校验浏览器上网页显示的内容是否准确,提高网页显示的校验结果的准确率。
附图说明
构成本申请的一部分的说明书附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1示出了本发明实施例一种网络代理模块框图;
图2示出了本发明实施例一种网页自动化测试方法的流程示意图;
图3示出了本发明实施例一种图2中的S110的方法流程示意图;
图4示出了本发明实施例另一种图2中的S110的方法流程示意图;
图5示出了本发明实施例再一种图2中的S110的方法流程示意图;
图6示出了本发明实施例另一种网页自动化测试方法的流程示意图;
图7示出了本发明实施例又一种网页自动化测试方法的流程示意图;
图8示出了本发明实施例再一种网页自动化测试方法的流程示意图;
图9示出了本发明实施例一种网页自动化测试装置的结构示意图;
图10示出了本发明实施例另一种网页自动化测试装置的结构示意图;
图11示出了本发明实施例一种终端的结构示意图;
图12示出了本发明实施例另一种终端的结构示意图;
图13示出了本发明实施例一种服务器的结构示意图;
图14示出了本发明实施例一种服务器的结构示意图。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
具体实施方式
为了使本领域技术人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所述描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参见图1,示出了本申请实施例提供的网络代理模块的结构款图,如图1所示,与传统的网络代理模块不同的是,除包括接收单元1和发送单元2之外,还包括过滤单元3、存储单元4和开放接口5。
过滤单元3具有对网络交互数据进行初步过滤的功能。浏览器在加载网页的过程中,会产生很多请求,例如,CSS(Cascading Style Sheets,叠层样式表)、JS(JavaScript)、图片、音乐、业务数据请求(例如,网页的表格中所包含的数据)等。网络代理模块需要将网页测试工程师关注的网络请求和响应消息保存下来,具体的,可以通过过滤单元3过滤得到所述网络请求和响应消息。存储单元4用于存储网络请求和响应消息,并通过开放接口5提供给网页自动化测试工具。
请参见图2,示出了本发明实施例提供的网页自动化测试方法的流程示意图,该方法应用于终端中,所述终端可以是PC机、笔记本电脑、平板电脑、智能手机等能够浏览网页的终端设备。
本实施例中的所述终端集成有网页自动化测试工具,其中,图1所示的网络代理模块获取终端与服务器之间的网络交互数据,然后,将网络交互数据提供给网页自动化测试工具。最后,由网页自动化测试工具对所述网络交互数据进行校验。
如图2所示,所述方法包括步骤S110~S120:
S110,终端获取所述终端与服务器之间的目标网络交互数据。
所述目标网络交互数据包括终端发送给服务器的网络请求,以及所述终端接收到 的所述服务器返回的响应消息;其中,所述响应消息是所述服务器对所述终端发送的网络请求的响应。
终端内的网页自动化测试工具启动网络代理模块,然后调用浏览器,并给浏览器设置好网络代理模块的地址。网页自动化测试工具操作浏览器,浏览器通过终端发出相应的网络请求,网络代理模块接收所述网络请求,并将所述网络请求转发给服务器;网络代理模块接收所述服务器返回的响应所述网络请求的响应消息后,所述网络代理模块将所述响应消息发送给所述浏览器的同时,复制并存储终端和服务器之间的目标网络交互数据。
当所述网络代理模块集成在所述网页自动化测试工具中时,网络自动化测试工具通过初始化的方式启动网络代理模块。当所述网络代理模块集成在终端的其它软件中,所述网络自动化测试工具通过启动命令启动网络代理模块。
网络工程师真正想测试的网络交互数据可能仅是终端与服务器之间的网络交互数据中的某一类网络交互数据。因此,终端只需要获取网页测试工程师真正想测试的网络交互数据。
例如,网页测试工程师利用终端内的网页自动化测试工具设置一个或多个查询关键字,通过网络代理模块的开放接口将查询关键字传递给网络代理模块,由所述网络代理模块从获得的所述终端与服务器之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
S120,终端对所述目标网络交互数据进行校验。
网页自动化测试工具获得目标网络交互数据后,判断对浏览器或网页的操作与所述网络请求中的参数是否一致,如果一致,则表明浏览器或网页发出的网络请求准确;否则,表明浏览器或网页发出的网络请求不准确。例如,用户在网页的搜索栏中输入字符“abc”,获取终端发送给服务器的网络请求,判断网络请求与用户对网页的操作是否一致;网页自动化测试工具解析响应消息,判断解析得到的消息与网页显示的内容是否一致,从而对网页显示内容是否准确进行校验。
本实施例提供的网页自动化测试方法,终端通过网络代理模块获取所述终端与服务器之间的目标网络交互数据。然后通过网页自动化测试工具对所述目标网络交互数据中的网络请求进行校验,提高发现网页缺陷的能力;以及,对服务器返回的响应消息进行校验,提高对网页显示的校验结果的准确率。
本发明提供的实施例中,根据网络代理模块的集成位置不同,图2中的终端获取所述终端与服务器之间的目标网络交互数据的具体过程可以分为以下两大类:
(1)网络代理模块集成在终端侧
请参见图3,示出了本发明实施例一种获取目标网络交互数据的方法流程示意图,该方法应用于终端中,该方法通过过滤关键字和查询关键字获得目标网络交互数据。如图3所示,所述方法包括以下步骤:
S1111,从终端获得的网络交互数据中获取指定网络交互数据,指定网络交互数据为包含过滤关键字的网络交互数据。
网络代理模块从接收到的终端与服务器之间的网络交互数据中,过滤得到包含过滤关键字的网络交互数据,得到指定网络交互数据。
网络测试工程师可以通过网页自动化测试工具设置一个或多个过滤关键字,并通过网络代理模块的开放接口将所述过滤关键字传递给网络代理模块。网络代理模块只获取包含过滤关键字的网络交互数据,得到指定网络交互数据。即指定网络交互数据是终端与服务器之间的网络交互数据中的一部分。
网络代理模块判断接收到的所述终端和所述服务器之间的网络交互数据中是否包含过滤关键字,如果包含过滤关键字,则将包含所述过滤关键字的网络交互数据复制并存储到存储单元中;如果不包含过滤关键字,则对网络交互数据不进行任何处理。然后,继续判断下一对网络交互数据中是否包含过滤关键字。例如,过滤关键字为“wd=”,网络代理模块从接收到的所述终端与服务器之间的网络交互数据中过滤得到以下两对网络交互并存储到存储单元中:
网络请求1:
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;
相应的响应消息中也包含过滤关键字“wd=”,此处未示出所述响应消息。
网络请求2:
http://suggestion.baidu.com/su?wd=&cb=window.bdsug.sugPreRequest&sid=4301_1425_4414_4261_4202_4450_4587&t=1387161319508;
响应消息2:
window.bdsug.sugPreRequest({q:"",p:false,s:[]})。
本实施例中,如果过滤关键字为空,则所有的网络交互数据都不存储。
需要说明的是,网页测试工程师可以随时设置过滤关键字,例如,可以在启动网络代理模块时设置,还可以在网络代理模块运行一段时间之后再设置过滤关键字,网络代理模块在接收到过滤关键字之后,才对网络交互数据进行过滤,复制并保存包含 过滤关键字的网络交互数据。
S1112,从所述指定网络交互数据中获取得到目标网络交互数据。
所述目标网络交互数据为包含查询关键字的网络交互数据;所述查询关键字包含所述过滤关键字的字符。
网络测试工程师可以通过网页自动化测试工具设置查询关键字,并通过网络代理模块的开放接口将所述查询关键字传递给网络代理模块。
所述网络代理模块判断存储单元中存储的指定网络交互数据中,是否存在包含查询关键字的网络交互数据;如果存在包含查询关键字的网络交互数据,则将包含所述查询关键字的网络交互数据反馈给所述网页自动化测试工具,得到目标网络交互数据;如果不存在包含所述查询关键字的网络交互数据,则向网页自动化测试工具返回空。由此可知,目标网络交互数据是所述指定网络交互数据中的一部分网络交互数据。
延用上述的实例,网络代理模块保存了两对包含过滤关键字“wd=”的网络交互数据。假设查询关键字为“wd=1”,网络代理模块查询到存储单元中的网络请求1和响应消息1中包含“wd=1”则将网络请求1和响应消息1反馈给网页自动化测试工具。
本实施例提供的获取目标网络交互数据的方法,设定过滤关键字,终端内的网络代理模块从接收到的终端与服务器之间的网络交互数据中,获取指定网络交互数据;然后,设定查询关键字,由终端内的网络代理模块从获得的指定网络交互数据中获取目标网络交互数据。这样,所述网络代理模块的存储单元只需存储包含过滤关键字的网络交互数据,大大节省了存储空间。
在本发明的另一个实施例中,所述终端从获得的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。即终端仅通过查询关键字获得目标网络交互数据。
具体实施时,终端内的网络代理模块获取所述终端与服务器之间的网络交互数据,以及,复制所述网络交互数据并存储到存储单元中,当接收到网页自动化测试工具传递的查询关键字后,从存储单元中获取包含查询关键字的网络交互数据发送给网页自动化测试工具,以使所述网页自动化测试工具对目标网络交互数据中的网络请求及对应的响应消息进行验证。
(2)网络代理模块集成在服务器侧
请参见图4,示出了本发明实施例另一种获取目标网络交互数据的方法流程图,该方法应用于终端中,该方法与图3所示的实施例相似,如图4所示,所述方法可以 包括以下步骤:
S1121,终端向所述服务器发送过滤关键字。
所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据。
S1122,终端向所述服务器发送查询关键字。
所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符。
S1123,终端接收所述服务器发送的所述目标网络交互数据。
终端与服务器之间的全部网络交互数据中,包含过滤关键字的网络交互数据为指定网络交互数据;指定网络交互数据中包含查询关键字的网络交互数据为目标网络交互数据。目标网络交互数据是网页自动化测试工具需要验证的网络交互数据,因此,只需将目标网络交互数据发送给终端,不需要将指定网络交互数据发送给终端。
本实施例提供的获取目标网络交互数据的方法,终端向服务器传递过滤关键字,使服务器从接收到的终端与服务器之间的网络交互数据中,只获取指定网络交互数据;然后,终端向服务器传递查询关键字,由服务器从获得的指定网络交互数据中获取目标网络交互数据。这样,服务器侧只需存储指定网络交互数据,大大节省了存储空间。
在本发明的另一个实施例中,仅设置查询关键字,服务器中的网络代理模块将接收到的所述服务器与所述终端之间的网络交互数据过滤得到目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。如图5所示,获取目标网络交互数据的方法包括以下步骤:
S1131,终端向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的网络交互数据中查询目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
S1132,终端接收所述服务器发送的所述目标网络交互数据。
本实施例提供的获取目标网络交互数据的方法,终端向服务器传递查询关键字,使服务器从终端与服务器之间的网络交互数据中获取包含查询关键字的网络交互数据,并将包含查询关键字的网络交互数据反馈给终端。
请参见图6,示出了本发明实施例另一种网页自动化测试方法的流程示意图,该 方法应用于终端中,所述方法在图2所示实施例的基础上还可以包括步骤S210~S220;其中,图6中的S110~S120与图2所示相同,此处不再赘述。
S210,终端删除包含特征字符的网络交互数据。
具体实施时,若网络代理模块集成在终端内,终端内的网页自动化测试工具通过开放接口向终端内的网络代理模块发送删除指令,所述删除指令包含特征字符。当网络代理模块接收到所述删除指令时,删除包含所述特征字符的网络交互数据。
所述特征字符可以是一次网络请求或响应消息中的任何一段字符串,例如,当网页自动化测试工具对浏览器或网页的重复进行两次完全相同的操作,且需要对第二次操作的网络交互数据进行校验时,在进行第二次操作之前,需要删除上一次的网络请求和响应消息。
S220,终端删除获得的自身与服务器之间的全部网络交互数据。
若网络代理模块集成于终端内,终端内的网页自动化测试工具通过开放接口向网络代理模块发送清空指令,网络代理模块接收到所述清空指令后,清空存储单元中存储的全部网络交互数据,从而节省存储空间。
其中,不严格限定S210、S220的执行顺序,可以先执行S220,再执行S210。只要保证S210~S220在网络代理模块存储网络交互数据之后执行即可。
本实施例提供的网页自动化测试方法,能够删除终端内的网络代理模块中已经存储的特征的网络交互数据,而且,能够清空已存储的全部网络交互数据,从而节省网络代理模块的存储空间。
相应于上述的应用于终端的网页自动化测试方法实施例,若网络代理模块集成于服务器中,本发明还提供了应用于服务器侧的网页自动化测试方法实施例。
请参见图7,示出了本发明实施例另一种网页自动化测试方法的流程示意图,该方法应用于服务器中,如图7所示,所述方法包括以下步骤:
S310,服务器获取所述服务器与终端之间的目标网络交互数据。
所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应。
其中,S310可以通过以下两种方式实现:
(1)S310的第一种实现方式:
步骤1),服务器接收所述终端发送的查询关键字;
步骤2),服务器从获得的所述服务器与所述终端之间的网络交互数据中获取目 标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
终端侧设置查询关键字,服务器从获得的自身与所述终端之间的网络交互数据中过滤得到包含所述查询关键字的网络交互数据。
(2)S310的第二种实现方式:
步骤11),服务器接收所述终端发送的过滤关键字。
步骤12),服务器从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据。
步骤13),服务器接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符。
步骤14),服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
S320,服务器向所述终端发送所述目标网络交互数据,以使所述终端对所述目标网络交互数据进行校验。
本实施例提供的网页自动化测试方法,服务器获取自身与终端之间的目标网络交互数据,然后,将目标网络交互数据发送给终端,由终端对所述目标网络交互数据进行校验,从而实现对网页或浏览器的验证。
优选地,如图7所示,所述方法还可以包括:
S330,服务器接收所述终端发送的删除指令,所述删除指令包含特征字符。
S340,所述服务器根据所述删除指令删除包含所述特征字符的网络交互数据。
S350,服务器接收所述终端发送的清空指令。
S360,所述服务器删除存储的全部网络交互数据。
本实施例提供的服务器通过网络代理模块获取浏览器发送给服务器的指定网络交互数据。然后从所述指定网络交互数据中获取目标网络交互数据,并提供给网页自动化测试工具。由网页自动化测试工具对目标网络交互数据进行校验,从而实现对浏览器或网页与服务器之间的网络交互的校验,提高测试网页缺陷的能力。
上述的应用于网络代理模块中的方法实施例及应用于网页自动化测试工具中的方法实施例,可以全部集成到网页自动化测试工具中实现,也可以分别独立实现。
请参见图8,示出了网页自动化测试方法的流程示意图,如图8所示,所述方法包括以下步骤:
S410,网页自动化测试工具启动网络代理模块。
网页自动化测试工具集成在终端内。若网络代理模块集成在终端内的网页自动化 测试工具内,则网页自动化测试工具初始化网络代理模块;若网络代理模块集成在服务器中,网页自动化测试工具通过命令启动所述网络代理模块。
S420,网页自动化测试工具向网络代理模块中的过滤单元传递过滤关键字。例如,过滤关键字为“wd=”。
S430,网页自动化测试工具调用浏览器,并设置浏览器的代理地址。
S440,网页自动化测试工具操作网页,以使浏览器发出网络请求。
例如,网页自动化测试工具在浏览器上打开网页“http://www.baidu.com”,并通过百度搜索引擎搜索“1”,浏览器发送网络请求并接收服务器返回的响应消息,显示搜索结果页面。
S450,网络代理模块接收所述网络请求,并转发给相应的服务器。
S460,网络代理模块接收所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应。
S470,网络代理模块判断所述网络请求和响应消息中是否包含所述过滤关键字,如果包含,则执行步骤S480;如果不包含,则执行步骤S490。
S480,网络代理模块复制所述网络请求和响应消息并保存到存储单元中。然后执行S490。
S490,网络代理模块将服务器返回的响应消息返回给浏览器。
S4100,网页自动化测试工具向所述过滤单元传递查询关键字。例如查询关键字为“wd=1”。
S4110,所述过滤单元判断存储单元中是否存在包含所述查询关键字的网络请求和响应消息,如果包含,则执行S4120;如果不包含,则执行S4130。从存储的网络交互数据中过滤出包含“wd=1”的网络交互数据。
S4120,将包含所述查询关键字的网络请求和响应消息返回给网页自动化测试工具。
如果存储单元中包含多对包含所述查询关键字的网络请求和响应消息,则只返回第一对包含查询关键字的网络请求和响应消息。
S4130,向网页自动化测试工具返回空。
S4140,网页自动化测试工具对接收到网络请求和响应消息进行校验。
然后,重复执行步骤S440~S4140,实现多对网络请求和响应消息的校验。
S4150,网页自动化测试工具向网络代理模块发送删除指令,所述删除指令包含特征字符。
S4160,所述网络代理模块根据所述删除指令删除包含所述特征字符的网络请求和对应的响应消息。
S4170,网页自动化测试工具向网络代理模块发送清空指令。
S4180,所述网络代理模块根据所述清空指令删除存储单元中的全部网络请求和响应消息。
相应于上述的网页自动化测试方法实施例,本发明还提供了网页自动化测试装置。
请参见图9,示出了本发明实施例一种网页自动化测试装置的结构示意图,该装置应用于终端,如图9所示,所述装置包括:获取单元110和校验单元120。
所示获取单元110,用于获取所述终端与服务器之间的目标网络交互数据。
本发明实施例中,可以通过网络代理模块获取所述终端与服务器之间的网络交互数据。
所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
在本发明的一个实施例中,所述网络代理模块集成在终端内,则所述获取单元可以包括:第一获取子单元和第二获取子单元。
所述第一获取子单元,用于从获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交互数据;
所述第二获取子单元,用于从所述第一获取子单元获得的所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
在本发明的另一个实施例中,所述网络代理模块集成在终端内,所述获取单元包括第三获取子单元;
所述第三获取子单元,用于从获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
在本发明的又一个实施例中,所述网络代理模块集成在服务器侧,所述获取单元包括:发送子单元和接收子单元;
所述发送子单元,用于向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据, 所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
所述发送子单元,还用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
所示接收子单元,用于接收所述服务器发送的所述目标网络交互数据。
在本发明的再一个实施例中,所述网络代理模块集成在服务器中,所述获取单元包括:发送子单元和接收子单元;
所述发送子单元,用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中,获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
所述接收子单元,用于接收所述服务器发送的所述目标网络交互数据。
所述校验单元120,用于对所述获取单元110获得的所述目标网络交互数据进行校验。
本实施例提供的网页自动化测试装置,通过获取单元获取所述终端与服务器之间的目标网络交互数据。然后通过校验单元对所述目标网络交互数据中的网络请求进行校验,提高发现网页缺陷的能力;以及,对服务器返回的响应消息进行校验,提高对网页显示的校验结果的准确率。
相应于上述的应用于服务器的网页自动化测试方法实施例,本发明实施例还提供了应用于服务器的网页自动化测试装置实施例。
请参见图10,示出了本发明实施例另一种网页自动化测试装置的结构示意图,该装置应用于服务器中,所述装置包括:获取单元210和发送单元220。
所述获取单元210,用于获取服务器与终端之间的目标网络交互数据。
所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应。
在本发明的一个实施例中,所述获取单元210可以包括:接收子单元和获取子单元。
所述接收子单元,用于接收所述终端发送的查询关键字。
所述获取子单元,用于从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数 据。
在本发明另一个实施例中,所述获取单元210可以包括:接收子单元和获取子单元。
所述接收子单元,用于接收所述终端发送的过滤关键字。
所述获取子单元,用于从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含接收子单元接收到的所述过滤关键字的网络交互数据。
所述接收子单元,还用于接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符。
所述获取子单元,还用于从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收子单元接收到的所述查询关键字的网络交互数据。
所述发送单元220,用于向所述终端发送所述获取单元210获得的所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
相应于上述的网页自动化测试装置实施例,本发明还提供了终端,所述终端包括:处理器;
所述处理器,用于获取所述终端与服务器之间的目标网络交互数据;以及,对所述目标网络交互数据进行校验。
所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
在本发明的一个实施例中,所述处理器具体用于:
从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据;所述指定网络交互数据为包含过滤关键字的网络交互数据;
从所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
在本发明的另一个实施例中,所述处理器具体用于:从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
请参见图11,示出了本发明实施例的另一种终端的结构示意图,所述终端内集成有网页自动化测试工具,如图11所示,所述终端包括:发送器330、处理器320 和接收器310,其中,所述发送器330与所述处理器320连接,所述接收器310与所述处理器320连接;
所述发送器330,用于向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据。
所述服务器中集成有网络代理模块,通过网络代理模块获取所述终端与服务器之间的网络交互数据。
所述发送器330,还用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符。
所述接收器310,用于接收所述服务器发送的所述目标网络交互数据。
所述处理器320,用于对所述接收器310接收到的所述目标网络交互数据进行校验。
请参见图12,示出了本发明实施例的又一种终端的结构示意图,如图12所示,所述终端包括:发送器430、处理器420和接收器410,其中,所述发送器430与所述处理器420连接,所述接收器410与所述处理器420连接。
所述发送器430,用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
所述接收器410,用于接收所述服务器发送的所述目标网络交互数据。
所述处理器420,用于对所述接收器410接收到的所述目标网络交互数据进行校验。
相应于上述的终端的实施例,本发明还提供了一种服务器,如图13所示,所述服务器包括:接收器510、处理器520和发送器530,其中,所述发送器530与所述处理器520连接,所述接收器510与所述处理器520连接。
所述接收器510,用于接收终端发送的查询关键字。
所述处理器520,具体用于从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据。
所述目标网络交互数据为包含所述查询关键字的网络交互数据。所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端 发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应。
所述发送器530,用于向所述终端发送所述处理器520获得的所述目标网络交互数据,以使所述终端对所述目标网络交互数据进行校验。
本实施例提供的服务器,通过接收器接收终端设置的查询关键字。通过内部集成的网络代理模块获取服务器与所述终端之间的网络交互数据中包含查询关键字的目标网络交互数据,并将所述目标网络交互数据发送给所述终端。由所述终端对所述目标网络交互数据进行校验,从而实现对网页或浏览器与服务器之间的网络交互数据的验证,提高了网页自动化测试工具的测试能力。
请参见图14,示出了本发明实施例另一种服务器的结构示意图,该服务器中集成有网络代理模块,如图14所示,所述服务器包括:接收器610、处理器620和发送器630,其中,所述发送器630与所述处理器620连接,所述接收器610与所述处理器620连接。
所述接收器610,用于接收所述终端发送的过滤关键字。
所述处理器620,用于从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据。
所述指定网络交互数据为包含所述过滤关键字的网络交互数据。
所述接收器610,还用于接收所述终端发送的查询关键字。
所述查询关键字包含所述过滤关键字的字符。
所述处理器620,还用于从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收器610接收到的所述查询关键字的网络交互数据。
所述发送器630,用于向所述终端发送所述处理器620获得的所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
本实施例提供的服务器通过接收器接收终端发送的过滤关键字。通过内部集成的网络代理模块获取包含所述过滤关键字的指定网络交互数据;然后,所述接收器接收终端发送的查询关键字,并通过所述网络代理模块从所述指定网络交互数据中获取包含所述查询关键字的目标网络交互数据,并将所述目标网络交互数据发送给所述终端,由所述终端对所述目标网络交互数据进行校验,从而实现对网页或浏览器与服务器之间的网络交互数据的验证,提高了网页自动化测试工具的测试能力。
另一方面,本发明实施例还提供了一种计算机存储介质,所述计算机存储介质可存储有程序,该程序可以执行图2-图6所示的方法实施例。
又一方面,本发明实施例还提供了一种计算机存储介质,所述计算机存储介质可存储有程序,该程序可以执行图7所示的方法实施例。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
本发明可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本发明,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本发明的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (26)

  1. 一种网页自动化测试方法,其特征在于,包括:
    终端获取所述终端与服务器之间的目标网络交互数据;所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收到的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
    终端对所述目标网络交互数据进行校验。
  2. 根据权利要求1所述的方法,其特征在于,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
    终端从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交互数据;
    终端从所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
  3. 根据权利要求1所述的方法,其特征在于,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
    终端从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
  4. 根据权利要求1所述的方法,其特征在于,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
    终端向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
    终端向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
    终端接收所述服务器发送的所述目标网络交互数据。
  5. 根据权利要求1所述的方法,其特征在于,所述终端获取所述终端与服务器之间的目标网络交互数据,包括:
    终端向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中,获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
    终端接收所述服务器发送的所述目标网络交互数据。
  6. 一种网页自动化测试方法,其特征在于,包括:
    服务器获取所述服务器与终端之间的目标网络交互数据;所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
    所述服务器向所述终端发送所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
  7. 根据权利要求6所述的方法,其特征在于,所述服务器获取所述服务器与终端之间的目标网络交互数据,包括:
    所述服务器接收所述终端发送的查询关键字;
    所述服务器从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
  8. 根据权利要求6所述的方法,其特征在于,所述服务器获取所述服务器与终端之间的目标网络交互数据,包括:
    所述服务器接收所述终端发送的过滤关键字;
    所述服务器从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
    所述服务器接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符;
    所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据。
  9. 一种网页自动化测试装置,应用于终端,其特征在于,包括:
    获取单元,用于获取终端与服务器之间的目标网络交互数据;所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收到的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
    校验单元,用于对所述获取单元获得的所述目标网络交互数据进行校验。
  10. 根据权利要求9所述的装置,其特征在于,所述获取单元,包括:
    第一获取子单元,用于从获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交 互数据;
    第二获取子单元,用于从所述第一获取子单元获得的所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
  11. 根据权利要求9所述的装置,其特征在于,所述获取单元包括:
    第三获取子单元,用于从获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
  12. 根据权利要求9所述的装置,其特征在于,所述获取单元包括:发送子单元和接收子单元;
    所述发送子单元,用于向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
    所述发送子单元,还用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
    所示接收子单元,用于接收所述服务器发送的所述目标网络交互数据。
  13. 根据权利要求9所述的装置,其特征在于,所述获取单元包括:发送子单元和接收子单元;
    所述发送子单元,用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中,获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
    所述接收子单元,用于接收所述服务器发送的所述目标网络交互数据。
  14. 一种终端,其特征在于,包括:
    处理器,用于获取所述终端与服务器之间的目标网络交互数据;所述目标网络交互数据包括所述终端发送给所述服务器的网络请求,以及所述终端接收的所述服务器返回的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
    所述处理器,还用于对所述目标网络交互数据进行校验。
  15. 根据权利要求14所述的终端,其特征在于:所述处理器具体用于:
    从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取指定网络交互数据,所述指定网络交互数据为包含过滤关键字的网络交互数据;
    从所述指定网络交互数据中,获取包含查询关键字的网络交互数据,得到所 述目标网络交互数据;所述查询关键字包含所述过滤关键字的字符。
  16. 根据权利要求14所述的终端,其特征在于,所述处理器具体用于:
    从所述终端获得的所述终端与所述服务器之间的网络交互数据中,获取包含所述查询关键字的网络交互数据,得到目标网络交互数据。
  17. 根据权利要求14所述的终端,其特征在于,还包括:发送器和接收器;所述发送器与所述处理器连接;所述接收器与所述处理器连接;
    所述发送器,用于向所述服务器发送过滤关键字,所述过滤关键字用于使所述服务器从获得的所述终端与服务器之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述过滤关键字的网络交互数据;
    所述发送器,还用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;所述查询关键字至少包含所述过滤关键字的字符;
    所述接收器,用于接收所述服务器发送的所述目标网络交互数据,并将所述目标网络交互数据发送给所述处理器。
  18. 根据权利要求14所述的终端,其特征在于,还包括:发送器和接收器,所述发送器与所述处理器连接,所述接收器与所述处理器连接;
    所述发送器,用于向所述服务器发送查询关键字,所述查询关键字用于使所述服务器从获得的所述终端与所述服务器之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述查询关键字的网络交互数据;
    所述接收器,用于接收所述服务器发送的所述目标网络交互数据,并将所述目标网络交互数据提供给所述处理器。
  19. 一种网页自动化测试装置,其特征在于,包括:
    获取单元,用于获取服务器与终端之间的目标网络交互数据;所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
    发送单元,用于向所述终端发送所述获取单元获得的所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
  20. 根据权利要求19所述的装置,其特征在于,所述获取单元包括:接收子单元和获取子单元;
    接收子单元,用于接收所述终端发送的查询关键字;
    获取子单元,用于从获得的所述服务器与所述终端之间的网络交互数据中获 取目标网络交互数据,所述目标网络交互数据为包含所述接收子单元接收到的所述查询关键字的网络交互数据。
  21. 根据权利要求19所述的装置,其特征在于,所述获取单元包括:接收子单元和获取子单元;
    所述接收子单元,用于接收所述终端发送的过滤关键字;
    所述获取子单元,用于从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述接收子单元接收到的所述过滤关键字的网络交互数据;
    所述接收子单元,还用于接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符;
    所述获取子单元,还用于从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收子单元接收到的所述查询关键字的网络交互数据。
  22. 一种服务器,其特征在于,包括处理器和发送器,所述发送器与所述处理器连接:
    所述处理器,用于获取所述服务器与终端之间的目标网络交互数据;所述目标网络交互数据包括所述服务器接收的所述终端发送的网络请求,以及所述服务器向所述终端发送的响应消息;所述响应消息为所述服务器对所述终端发送的网络请求的响应;
    所述发送器,用于向所述终端发送所述处理器获得的所述目标网络交互数据,所述目标网络交互数据用于所述终端对所述目标网络交互数据进行校验。
  23. 根据权利要求22所述的服务器,其特征在于,还包括:接收器,所述接收器与所述处理器连接;
    所述接收器,用于接收所述终端发送的查询关键字;
    所述处理器,具体用于从获得的所述服务器与所述终端之间的网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收器发送的所述查询关键字的网络交互数据。
  24. 根据权利要求22所述的服务器,其特征在于,还包括:接收器,所述接收器与所述处理器连接;
    所述接收器,用于接收所述终端发送的过滤关键字;
    所述处理器,具体用于从获得的所述服务器与所述终端之间的网络交互数据中获取指定网络交互数据,所述指定网络交互数据为包含所述接收器发送的所述过滤关键字的网络交互数据;
    所述接收器,还用于接收所述终端发送的查询关键字;所述查询关键字包含所述过滤关键字的字符;
    所述处理器,具体用于从所述指定网络交互数据中获取目标网络交互数据,所述目标网络交互数据为包含所述接收器发送的所述查询关键字的网络交互数据。
  25. 一种计算机存储介质,其特征在于,所述计算机存储介质可存储有程序,该程序执行时包括如权利要求1至5任一项所述的步骤。
  26. 一种计算机存储介质,其特征在于,所述计算机存储介质可存储有程序,该程序执行时包括如权利要求6至8任一项所述的步骤。
PCT/CN2014/085876 2014-09-03 2014-09-03 网页自动化测试方法及装置 WO2016033765A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP14901286.6A EP3179370A4 (en) 2014-09-03 2014-09-03 Webpage automatic test method and apparatus
CN201480045943.4A CN105579976B (zh) 2014-09-03 2014-09-03 网页自动化测试方法及装置
PCT/CN2014/085876 WO2016033765A1 (zh) 2014-09-03 2014-09-03 网页自动化测试方法及装置
US15/508,648 US20170277622A1 (en) 2014-09-03 2014-09-03 Web Page Automated Testing Method and Apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/085876 WO2016033765A1 (zh) 2014-09-03 2014-09-03 网页自动化测试方法及装置

Publications (1)

Publication Number Publication Date
WO2016033765A1 true WO2016033765A1 (zh) 2016-03-10

Family

ID=55439013

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/085876 WO2016033765A1 (zh) 2014-09-03 2014-09-03 网页自动化测试方法及装置

Country Status (4)

Country Link
US (1) US20170277622A1 (zh)
EP (1) EP3179370A4 (zh)
CN (1) CN105579976B (zh)
WO (1) WO2016033765A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230316229A1 (en) * 2022-03-10 2023-10-05 Atlassian Pty Ltd Systems and methods for integrating computer applications
US12136066B2 (en) * 2022-03-10 2024-11-05 Atlassian Pty Ltd. Systems and methods for integrating computer applications

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10534512B2 (en) * 2015-03-04 2020-01-14 Tata Consultancy Services Limited System and method for identifying web elements present on a web-page
CN111107399A (zh) * 2018-10-25 2020-05-05 武汉斗鱼网络科技有限公司 关注列表优化方法、存储介质、设备及系统
CN110716856A (zh) * 2019-08-23 2020-01-21 北京顺丰同城科技有限公司 一种分布式系统子模块交互测试方法及装置
CN112910722B (zh) * 2019-12-04 2022-07-22 北京达佳互联信息技术有限公司 网络请求测试方法、装置、终端及存储介质
CN114143386A (zh) * 2021-11-23 2022-03-04 广州三七极创网络科技有限公司 一种基于quic协议的通信方法、系统、设备及存储介质
CN114679402B (zh) * 2022-03-25 2024-05-14 武汉联影智融医疗科技有限公司 一种医疗机器人上下位机间通信协议的测试方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067214A (zh) * 2011-10-19 2013-04-24 阿里巴巴集团控股有限公司 用于测试网站性能的方法、客户端、服务器和系统
CN103562927A (zh) * 2011-05-31 2014-02-05 惠普发展公司,有限责任合伙企业 自动化安全测试
US20140068563A1 (en) * 2012-09-04 2014-03-06 International Business Machines Corporation Computer software application self-testing
CN103873318A (zh) * 2012-12-18 2014-06-18 阿里巴巴集团控股有限公司 一种网站自动化测试方法及自动化测试系统

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6604143B1 (en) * 1998-06-19 2003-08-05 Sun Microsystems, Inc. Scalable proxy servers with plug-in filters
US6360332B1 (en) * 1998-06-22 2002-03-19 Mercury Interactive Corporation Software system and methods for testing the functionality of a transactional server
GB0206761D0 (en) * 2002-03-22 2002-05-01 Object Media Ltd Software testing
US6826602B1 (en) * 2002-09-12 2004-11-30 Bellsouth Intellectual Property Corporation System and method for reverse content distribution
WO2006066383A1 (en) * 2004-12-22 2006-06-29 Research In Motion Limited System and method for enhancing network browsing speed by setting a proxy server on a handheld device
US8924558B2 (en) * 2005-11-30 2014-12-30 John Nicholas and Kristin Gross System and method of delivering content based advertising
CN101193007A (zh) * 2006-11-28 2008-06-04 国际商业机器公司 统一资源定位符命令测试方法、场景测试方法和相应设备
CN103092748A (zh) * 2011-11-07 2013-05-08 阿里巴巴集团控股有限公司 一种确定需要进行回归测试的测试用例的方法及系统
CN103593354B (zh) * 2012-08-15 2018-09-07 腾讯科技(深圳)有限公司 一种过滤网络页面广告的方法、装置、服务器及系统
US9117027B2 (en) * 2012-09-03 2015-08-25 Tata Consultancy Services Limited Method and system for compliance testing in a cloud storage environment
US20140089468A1 (en) * 2012-09-27 2014-03-27 Donald Joong Request-agnostic caching for a data resource collection
US8954495B2 (en) * 2013-01-04 2015-02-10 Netfilx, Inc. Proxy application with dynamic filter updating
US10002191B2 (en) * 2013-12-31 2018-06-19 Google Llc Methods, systems, and media for generating search results based on contextual information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103562927A (zh) * 2011-05-31 2014-02-05 惠普发展公司,有限责任合伙企业 自动化安全测试
CN103067214A (zh) * 2011-10-19 2013-04-24 阿里巴巴集团控股有限公司 用于测试网站性能的方法、客户端、服务器和系统
US20140068563A1 (en) * 2012-09-04 2014-03-06 International Business Machines Corporation Computer software application self-testing
CN103873318A (zh) * 2012-12-18 2014-06-18 阿里巴巴集团控股有限公司 一种网站自动化测试方法及自动化测试系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3179370A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230316229A1 (en) * 2022-03-10 2023-10-05 Atlassian Pty Ltd Systems and methods for integrating computer applications
US12136066B2 (en) * 2022-03-10 2024-11-05 Atlassian Pty Ltd. Systems and methods for integrating computer applications

Also Published As

Publication number Publication date
CN105579976A (zh) 2016-05-11
US20170277622A1 (en) 2017-09-28
CN105579976B (zh) 2018-07-20
EP3179370A4 (en) 2017-09-13
EP3179370A1 (en) 2017-06-14

Similar Documents

Publication Publication Date Title
WO2016033765A1 (zh) 网页自动化测试方法及装置
US8132095B2 (en) Auditing a website with page scanning and rendering techniques
US8365062B2 (en) Auditing a website with page scanning and rendering techniques
US10198410B2 (en) Method, device and mobile terminal for restoring page
US11860717B1 (en) Graphical user interface for presenting crash data
CN110851308A (zh) 一种测试方法、装置、电子设备及存储介质
KR102081181B1 (ko) 디바이스 상의 결합된 활동 히스토리
US11924296B2 (en) System and method for the capture of mobile behavior, usage, or content exposure
US9712618B2 (en) Asynchronous and synchronous resource links
US20170220671A1 (en) System, method, and apparatus for collecting and processing user feedback on webpages
WO2021184896A1 (zh) 一种页面截图方法及装置
CN104090887A (zh) 歌曲搜索方法及装置
CN111367703B (zh) 故障排查方法及装置
TW202222056A (zh) 用於實時分析虛擬伺服器記錄的電腦實施系統以及方法
WO2016027173A1 (en) Method of and a system for monitoring web site consistency
US20160117392A1 (en) Information search method and apparatus
JP4681673B1 (ja) 動作検証装置、動作検証方法および動作検証プログラム
WO2020151241A1 (zh) 一种信息无痕曝光采集方法及装置
KR101616063B1 (ko) 컨텐츠 서버 레이턴시 결정
JP5758544B2 (ja) 画面情報収集計算機、画面情報収集方法及び計算機読み取り可能な記憶媒体
WO2018032742A1 (zh) 实现搜索的方法、装置、设备和计算机存储介质
TW201905669A (zh) App應用展示介面的方法、裝置和電子設備
US8874971B1 (en) Detecting and reporting problems in a distributed resource computing system
US10949487B2 (en) Systems and methods for accessing computing device resources
CN106407238B (zh) 基于媒体内容互动的方法和系统

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201480045943.4

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14901286

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 15508648

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2014901286

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014901286

Country of ref document: EP