[go: up one dir, main page]

HK1186809A1 - Webpage product developing and testing system, testing method and device thereof - Google Patents

Webpage product developing and testing system, testing method and device thereof

Info

Publication number
HK1186809A1
HK1186809A1 HK13114273.4A HK13114273A HK1186809A1 HK 1186809 A1 HK1186809 A1 HK 1186809A1 HK 13114273 A HK13114273 A HK 13114273A HK 1186809 A1 HK1186809 A1 HK 1186809A1
Authority
HK
Hong Kong
Prior art keywords
test
page element
webpage
page
user
Prior art date
Application number
HK13114273.4A
Other languages
Chinese (zh)
Other versions
HK1186809B (en
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 阿里巴巴集團控股有限公司 號郵箱
Publication of HK1186809A1 publication Critical patent/HK1186809A1/en
Publication of HK1186809B publication Critical patent/HK1186809B/en

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a development testing system, a testing method and a device for a webpage product. According to the technical scheme of an embodiment of the invention, a testing case inputted by a user for page elements is received and stored by a testing frame embedded into the webpage product, the page elements are tested according to the testing case selected by the user to obtain a testing result, testing and development for the webpage product can be integrated on the same resource platform, testing progress can be accelerated, testing period can be shortened, a developer can perform testing only by designing the testing case without specially writing testing codes for the testing case, testing complexity can be reduced, and testing efficiency can be improved, so that the problems that development and testing for the webpage product are separated, the testing progress is backward, testing efficiency is low and development requirements cannot be met in the prior art can be solved.

Description

Development test system, test method and device for webpage product
Technical Field
The present application relates to network technologies, and in particular, to a development test system, a test method, and an apparatus for web products.
Background
At present, in the process of website development, testing development results is an essential link. The test work needs to compile test codes and test cases for the developed products, and run the test codes and test cases on a specially deployed test server to detect whether the developed products meet specific requirements.
However, with the increasing complexity of the website architecture system, the testing period is continuously lengthened, the testing cost is continuously increased, and the testing efficiency is continuously reduced. In the test work, a new test environment needs to be deployed for a new product, so that the hardware cost is increased, the test work is complicated, the test complexity is increased, and the test efficiency is reduced. For products with complex and huge architectures, the compiling work of test codes and test cases is correspondingly complex and tedious, and for new products which are continuously developed, new test codes and test cases need to be continuously compiled, so that the test period is prolonged, and the test efficiency is reduced. Therefore, under the current development and test environment, the progress of the test work is backward, the cost is increased, the efficiency is low, and the requirements of the development work can not be met.
Therefore, the problems that the development work and the test work of the webpage product are separated, the test progress is backward, the efficiency is low and the requirement of the development work cannot be met exist in the prior art.
Disclosure of Invention
In view of this, the embodiment of the present application provides a development test system for a web product, so as to solve the problems that in the prior art, the development work and the test work of the web product are separated, the test progress is backward, the efficiency is low, and the requirements of the development work cannot be met.
Correspondingly, the embodiment of the application also provides a method and a device for testing the webpage product.
The embodiment of the application comprises the following technical scheme:
a development test system for web products, comprising: a development framework, further comprising: the test framework and the shunting device are embedded in the webpage product; the shunting device is used for identifying a request of a user, sending the request to a test frame when the identification request comprises an address pre-allocated to the test frame under the home domain name of the webpage product, and sending the request to a development frame when the identification request comprises the address pre-allocated to the development frame under the home domain name of the webpage product; the test framework is used for being triggered when the request from the shunting device is received, and receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of a webpage product; the test case comprises test operation executed on the page element; according to a test case selected by a user in the stored test cases and the identification of the page element corresponding to the selected test case, positioning the page element corresponding to the identification of the page element in the webpage product; and executing the test operation indicated in the selected test case on the positioned page elements to obtain a test result.
A method for testing a web product, comprising: when a user accesses an address pre-allocated to a test frame under the home domain name of a webpage product, triggering the test frame embedded in the webpage product; the triggered test framework receives and stores a test case input by a user aiming at a page element in a webpage to be tested of a webpage product; the test case comprises test operation executed on the page element; according to the test case selected by the user in the stored test cases and the identification of the page element corresponding to the selected test case, the page element corresponding to the identification of the page element is positioned in the webpage product, and the test operation indicated in the selected test case is executed on the positioned page element to obtain a test result.
A test apparatus for a web product, the test apparatus being embedded in the web product and having an address pre-assigned under a home domain name of the web product, the test apparatus comprising: the test case management unit is used for receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of a webpage product; the test case comprises test operation executed on the page element; the object management unit is used for positioning the page element corresponding to the identifier of the page element in the webpage product according to the test case selected by the user from the test cases stored in the test case management unit and the page element identifier corresponding to the selected test case; and the test execution unit is used for executing the test operation indicated in the selected test case on the page element positioned by the object management unit to obtain a test result.
According to the technical scheme of the embodiment of the application, the test frame is embedded in the webpage product in advance, the address which is pre-allocated to the test frame under the main domain name of the webpage product is allocated to the test frame, the webpage product comprising the test frame and the development frame are deployed on the same server, the test frame is used for receiving and storing the test case which is input by a user aiming at the webpage element, the webpage element is tested according to the test case selected by the user, and the test result is obtained, the test work and the development work of the webpage product can be integrated under the same resource platform, so that the development personnel can test the developed webpage product in time, the progress of the test work can be accelerated, and the period of the test work can be shortened; through the test framework provided by the embodiment of the application, developers can carry out test work only by designing the test cases without compiling test codes specially for the test cases, so that the complexity degree of the test work can be reduced, and the efficiency of the test work can be improved; therefore, the technical scheme provided by the embodiment of the application can solve the problems that the development work and the test work of the webpage product are separated, the test progress is backward, the efficiency is low and the requirement of the development work cannot be met in the prior art.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
Fig. 1 is a schematic structural framework diagram of a development testing system for a web product according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of the operation of the embodiment of the shunt device shown in FIG. 1;
fig. 3 is a flowchart illustrating a method for testing a web product according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of the operation of a preferred embodiment of the method shown in FIG. 3;
fig. 5 is a schematic view of a display page structure of a test frame according to an embodiment of the present disclosure;
fig. 6 is a block diagram of a testing apparatus for web products according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described with reference to the accompanying drawings, and it should be understood that the embodiments described herein are merely illustrative and explanatory of the application and are not restrictive of the application.
At present, in the prior art, the problems of backward test progress, cost increase, low efficiency and incapability of meeting the requirements of development work exist in the test work of a webpage product, and the embodiment of the application provides a solution to the problem, namely a test solution for the webpage product.
In the test scheme for the web page product provided by the embodiment of the application, the test frame is embedded in the web page product in advance, the address pre-allocated for the test frame is under the main domain name of the web page product, the web page product including the test frame and the development frame are deployed on the same server, the test case input by a user aiming at the page element is received and stored through the test frame, the page element is tested according to the test case selected by the user to obtain a test result, the test work and the development work of the web page product can be fused under the same resource platform, so that the development personnel can test the developed web page product in time, the progress of the test work can be accelerated, and the period of the test work can be shortened; by the test framework provided by the embodiment of the application, a developer can perform test work only by designing the test case without compiling test codes specially for the test case, so that the complexity of the test work can be reduced, and the efficiency of the test work can be improved; therefore, the technical scheme provided by the embodiment of the application can solve the problems that the development work and the test work of the webpage product are separated, the test progress is backward, the efficiency is low and the requirement of the development work cannot be met in the prior art.
The following provides a detailed description of examples of the present application.
Fig. 1 shows a structural framework of a development testing system for a web product provided in an embodiment of the present application, and as shown in fig. 1, the system includes a development framework 1, a Test framework (BIT) 2 embedded in the web product, and a offloading device 3, preferably, the web product, the development framework 1, the Test framework 2, and the offloading device 3 are located in the same server.
The shunting device 3 is used for identifying the request of a user, sending the request to the testing frame 2 when the identification request comprises an address pre-allocated by the testing frame 2 under the main domain name of the webpage product, and sending the request to the development frame 1 when the identification request comprises an address pre-allocated by the development frame 1 under the main domain name of the webpage product;
the testing frame 2 is connected to the shunting device 3, and is used for being triggered when receiving a request from the shunting device 3, receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of a webpage product; the test case comprises test operation executed on the page element; according to a test case selected by a user in the stored test cases and a page element identifier corresponding to the selected test case, positioning a page element corresponding to the page element identifier in the webpage product; and executing the test operation indicated in the selected test case on the positioned page elements to obtain a test result.
In a preferred mode, the test frame 2 may be embedded in the web product in advance by means of a two-party library. Specifically, after the test frame 2 is constructed, the test frame 2 is stored on the remote server, and the storage address of the test frame 2 on the remote server is written in the packaging manifest file of the web product, for example, the storage address of the test frame 2 is written in a Project Object Model (POM) file. And an address is allocated to the testing frame 2 under the main domain name of the web product, the address may be a subdirectory name under the main domain name of the web product, for example, the main domain name of the web product is http:// a.net, and the address allocated to the testing frame is: http:// a.nebit/index. htm. When the webpage product is packaged, the packaging tool downloads the test frame 2 to the local of the webpage product from the remote server according to the storage address of the test frame 2 of the packaging list file, packages the test frame 2 into the webpage product package, and embeds the test frame into the webpage product. The test framework 2 can be accessed by subsequently starting the webpage product package.
In the specific implementation process, the test frame is embedded in the webpage product in advance, so that only one test environment (namely the test frame) needs to be deployed for each webpage product, and the test frame can be accessed to the address under the main domain name of the webpage product to directly perform related test operations, thereby avoiding the problem that in the prior art, repeated loading (including page updating and downloading + checking of public file updating and downloading + loading of public page + loading of public shared file) needs to be performed on the test environment in each test work, so that the test time can be remarkably saved, and according to the experience statistical condition, the test time can be saved by 60% for each test case on average.
In a preferred mode, the offloading device 3 analyzes an HTTP request (HTTP request) issued by the browser, and sends the HTTP request to the test framework 2 when the HTTP request includes an address of the test framework 2 under the main domain name of the web product, and sends the HTTP request to the development framework 1 when the HTTP request includes an address of the development framework 1 under the main domain name of the web product. In the specific implementation process, the offloading device 3 may be implemented by a Servlet technology, the HTTP request is identified and offloaded by a Filter in the Servlet technology, and the HTTP request is responded by a Servlet, as shown in fig. 2, the offloading device 3 offloads the request sent by the user, and includes the following steps:
step 21, when the Listener monitors the HTTP Request sent by the browser, sending the HTTPRequest to a Filter in the shunting device 3;
step 22, the Filter analyzes the HTTP Request, and when the HTTP Request is a Request (i.e., a BIT Request) for the test framework 2 and the offline test environment is in an open state, the Filter sends the BIT Request to an interface BIT Servlet of the test framework, and the process proceeds to step 23; when the HTTP Request is a general application Request APP Request (including a Request to the development framework 1), sending the HTTP Request to an application interface APP Servlet (the interface also handles the Request to the development framework), and processing proceeds to step 24;
step 23, when the BIT Servlet judges that the user is a legal user, sending the BIT request to the APPSERrvlet;
and step 24, the APP Servlet processes the BIT Request or the APP Request of the user.
Through the system shown in fig. 1, the test frame is embedded in the web product in advance, the address pre-allocated to the test frame under the main domain name of the web product is allocated to the web product and the development frame which comprise the test frame on the same server, and the test work and the development work of the web product can be integrated under the same resource platform, so that developers can test the developed web product in time, thereby accelerating the progress of the test work and shortening the period of the test work.
The working principle of the test using the test framework is explained below.
Fig. 3 is a flowchart illustrating a method for testing a web product according to an embodiment of the present application, where as shown in fig. 1, the method includes the following processing procedures:
step 31, triggering a test frame embedded in the webpage product when a user accesses an address pre-allocated to the test frame under the main domain name of the webpage product;
step 32, the triggered test frame receives and stores a test case input by a user aiming at a page element in a webpage to be tested of the webpage product; the test case comprises test operation executed on the page element;
and step 33, according to the test case selected by the user in the stored test cases and the identification of the page element targeted by the selected test case, positioning the page element corresponding to the identification of the page element in the webpage product, and executing the test operation indicated in the selected test case on the positioned page element to obtain a test result.
According to the method shown in fig. 3, the test case input by the user for the page element is received and stored through the test frame embedded in the web product, and the page element is tested according to the test case selected by the user to obtain the test result, so that the developer can test the developed web product in time, thereby accelerating the progress of the test work and shortening the period of the test work; moreover, developers can carry out test work only by designing test cases without compiling test codes specially for the test cases, so that the complexity degree of the test work can be reduced, and the efficiency of the test work can be improved; therefore, the technical scheme provided by the embodiment of the application can solve the problems that the development work and the test work of the webpage product are separated, the test progress is backward, the efficiency is low and the requirement of the development work cannot be met in the prior art.
Fig. 4 shows a work flow diagram of a preferred embodiment of the method shown in fig. 3, which, as shown in fig. 4, comprises the following processes:
step 41, after the test frame is triggered, reading a webpage to be tested in a webpage product, storing a Uniform Resource Locator (URL) of the webpage to be tested, displaying an identifier of the read webpage to be tested and an identifier of a page element of the webpage to be tested, wherein the identifier of the webpage to be tested includes a name and/or URL of the webpage to be tested, the identifier of the page element includes a name and/or a Locator of the page element, and the Locator records position information of the page element on the webpage to be tested;
specifically, the name of the webpage to be tested can be displayed in the form of a tab tag, and the URL of the webpage to be tested is actually stored, so that the tab tag is the name of the webpage to be tested with a directory structure for a user, and is the URL of the webpage to be tested with a tree structure for a processing program in a testing frame, and therefore, the operation of the user and the operation of the program in the testing frame on the webpage to be tested are facilitated;
step 42, receiving and storing a test case input by a user aiming at the identification of the page to be tested and the identification of the page elements in the page to be tested, which are selected from the displayed identification of the page to be tested and the identification of the page elements in the page to be tested, wherein the test case comprises test operation executed on the page elements and test expected values of the page elements, and establishing a test point corresponding relation among the identification of the page to be tested selected by the user, the identification of the page elements in the page to be tested and the test case input by the user;
specifically, similar to the display manner in step 41, the user may select a web page to be tested from the names of the web pages to be tested in the directory structure displayed in the tab tag format, the testing frame reads the web page to be tested according to the URL of the web page to be tested selected by the user, and displays the web page to be tested selected by the user and the identifiers of the page elements in the web page to be tested, the specific display condition may be as shown in fig. 5, a page view 501 displays the name of the web page to be tested in the directory structure, a tested page view 502 displays the page information of the web page to be tested selected by the user, an element view 503 displays the name of the page elements of the web page to be tested, after the user selects the page elements to be tested, the testing frame finds the locators of the page elements selected by the user, and receives the testing operation and the expected value input by the user in the requirement, establishing a URL of a webpage to be tested selected by a user, a locator of a page element in the webpage to be tested, and a test operation and a test expected value input by the user to construct a test file;
preferably, a user can input a plurality of test cases for the same page element, and the plurality of test cases may include different types of test operations performed on the page element, so that test points with different page elements are formed according to the different types of test operations;
wherein the types of test operations include: clicking (for example, clicking a link, clicking a button, clicking a radio box or a multi-box), evaluating (for example, reading an attribute value of a page element, for example, reading a color of an edit box), and assigning (for example, assigning a character string to a page element, for example, assigning a user name and a password, and assigning a value to an edit box);
under the condition that the test operation is assignment operation, test data corresponding to the assignment operation is also included in the test case input by the user, the test frame additionally stores the test data corresponding to the assignment operation input by the user as a test data file, and establishes a corresponding relation between the test file of the assignment operation and the test data file corresponding to the assignment operation, namely an assignment data corresponding relation;
step 43, according to the test case selected by the user from the stored test cases, determining a test file including the selected test case, searching the identification of the to-be-tested webpage corresponding to the selected test case in the determined test file, reading the to-be-tested webpage corresponding to the identification of the searched to-be-tested webpage, and positioning the page element corresponding to the page element identification in the read to-be-tested webpage according to the page element identification in the determined test file;
specifically, similar to the display manner in step 41, the user may select a web page to be tested (e.g. page view 501 in fig. 5) for testing from the names of the web pages to be tested in the directory structure, the testing frame reads the web page to be tested according to the URL of the web page to be tested selected by the user, and displays the web page to be tested selected by the user (e.g. tested page view 502 in fig. 5) and the names of the page elements in the web page to be tested (e.g. element view 503 in fig. 5), after the user selects the page elements to be tested, the testing frame finds the locators of the selected page elements, and finds the test cases corresponding to the web page to be tested and the page elements selected by the user according to the URL of the web page to be tested selected by the user, the locators of the page elements, and displays the contents of all found test cases in the form of a list, the method comprises the steps that test operations and test expected values included by test cases are displayed, test data are displayed in a list form, and the specific display condition can be shown as a requirement view 504 in fig. 5, so that a user can clearly check whether the test cases cover all requirements of the test points, and when the user needs to perfect the test cases, a test framework receives and stores the modification of the content in the test cases by the user; compared with the prior art, the content in the test case is displayed in a list form by sequentially calling the test cases and checking the content in the test cases, so that a user can effectively check and perfect the test cases, and the efficiency of test work can be improved;
step 44, a plurality of test cases of different test operation types selected by a user aiming at the same page element are merged into different test tasks according to the test operation types, each test task comprises the test case of the same test operation type, and the test cases included in each test task are sequentially executed on the same page element obtained by positioning according to the type of the test tasks obtained by merging; in the specific implementation process, the test case is executed according to the test task, so that the test efficiency can be improved;
when a user selects a test case for a plurality of page elements, the test cases for different page elements can be merged into different test flows, each test flow comprises a plurality of test cases for the same page element, and each test flow can also comprise a plurality of test tasks;
step 45, before the test operation is executed on the positioned page element, calling a preset HTTP request to log in under the condition that the read webpage to be tested comprises a login task, wherein the preset HTTP request comprises preset login information;
step 46, executing the test operation indicated in the selected test case on the positioned page element; the method specifically comprises the following steps: under the condition that the test operation is clicking, clicking and positioning the obtained page elements; under the condition that the test operation is a value, reading the attribute value of the positioned page element; under the condition that the test operation is assigned, reading the test data in the test data file corresponding to the assignment operation according to the established assignment data corresponding relation, and assigning the read test data to the positioned page element;
in step 46, the embodiment of the present application merges the operations on the page elements into three types: clicking, dereferencing and assigning to enable the testing framework to execute various testing operations on page elements, so that a universal testing effect can be achieved, a user does not need to compile corresponding testing codes aiming at testing cases, and the testing efficiency can be improved;
in the above steps 45 and 46, by presetting the HTTP request for logging and storing the test data as an individual test data file, the test flow can be separated from the test data, which is convenient for maintaining, updating and modifying the test case; by calling a preset HTTP request or a separately stored test data file, the problem of test time waste caused by manual data input can be avoided in the test execution process, the test time can be shortened, and the test efficiency can be improved; in the specific implementation process of the embodiment of the application, the positioning, assignment operation and login operation of a Document Object Model (DOM) element (i.e. a page element) are realized through a Jquery technology, so that the time of at least 2 to 10 seconds can be saved in a single assignment operation, and the time of at least 5 seconds can be saved in a single login operation;
step 47, comparing the obtained test result with the test expected value in the selected test case, and if the obtained test result is consistent with the test expected value, the test is successful, otherwise, the test fails, ending the subsequent test operation, and submitting the test case with the test failure to the remote Bug management system;
in the embodiment of the application, the Bug management system can effectively position the webpage and the page element to be tested, which are failed in the test, according to the reported test cases, and is beneficial to feeding back development work;
and step 48, performing post data cleaning work, for example, deleting the user information registered in the test.
As can be seen from the processing procedure shown in fig. 4, the test framework provided in the embodiment of the present application can effectively manage the test cases input by the user for the page elements, and can effectively test the page elements according to the test cases selected by the user, thereby shortening the test time, improving the test efficiency, and achieving the effect of "universal test", so that the user does not need to compile separate test codes for the test cases, and thus the problems of separated development work and test work for the web products, lagged test progress, low efficiency, and incapability of meeting the requirements of development work in the prior art can be solved.
The method for testing the webpage product provided by the embodiment of the application can be realized not only by hardware, but also by a software program, namely, by the following device for testing the webpage product.
Fig. 6 is a schematic structural diagram illustrating a testing apparatus for a web product according to an embodiment of the present application, the testing apparatus being embedded in the web product and having an address pre-assigned under a home domain name of the web product, as shown in fig. 6, and the testing apparatus including: a test case management unit 61, an object management unit 62, and a test execution unit 63.
The test case management unit 61 is used for receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of a webpage product; the test case comprises test operation executed on the page element;
the object management unit 62 is connected to the test case management unit 61, and is configured to locate, in the web product, a page element corresponding to the identifier of the page element according to the test case selected by the user from the test cases stored in the test case management unit 61 and the identifier of the page element targeted by the selected test case;
and the test execution unit 63 is connected to the object management unit 62, and is configured to execute the test operation indicated in the selected test case on the page element located by the object management unit 62, so as to obtain a test result.
The working principle of the device shown in fig. 6 is shown in fig. 2, and will not be described in detail here.
According to the device shown in fig. 6, the test device embedded in the web product can also be used for receiving and storing the test case input by the user for the page element, and performing test operation on the page element according to the test case selected by the user to obtain a test result, so that the developer can test the developed web product in time, thereby accelerating the progress of test work and shortening the period of test work; moreover, developers can carry out test work only by designing test cases without compiling test codes specially for the test cases, so that the complexity degree of the test work can be reduced, and the efficiency of the test work can be improved; therefore, the technical scheme provided by the embodiment of the application can solve the problems that the development work and the test work of the webpage product are separated, the test progress is backward, the efficiency is low and the requirement of the development work cannot be met in the prior art.
In a preferred manner, the test case management unit 61 is further configured to: receiving and storing a test case input by a user aiming at the identification of the page to be tested and the identification of the page element in the page to be tested, which are selected from the displayed identification of the page to be tested and the identification of the page element in the page to be tested, and constructing the identification of the page to be tested and the identification of the page element in the page to be tested selected by the user and the test case input by the user into a test file; specifically, storing test data corresponding to assignment operation input by a user as a test data file, and establishing an assignment data corresponding relation between the test file of the assignment operation and the test data file corresponding to the assignment operation; and for a plurality of test cases of the same test operation type selected by the user for the same page element, displaying the content included in each test case in a list form, and receiving and storing the modification of the content in the displayed test cases by the user.
The object management unit 62 is specifically configured to: after the testing device is triggered, reading a webpage to be tested in a webpage product, and displaying the read identification of the webpage to be tested and the identification of a page element of the webpage to be tested; according to the test case selected by the user from the test cases stored in the test case management unit 61, a test file including the selected test case is determined, the identification of the to-be-tested webpage corresponding to the selected test case is searched in the determined test file, the to-be-tested webpage corresponding to the searched identification of the to-be-tested webpage is read, and the page element corresponding to the page element identification is positioned in the read to-be-tested webpage according to the page element identification in the determined test file.
A test execution unit 63, further configured to: the method comprises the steps that a plurality of test cases of different test operation types selected by a user aiming at the same page element are merged into different test tasks according to the test operation types, each test task comprises the test case of the same test operation type, and the test cases included in each test task are sequentially executed on the same page element obtained by positioning the object management unit 62 according to the type of the merged test task; before testing operation is executed on the positioned page elements, a preset hypertext transfer protocol (HTTP) request is called to log in under the condition that the read webpage to be tested comprises a login task, wherein the preset HTTP request comprises preset login information; when the test operation is executed, under the condition that the test operation is clicking on the page element, the page element obtained through positioning is clicked, under the condition that the test operation is dereferencing the page element, the attribute value of the page element obtained through positioning is read, under the condition that the test operation is dereferencing the page element, the test data in the test data file corresponding to the dereferencing operation is read according to the established corresponding relation of the valuing data, and the read test data is endowed to the page element obtained through positioning; and comparing the obtained test result with the test expected value in the selected test case, when the obtained test result is consistent with the test expected value, the test is successful, otherwise, the test fails, the subsequent test operation is ended, and the test case with the test failure is submitted to the remote Bug management system.
The preferred embodiment of the apparatus of fig. 6, as shown in fig. 4, is not described in detail herein.
To sum up, in the test scheme for the web page product provided in the embodiment of the present application, the test frame is embedded in the web page product in advance, and the address pre-assigned to the test frame is under the main domain name of the web page product, the web page product including the test frame and the development frame are deployed on the same server, the test frame receives and stores the test case input by the user for the page element, and the page element is tested according to the test case selected by the user to obtain the test result, so that the test work and the development work on the web page product can be integrated under the same resource platform, and the developer can test the developed web page product in time, thereby accelerating the progress of the test work and shortening the cycle of the test work; moreover, developers can carry out test work only by designing test cases without compiling test codes specially for the test cases, so that the complexity degree of the test work can be reduced, and the efficiency of the test work can be improved; therefore, the technical scheme provided by the embodiment of the application can solve the problems that the development work and the test work of the webpage product are separated, the test progress is backward, the efficiency is low and the requirement of the development work cannot be met in the prior art.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (12)

1. A development test system for web products, comprising: a development framework, further comprising: the test framework and the shunting device are embedded in the webpage product;
the shunting device is used for identifying a request of a user, sending the request to the test framework when the request is identified to include an address pre-allocated to the test framework under the home domain name of the webpage product, and sending the request to the development framework when the request is identified to include an address pre-allocated to the development framework under the home domain name of the webpage product;
the test framework is used for being triggered when a request from the shunting device is received, and receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of the webpage product; the test case comprises a test operation executed on a page element; according to a test case selected by a user in the stored test cases and the identification of the page element corresponding to the selected test case, positioning the page element corresponding to the identification of the page element in the webpage product; and executing the test operation indicated in the selected test case on the positioned page elements to obtain a test result.
2. The system of claim 1, wherein the flow diversion device is further configured to:
and when the request is identified to comprise an address pre-allocated to the test framework under the main domain name of the webpage product, sending the request to the test framework under the condition that the offline test environment is in an open state and the user is a legal user.
3. A method for testing a web product, comprising:
when a user accesses an address pre-allocated to a test frame under a home domain name of a webpage product, triggering the test frame embedded in the webpage product;
the triggered test frame receives and stores a test case input by a user aiming at a page element in a webpage to be tested of the webpage product; the test case comprises a test operation executed on a page element;
according to the test case selected by the user in the stored test cases and the identification of the page element corresponding to the selected test case, the page element corresponding to the identification of the page element is positioned in the webpage product, and the test operation indicated in the selected test case is executed on the positioned page element to obtain a test result.
4. The method of claim 3, further comprising:
after the test frame is triggered, reading the webpage to be tested in the webpage product, and displaying the read identification of the webpage to be tested and the identification of the page element of the webpage to be tested;
receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of the webpage product, specifically comprising the following steps:
and receiving and storing a test case input by a user aiming at the identification of the page to be tested selected by the user from the displayed identification of the page to be tested and the identification of the page element in the page to be tested, and constructing the identification of the page to be tested selected by the user, the identification of the page element in the page to be tested and the input test case into a test file.
5. The method according to claim 4, wherein positioning, in the web product, a page element corresponding to the identifier of the page element according to the test case selected by the user from the stored test cases and the identifier of the page element targeted by the selected test case specifically includes:
according to the test case selected by the user in the stored test cases, determining a test file comprising the selected test case, searching the identification of the webpage to be tested corresponding to the selected test case in the determined test file, reading the webpage to be tested corresponding to the identification of the searched webpage to be tested, and positioning the page element corresponding to the identification of the page element in the read webpage to be tested according to the page element identification in the determined test file.
6. The method of claim 5, further comprising:
before the test operation is executed on the positioned page elements, a preset hypertext transfer protocol (HTTP) request is called to log in under the condition that the read webpage to be tested comprises a login task, wherein the preset HTTP request comprises preset login information.
7. The method of claim 4, wherein the type of test operation comprises: clicking, dereferencing and assigning the page elements; under the condition that the type of the test operation is assignment, the test case also comprises test data which is input by a user and corresponds to the assignment operation;
executing the test operation indicated in the selected test case on the positioned page element, and the method comprises the following steps:
under the condition that the test operation included in the selected test case is to click on the page element, clicking and positioning the obtained page element;
reading the attribute value of the positioned page element under the condition that the test operation included in the selected test case is used for taking the value of the page element;
and under the condition that the test operation included in the selected test case is used for assigning values to the page elements, assigning the test data corresponding to the assignment operation to the located page elements.
8. The method of claim 7, wherein storing test cases input by a user for page elements in a web page to be tested of the web product further comprises: storing test data corresponding to the assignment operation input by a user as a test data file, and establishing an assignment data corresponding relation between the test file of the assignment operation and the test data file corresponding to the assignment operation;
assigning the test data corresponding to the assignment operation to the located page element, specifically comprising: and reading the test data in the test data file corresponding to the assignment operation according to the established assignment data corresponding relation, and assigning the read test data to the positioned page element.
9. The method of claim 7, further comprising:
the method comprises the steps that a plurality of test cases of different test operation types selected by a user aiming at the same page element are merged into different test tasks according to the test operation types, and each test task comprises the test cases of the same test operation type;
and according to the category of the test tasks obtained by the merging, sequentially executing the test cases included in each test task on the same page element obtained by positioning.
10. The method of claim 7, further comprising:
displaying the content included in each test case in a list form for a plurality of test cases selected by a user aiming at the same page element;
modifications of the content in the displayed test case by the user are received and stored.
11. The method of claim 3, wherein the test case further comprises: testing expected values of page elements;
the method further comprises the following steps: and comparing the obtained test result with the test expected value in the selected test case, when the obtained test result is consistent with the test expected value, the test is successful, otherwise, the test fails, the subsequent test operation is ended, and the test case with the test failure is submitted to the remote Bug management system.
12. A testing apparatus for web products, wherein the testing apparatus is embedded in a web product and has an address pre-assigned under a home domain name of the web product, the testing apparatus comprising:
the test case management unit is used for receiving and storing a test case input by a user aiming at a page element in a webpage to be tested of the webpage product; the test case comprises a test operation executed on a page element;
the object management unit is used for positioning the page element corresponding to the page element identifier in the webpage product according to the test case selected by the user from the test cases stored in the test case management unit and the page element identifier corresponding to the selected test case;
and the test execution unit is used for executing the test operation indicated in the selected test case on the page element positioned and obtained by the object management unit to obtain a test result.
HK13114273.4A 2013-12-25 Webpage product developing and testing system, testing method and device thereof HK1186809B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210133936.2A CN103377127B (en) 2012-04-28 2012-04-28 The development and testing system of web page product, method of testing and device

Publications (2)

Publication Number Publication Date
HK1186809A1 true HK1186809A1 (en) 2014-03-21
HK1186809B HK1186809B (en) 2017-02-17

Family

ID=

Also Published As

Publication number Publication date
CN103377127B (en) 2016-04-13
CN103377127A (en) 2013-10-30

Similar Documents

Publication Publication Date Title
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN108595329B (en) Application testing method and device and computer storage medium
CN103377127B (en) The development and testing system of web page product, method of testing and device
US10169206B2 (en) Simultaneous multi-platform testing
CN109902016B (en) Web test method and test platform
US9203720B2 (en) Monitoring the health of web page analytics code
CN107896244B (en) Version file distribution method, client and server
US20040111727A1 (en) Automatic context management for web applications with client side code execution
US7343523B2 (en) Web-based analysis of defective computer programs
CN111522738A (en) Test method and device of micro-service system, storage medium and electronic equipment
CN102346780B (en) The acquisition methods of web page address and acquisition device
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN104331369A (en) Browser-based webpage detection method and device, and server
CN111767109A (en) H5 page display method, device and readable storage medium based on terminal application
CN110543429B (en) Test case debugging method, device and storage medium
CN113760763A (en) Software testing method, apparatus, server and system
CN117370203B (en) Automatic test method, system, electronic equipment and storage medium
CN112395184A (en) Information acquisition method, equipment and computer storage medium
CN104793957B (en) The method and apparatus that a kind of detection service device has website
CN104834594B (en) Web system method of testing and device
CN112559278B (en) Method and device for acquiring operation data
CN105117340A (en) URL (Uniform Resource Locator) detection method and device used for quality evaluation of iOS browser application
CN111538606A (en) Method, device and equipment for testing and simulating Dubbo interface
CN115514677A (en) Server dial testing method and system