A page testing method, device and medium

CN113138915BActive Publication Date: 2026-09-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010067324.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-20
Publication Date
2026-09-25
Estimated Expiration
2040-01-20

AI Technical Summary

Technical Problem

[0004]为了解决现有技术应用在对页面进行测试时,测试效率低、本地机器功能受限等问题,本发明提供了一种页面测试方法、装置及介质:

Benefits of technology

[0020]本发明提供了一个能够提供页面测试服务的通用服务端。该服务端响应于接收到的来自客户端的页面测试请求,获取测试程序,利用测试程序对目标页面进行测试,接收由测试程序返回的测试进度信息和测试结果并将其发送至客户端。可以减少本地机器参与测试工作而受到的功能限制,保证本地机器资源的合理利用。页面测试的自动化能够提高测试效率,减少测试中对人工的依赖、降低人工成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113138915B_ABST
    Figure CN113138915B_ABST
Patent Text Reader

Abstract

The application discloses a page test method, device and medium. The method comprises the following steps: receiving a page test request sent by a client, wherein the page test request carries test item information and configuration information of a target page, the test item information comprises at least one selected from a group consisting of page object response test item information and page configuration check item information; obtaining a corresponding test program according to the test item information, wherein the corresponding test program is preconfigured; testing the target page by using the corresponding test program; receiving test progress information and a test result returned by the corresponding test program based on the configuration information; and sending the test progress information and the test result to the client. The application provides a general server capable of providing a page test service. The function limitation of a local machine participating in test work can be reduced, and the rational use of local machine resources is ensured. The automation of page test can improve test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet communication technology, and in particular to a page testing method, apparatus and medium. Background Technology

[0002] Testing is a crucial step in ensuring the stability and usability of products that utilize computer technology. Depending on the product type and testing methods, there are various types of testing. Front-end testing is a type of testing that focuses on the front-end pages, architecture, and other aspects.

[0003] In related technologies, page testing often relies heavily on manual testing. For example, staff write test scripts and run them on local machines. Test results also need to be compared by staff. Manual testing is labor-intensive, cumbersome, and inefficient. Furthermore, it requires deploying test environments on specific machines, limiting the scalability and migration of those machines. Therefore, a more efficient page testing solution is needed. Summary of the Invention

[0004] To address the problems of low testing efficiency and limited local machine functionality in existing technologies for testing web pages, this invention provides a web page testing method, apparatus, and medium:

[0005] On one hand, the present invention provides a page testing method applied to the server side, the method comprising:

[0006] Receive a page test request sent by the client. The page test request carries test item information and configuration information of the target page. The test item information includes at least one selected from a group consisting of page object response test item information and page configuration check item information.

[0007] The corresponding test program is obtained based on the test item information, and the corresponding test program is pre-configured;

[0008] The target page is tested using the corresponding test program;

[0009] Receive test progress information and test results returned by the corresponding test program based on the configuration information;

[0010] The test progress information and the test results are sent to the client.

[0011] On the other hand, a page testing device is provided for use on a server, the device comprising:

[0012] Test request receiving module: used to receive page test requests sent by the client. The page test request carries test item information and target page configuration information. The test item information includes at least one selected from a group consisting of page object response test item information and page configuration check item information.

[0013] Test program acquisition module: used to acquire the corresponding test program based on the test item information, wherein the corresponding test program is pre-configured;

[0014] Test module: Used to test the target page using the corresponding test program;

[0015] Test result receiving module: used to receive test progress information and test results returned by the corresponding test program based on the configuration information;

[0016] Test result sending module: used to send the test progress information and the test results to the client.

[0017] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the page testing method as described above.

[0018] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the page testing method as described above.

[0019] The page testing method, apparatus, and medium provided by this invention have the following technical effects:

[0020] This invention provides a general-purpose server capable of providing page testing services. In response to a page testing request received from a client, the server obtains a testing program, uses the testing program to test the target page, receives test progress information and test results returned by the testing program, and sends them back to the client. This reduces the functional limitations imposed on local machines participating in testing and ensures the rational utilization of local machine resources. Automation of page testing improves testing efficiency, reduces reliance on manual labor, and lowers labor costs. Attached Figure Description

[0021] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of an application environment provided by an embodiment of the present invention;

[0023] Figure 2 This is a flowchart illustrating a page testing method provided in an embodiment of the present invention;

[0024] Figure 3 This is a schematic diagram of a process for testing the target page using the corresponding test program, provided by an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of a process for obtaining test files provided in an embodiment of the present invention;

[0026] Figure 5 This is a block diagram of a page testing device provided in an embodiment of the present invention.

[0027] Figure 6 This is an architectural diagram of the page testing system provided in this embodiment of the invention;

[0028] Figure 7 This is a flowchart illustrating a page-based testing system provided in an embodiment of the present invention;

[0029] Figure 8-12 This is a schematic diagram of the interface of the page testing platform provided in an embodiment of the present invention;

[0030] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims, and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0033] Please see Figure 1 , Figure 1 This is a schematic diagram of an application environment provided by an embodiment of the present invention, which may include a client 01 and a server 02, with the client and server connected via a network. A user can send a page test request to the server through the client. The server tests the target page based on the received page test request, and simultaneously returns test progress information and test results to the client for the user to view. It should be noted that... Figure 1 This is just one example.

[0034] Specifically, client 01 can include physical devices such as smartphones, desktop computers, tablets, laptops, augmented reality (AR) / virtual reality (VR) devices, digital assistants, and smart wearable devices, as well as software running on these physical devices, such as computer programs. The operating system running on client 01 can include, but is not limited to, Android, iOS (a mobile operating system developed by Apple), Linux, and Microsoft Windows.

[0035] Specifically, server 02 may include a standalone server, a distributed server, or a server cluster consisting of multiple servers. Server 02 may include a network communication unit, a processor, and memory, etc. Server 02 can provide background services for the aforementioned clients.

[0036] The following describes a specific embodiment of a page testing method according to the present invention. Figure 2 This is a flowchart illustrating a page testing method provided by an embodiment of the present invention. This specification provides the operational steps of the method described in the embodiments or flowchart, but based on conventional or non-inventive methods, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or accompanying drawings. Specifically, as shown... Figure 2 As shown, the method may include:

[0037] S201: Receive a page test request sent by the client. The page test request carries test item information and configuration information of the target page. The test item information includes at least one selected from a group consisting of page object response test item information and page configuration check item information.

[0038] In this embodiment of the invention, the server receives a page test request sent by the client. The server can be a remote server. The test item information carried in the page test request may include at least one of the following: page object response test item information and page configuration check item information. The page object response test item information indicates the availability of the page object being tested, such as whether a function button responds to a click operation that meets the trigger conditions, and whether the response matches the trigger result. The page configuration check item information indicates whether the actual function of the page is consistent with the expected function (configured for it when the page was created). For example, if the expected function of page A is to be able to use item a, but the actual function of page A is to be able to use item b, then the actual function of page A is inconsistent with the expected function. The configuration information of the target page carried in the page test request may correspond to the trigger conditions and trigger results of the aforementioned function button, as well as the expected function configured for page A when it was created.

[0039] A target page can refer to a single page or at least two related pages (such as those that redirect to each other). In practice, a target page can be an event page awaiting launch during operation. After passing testing, the target page can be launched to aid marketing efforts, aiming to attract new users, retain existing users, increase activity, and boost revenue. Specifically, in the daily operation of online games, the content displayed on the target page can point to the online game itself.

[0040] In one specific embodiment, the target page includes at least one page object carrying trigger information, the trigger information including trigger conditions and trigger results. When the test item information includes content describing the response test of the target page object, the step of receiving the page test request sent by the client then includes: configuring test tags for the target page object according to the test item information.

[0041] The server can configure test tags for the target page object based on the page object's response test item information. These test tags indicate that the target page object requires response testing. This allows the server to more accurately identify page objects requiring response testing in subsequent steps. Furthermore, the test tags can also indicate the process (identifier) ​​for performing response testing on the target page object.

[0042] In another specific embodiment, receiving a page test request sent by the client further includes: parsing the page test request to obtain at least one parameter; and validating the at least one parameter. For example, the page test request is an HTTP (Hypertext Transfer Protocol) request. The server parses the HTTP request and can obtain at least one parameter: the URL (Uniform Resource Locator) of the target page, the request time, the test version number, etc. The server can validate the at least one parameter, and only execute subsequent steps after the validation is successful, thus blocking illegal data and effectively avoiding security issues. In practical applications, when the target page is an activity page to be launched during operation, the at least one parameter may include the activity identifier (id) corresponding to the activity page.

[0043] In another specific embodiment, after receiving the page test request sent by the client, the method further includes: creating a corresponding version number for the target page. The server creates a corresponding version number for the target page, which facilitates the management of the target page under test.

[0044] S202: Obtain the corresponding test program based on the test item information, wherein the corresponding test program is pre-configured;

[0045] In this embodiment of the invention, the server obtains the corresponding test program based on the test item information: when the test item information is page object response test item information, a test program for performing page object response testing is obtained; when the test item information is page configuration check item information, a test program for performing page configuration checks is obtained.

[0046] The corresponding test programs are pre-configured and do not require staff to write them based on page object response test requirements or page configuration check requirements. This greatly reduces the reliance on manual intervention during page testing.

[0047] In one specific embodiment, the server can configure test tags for the target page object based on the page object response test item information. These test tags can indicate the process (identifier) ​​for performing response testing on the target page object. Here, the corresponding test program can be obtained based on the response testing process (identifier) ​​indicated by the test tags.

[0048] In practical applications, the server may include functional modules, such as a functional module for performing page object response tests and a functional module for performing page configuration checks.

[0049] S203: Test the target page using the corresponding test program;

[0050] In this embodiment of the invention, the server can start the corresponding test program, which opens the target page and performs usability testing and consistency checks on the page objects in the target page.

[0051] In a specific embodiment, for usability testing of page objects, such as Figure 3 As shown, testing the target page using the corresponding testing program includes:

[0052] S301: The corresponding test program determines the target page object on the target page based on the test tag;

[0053] Based on the relevant information about "test tags" in step S201 above, the target page object that needs to be tested for response is determined by the corresponding test program.

[0054] Specifically, the step of the corresponding test program determining the target page object on the target page based on the test tag may include: the corresponding test program calling the application launch interface to launch the target application, the target application having image display function, and the application launch interface being provided by the kernel of the target application; and the corresponding test program using the target application to access the target page.

[0055] The target application can be a headless browser, where the corresponding test program calls the application launch interface provided by the browser kernel to launch the browser and access the target page.

[0056] S302: The corresponding test program triggers the target page object based on the triggering conditions corresponding to the target page object;

[0057] Specifically, the corresponding test program can call the object manipulation interface to perform operations on the target page object that meet the corresponding triggering conditions. The object manipulation interface is provided by the kernel of the target application. For example, if the triggering condition for function button A corresponds to a click operation, then the click operation can be simulated through the object manipulation interface provided by the browser kernel.

[0058] S303: The response result of the target page object is obtained by the corresponding test program.

[0059] Specifically, the corresponding test program can call a screenshot interface to capture the page triggered by the operation in response to the target page object. This screenshot interface is provided by the kernel of the target application. The first image obtained by capturing the triggered page is taken as the response result of the target page object. For example, if the trigger result of function button A corresponds to "add prop c to the target page", then the triggered page can be captured through the screenshot interface provided by the browser kernel, and thus the response result can be obtained.

[0060] Furthermore, the step of the corresponding test program calling the object operation interface to perform an operation on the target page object that meets the corresponding triggering conditions may, beforehand, include: the corresponding test program calling a screenshot interface to capture the target page and obtain a second image. Screenshots are taken before and after performing the operation that meets the corresponding triggering conditions, and the first image and the second image are used as the response results of the target page object. Images from two time points facilitate problem localization and subsequent debugging. Images from two time points also facilitate review and verification by staff.

[0061] It should be noted that the aforementioned application startup interface, object operation interface, and screenshot interface are browser kernel APIs (Application Programming Interfaces) that can be easily used based on open source libraries.

[0062] In another specific embodiment, for the consistency check of the target page: First, as Figure 4 As shown, when the test item information includes content describing page configuration checks on the target page, the step of testing the target page using the corresponding test program includes:

[0063] S401: Load the base file based on the generation path of the target page;

[0064] For example, if the target page is generated via a first-type path, meaning it was generated by a system including the server, then the base file is loaded based on this first-type path. This base file can be a common .js file (js: JavaScript, a lightweight, interpreted or just-in-time compiled programming language; the filename is common.js). Conversely, if the target page is generated via a second-type path, meaning it was generated by another system, then no base file is loaded based on this second-type path.

[0065] S402: When the current environment is a test environment, obtain the test file based on the base file;

[0066] Specifically, the test file can be stored by a test file server. The steps for obtaining the test file include: generating a test file retrieval request based on the base file; sending the test file retrieval request to the test file server; and receiving the test file returned by the test file server according to the environment parameters indicating the test environment.

[0067] The test file server can be an Apache server, based on an extended Apache server that dynamically injects test files. The Apache server filters each received Apache request (test file retrieval request) based on environment parameters: it determines whether it is currently in a test environment; if so, it returns the test file to the server.

[0068] The environment parameters may include at least one environment identifier and environment configuration data corresponding to each of the at least one environment identifier. For example, the environment configuration data may include at least a URL, username, and password. During testing, testing is first conducted in an offline testing environment, and then deployed online. Offline testing environments may include various environments such as functional testing environments, automated testing environments, and performance environments. The URL, username, and password may differ in each environment.

[0069] The test file server can be deployed as an extension of the system. This allows for isolation between internal and external networks, requires no additional dependencies during use, and can be discontinued immediately after use, making it convenient, efficient, and secure.

[0070] For a test file server deployed on an extended scale, it can be treated as an extension module and then configured based on the following code:

[0071]

[0072] Configuration options description: (1) The scope of the module is limited by the Location directive; (2) The configuration parameter EnableFilter can be used to control the switch of the module; (3) The configuration parameter InjectJs can be used to dynamically configure the injected content, and app.nav.js corresponds to the test file.

[0073] Furthermore, for each target page regardless of the generated path, the server can send a test file retrieval request to the test file server. The test file server determines whether the current request points to a base file (a public JS file). If so, it appends the test file (a test-specific JS file) to the end of the response body. Because the base file is loaded based on the aforementioned first type of path, it can also reflect the current test environment to some extent. This can be implemented based on the following code:

[0074]

[0075]

[0076] Among them, common.js corresponds to the base file, and the dynamic injection of test files is implemented based on "...pConfig->injectJs...".

[0077] Then, the corresponding test program tests the target page based on the test file. A consistency check is performed on the target page, that is, a consistency check is performed on the configuration of functions and the page description, thereby obtaining the page check results. Subsequently, staff can manually compare and confirm the page check results with the page function configuration details.

[0078] The comparison between page inspection results and page function configuration details can be performed using technologies such as Natural Language Processing (NLP) to improve the intelligence of page testing. NLP is an important direction in computer science and artificial intelligence. It studies various theories and methods that enable effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language, that is, the language people use in daily life, and thus it has a close relationship with linguistic research. NLP technologies typically include text processing, semantic understanding, machine translation, robot question answering, and knowledge graphs.

[0079] S204: Receive test progress information and test results returned by the corresponding test program based on the configuration information;

[0080] In this embodiment of the invention, the test progress information can reflect the current progress of specific page object response testing and page configuration checks, such as test in progress, test paused, test completed, etc. The test results can include intermediate test results and final test results. Specifically, the final test result can indicate whether the page object is usable and whether the target page meets consistency requirements. Intermediate test results can indicate whether the page object responds to operations that meet its triggering conditions, and if so, whether the response meets the requirements of its triggering result.

[0081] In one specific embodiment, the server stores the received test progress information and test results, which can be stored in a database.

[0082] After receiving the page test request from the client, the server creates a corresponding version number for the target page. Accordingly, the test progress information and test results can be stored based on this version number. The version number of the target page is related to this page test request and is unique. Based on this unique version number, it is convenient to record and view the corresponding test progress information and test results.

[0083] Furthermore, 1) test progress information and test results can be updated to the database via Common Gateway Interface (CGI) requests; 2) considering the decoupling of business logic and better scalability, test progress messages and test results can be sent to the message middleware first, and then stored in the database. Specifically, the server can store this data from the message middleware in a MySQL database (a relational database management system), and the frontend can subsequently query the relevant data through the MySQL database.

[0084] S205: Send the test progress information and the test results to the client.

[0085] In this embodiment of the invention, the client receives the test progress information and the test results sent by the server.

[0086] As can be seen from the technical solutions provided in the embodiments of this specification above, the embodiments of this specification provide a general server capable of providing page testing services. This server responds to a page testing request received from a client, obtains a testing program, uses the testing program to test the target page, receives the test progress information and test results returned by the testing program, and sends them to the client. This can reduce the functional limitations imposed on local machines participating in testing and ensure the rational utilization of local machine resources. Automation of page testing can improve testing efficiency, reduce reliance on manual labor in testing, and lower labor costs. In practical applications, pages are often frequently launched and released during operations. Consequently, the number of launched pages is large, and the number of pages requiring testing is also large. The page testing method provided in the embodiments of this specification can help achieve good results in testing activity pages, significantly reduce the access costs for development and testing personnel, eliminate repetitive work, and provide convenience for product personnel.

[0087] This invention also provides a page testing device, applied to the server side, such as... Figure 5 As shown, the device includes:

[0088] Test request receiving module 510: used to receive page test requests sent by the client, the page test request carrying test item information and target page configuration information, the test item information including at least one selected from a group consisting of page object response test item information and page configuration check item information;

[0089] Test program acquisition module 520: used to acquire the corresponding test program according to the test item information, wherein the corresponding test program is pre-configured;

[0090] Test module 530: Used to test the target page using the corresponding test program;

[0091] Test result receiving module 540: used to receive test progress information and test results returned by the corresponding test program based on the configuration information;

[0092] Test result sending module 550: used to send the test progress information and the test results to the client.

[0093] It should be noted that the apparatus and method embodiments described in the device embodiments are based on the same inventive concept.

[0094] This invention also provides a page testing system, which includes a server and a client. The client sends a page testing request to the server, the server executes the page testing method provided in the above embodiments, and the client receives test progress information and test results returned by the server.

[0095] like Figure 6 The system is primarily composed of two parts in its architecture: a web access service and a page testing function (module). The client can create a test interface, using this interface to receive page testing requests and send them to the server (corresponding to the page testing module). The test interface can be a visual interface, allowing users to perform related operations via a web interface. Test progress information and test results can also be displayed to the user through this test interface, with the test results displayed in at least one format selected from a group consisting of test reports and test screenshots.

[0096] The web access service allows users to easily launch and use various functions of the page testing service via a browser. It parses the browser's URL request, verifies the validity of the request parameters, and finally selects and executes the appropriate page testing module according to routing rules. Of course, the steps from parsing the browser's URL request to selecting the appropriate functional module for execution according to routing rules can also be completed by the server.

[0097] like Figure 7 As shown, 1) When a user starts a page test, the system can create a version number for each page of the current activity and store it in the database; after successful storage, it will start the page test service via an HTTP request. 2) After receiving the request, the Web access service will first verify the validity of the relevant parameters carried in the request (such as page URL, activity ID, request time, test version number, etc.), and will also perform authentication to ensure security. After the parameters are verified, the corresponding page test process of the page test module will be started immediately, and then the result that the page test process has been started will be returned to the user. 3) During the execution of the page test process, the test progress will be updated to the database in real time, and the test results will be saved to the database all at once after the page test is completed. The process will terminate the current process and update the test success status after the process is completed; if an exception occurs in the middle, the current process will be stopped and the error code will be updated to the database.

[0098] See also Figure 8-12 1) Users can... Figure 8 The "Auto Test" button in the middle can start automatic testing for the target page with one click; 2) such as Figure 9 As shown, during the automatic testing process, you can view the test progress in real time through the "Progress Preview" button; 3) As Figure 10 As shown, after the test is completed, you can start a second test using the "Retest" button and view the test results using the "Test Report" button; 4) The page inspection results will be displayed in the test report, which can be used to... Figure 11 5) Click the buttons provided in the "Activity Page Inspection" area to view the details; Figure 11 After clicking the "Go to Page" button, the page corresponding to the specific button (e.g., button 2 is bound to a region) will be displayed. On this page, you can directly view the test results for each page object. Each tested page object will have a "+" button next to it; clicking this "+" will immediately display the configuration details and page inspection results for that page object. See [link to relevant documentation]. Figure 12 .

[0099] The page testing system provided in this invention supports browser-based service launch. Users (such as product personnel) can launch the server's test scripts for page testing with a single click through their browser, eliminating the need for command-line launches and making it more convenient. Users (such as product personnel) can also view test progress information and results through their browser. When a completed target page is opened in the testing interface, the system automatically binds the test results to the tested page object, allowing users (such as product personnel) to directly view the test results for each tested page object.

[0100] It should be noted that the apparatus and method embodiments in the system embodiments are based on the same inventive concept.

[0101] This invention provides an electronic device including a processor and a memory. The memory stores at least one instruction or at least one program segment, which is loaded and executed by the processor to implement the page testing method provided in the above method embodiments.

[0102] Furthermore, Figure 13 A schematic diagram of the hardware structure of an electronic device for implementing the page testing method provided in the embodiments of the present invention is shown. The electronic device may participate in or include the page testing apparatus provided in the embodiments of the present invention. Figure 13 As shown, the electronic device 130 may include one or more processors 1302 (shown as 1302a, 1302b, ..., 1302n in the figure) 1302 (processor 1302 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 1304 for storing data, and a transmission device 1306 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 13 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 130 may also include... Figure 13 The more or fewer components shown, or having the same Figure 13 The different configurations shown.

[0103] It should be noted that the aforementioned one or more processors 1302 and / or other data processing circuitry are generally referred to herein as "data processing circuitry". This data processing circuitry may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be wholly or partially integrated into any other element within the electronic device 130 (or mobile device). As involved in the embodiments of this application, the data processing circuitry serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0104] The memory 1304 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in the embodiments of the present invention. The processor 1302 executes various functional applications and data processing by running the software programs and modules stored in the memory 134, thereby implementing the page testing method described above. The memory 1304 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1304 may further include memory remotely located relative to the processor 1302, and these remote memories can be connected to the electronic device 130 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0105] The transmission device 1306 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 130. In one example, the transmission device 1306 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In one embodiment, the transmission device 1306 may be a radio frequency (RF) module for wireless communication with the Internet.

[0106] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 130 (or mobile device).

[0107] Embodiments of the present invention also provide a storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a page testing method in the method embodiments. The at least one instruction or the at least one program is loaded and executed by the processor to implement the page testing method provided in the above method embodiments.

[0108] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0109] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0110] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and electronic device embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0111] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0112] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A page testing method, characterized in that, Applied to the server side, the method includes: Receive a page test request sent by the client. The page test request carries test item information and configuration information of the target page. The test item information includes at least one selected from a group consisting of page object response test item information and page configuration check item information. The corresponding test program is obtained based on the test item information, and the test program is pre-configured; The target page is tested using the aforementioned testing program; Receive test progress information and test results returned by the test program based on the configuration information; Send the test progress information and the test results to the client; Wherein, when the test item information includes content describing page configuration checks on the target page, the step of testing the target page using the test program includes: loading a base file based on the generation path of the target page; when the current environment is a test environment, generating a test file retrieval request based on the base file; sending the test file retrieval request to the test file server; and receiving the test file returned by the test file server according to the environment parameters indicating the test environment; wherein the environment parameters include at least one environment identifier and environment configuration data corresponding to the at least one environment identifier, and the environment configuration data includes at least a URL, username, and password; The step of testing the target page using the test program includes: the test program testing the target page based on the test file.

2. The method according to claim 1, characterized in that, The target page includes at least one page object carrying trigger information, which includes trigger conditions and trigger results. When the test item information includes content describing the response test of the target page object, the step of receiving the page test request sent by the client then includes: Configure test tags for the target page object based on the test item information; Accordingly, testing the target page using the testing program includes: The test program determines the target page object on the target page based on the test tags; The test program triggers the target page object based on the triggering conditions corresponding to the target page object; The test program obtains the response result of the target page object.

3. The method according to claim 2, characterized in that: The step of determining the target page object on the target page by the test program based on the test tag includes: The test program calls the application startup interface to launch the target application, which has an image display function. The application startup interface is provided by the kernel of the target application. The test program accesses the target page using the target application; The step of the test program triggering the target page object based on the triggering conditions corresponding to the target page object includes: The test program calls the object operation interface to perform operations on the target page object that meet the corresponding trigger conditions. The object operation interface is provided by the kernel of the target application. The step of obtaining the response result of the target page object by the test program includes: The test program calls a screenshot interface to capture the page triggered by the target page object's response to the operation. The screenshot interface is provided by the kernel of the target application. The first image obtained by capturing the page triggered by the above action is used as the response result of the target page object.

4. The method according to claim 3, characterized in that: The step of the test program calling the object operation interface to perform an operation on the target page object that meets the corresponding triggering conditions includes: The test program calls the screenshot interface to capture the target page and obtain a second image; The step of using the first image obtained by capturing the triggered page as the response result of the target page object includes: The first image and the second image are used as the response results of the target page object.

5. The method according to claim 1, wherein receiving the page test request sent by the client further includes: Parse the page test request to obtain at least one parameter; The validity of at least one parameter shall be verified.

6. The method according to claim 1, wherein receiving the page test request sent by the client further includes: Create a corresponding version number for the target page; Accordingly, receiving the test progress information and test results returned by the test program then includes: The test progress information and the test results are stored based on the version number.

7. A page testing device, characterized in that, Applied to the server side, the device includes: Test request receiving module: used to receive page test requests sent by the client. The page test request carries test item information and target page configuration information. The test item information includes at least one selected from a group consisting of page object response test item information and page configuration check item information. Test program acquisition module: used to acquire the corresponding test program based on the test item information, wherein the test program is pre-configured; Test module: Used to test the target page using the test program; Test result receiving module: used to receive test progress information and test results returned by the test program based on the configuration information; Test result sending module: used to send the test progress information and the test results to the client; Wherein, when the test item information includes content describing page configuration checks on the target page, the device is further configured to: load a base file based on the generation path of the target page before testing the target page using the test program; when the current environment is a test environment, generate a test file retrieval request based on the base file; send the test file retrieval request to the test file server; receive a test file returned by the test file server according to environment parameters indicating the test environment; the environment parameters include at least one environment identifier and environment configuration data corresponding to the at least one environment identifier, the environment configuration data including at least a URL, username, and password; The testing module is also used to: have the testing program test the target page based on the test file.

8. The apparatus according to claim 7, characterized in that, The target page includes at least one page object carrying trigger information, the trigger information including trigger conditions and trigger results. When the test item information includes content describing the response test of the target page object, the device is further configured to: after receiving the page test request sent by the client, configure test tags for the target page object according to the test item information. Accordingly, the testing module is also used to: determine the target page object on the target page by the testing program based on the test tag; The test program triggers the target page object based on the triggering conditions corresponding to the target page object; The test program obtains the response result of the target page object.

9. The apparatus according to claim 8, characterized in that: The testing module is also used to: determine the target page object on the target page by the testing program according to the test tag, and start the target application by the testing program calling the application startup interface. The target application has an image display function, and the application startup interface is provided by the kernel of the target application. The test program accesses the target page using the target application; The step of the test program triggering the target page object based on the triggering conditions corresponding to the target page object includes: The test program calls the object operation interface to perform operations on the target page object that meet the corresponding trigger conditions. The object operation interface is provided by the kernel of the target application. The step of obtaining the response result of the target page object by the test program includes: The test program calls a screenshot interface to capture the page triggered by the target page object's response to the operation. The screenshot interface is provided by the kernel of the target application. The first image obtained by capturing the page triggered by the above action is used as the response result of the target page object.

10. The apparatus according to claim 9, characterized in that: The testing module is also used to: before the test program calls the object operation interface to perform an operation on the target page object that meets the corresponding triggering conditions, the test program calls the screenshot interface to capture the target page to obtain a second image; The step of using the first image obtained by capturing the page triggered as the response result of the target page object includes: using the first image and the second image as the response result of the target page object.

11. The apparatus according to claim 7, further configured to: after receiving the page test request sent by the client, parse the page test request to obtain at least one parameter; The validity of at least one parameter shall be verified.

12. The apparatus according to claim 7, further configured to: after receiving a page test request sent by the client, create a corresponding version number for the target page; After receiving the test progress information and test results returned by the test program, the test progress information and test results are stored based on the version number.

13. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the page testing method as described in any one of claims 1-6.

14. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the page testing method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Test method and device of mobile terminal application

    CN105468518A