CN110618934A - Front-end automatic test debugging method and device and computer readable storage medium - Google Patents
Front-end automatic test debugging method and device and computer readable storage medium Download PDFInfo
- Publication number
- CN110618934A CN110618934A CN201910755964.XA CN201910755964A CN110618934A CN 110618934 A CN110618934 A CN 110618934A CN 201910755964 A CN201910755964 A CN 201910755964A CN 110618934 A CN110618934 A CN 110618934A
- Authority
- CN
- China
- Prior art keywords
- test
- positioning information
- page
- webpage
- browser
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 253
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000007246 mechanism Effects 0.000 claims description 21
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 claims description 7
- 229910052711 selenium Inorganic materials 0.000 claims description 7
- 239000011669 selenium Substances 0.000 claims description 7
- 230000004807 localization Effects 0.000 claims 3
- 230000008569 process Effects 0.000 abstract description 19
- 238000004891 communication Methods 0.000 description 6
- 230000000737 periodic effect Effects 0.000 description 6
- 230000002457 bidirectional effect Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 238000000605 extraction Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention relates to a front-end testing technology, and discloses a front-end automatic testing and debugging method, a device and a computer readable storage medium, wherein the method comprises the following steps: receiving a test instruction and displaying a browser; capturing a specified webpage in the browser according to a preset webpage capturing rule; acquiring elements of the specified webpage; repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct; and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test. The invention repeatedly adjusts the positioning information of the elements through the pre-configured test tool, and each adjustment does not need to start from the first step of the process, thereby improving the debugging efficiency.
Description
Technical Field
The invention relates to the technical field of front-end testing, in particular to a front-end automatic testing and debugging method, a front-end automatic testing and debugging device and a computer readable storage medium.
Background
The existing front-end automated testing scheme in the industry is mainly based on Selenium, and the implementation difficulty lies in the positioning of elements. The positioning of complex page elements usually requires a large amount of debugging work to complete script writing, the debugging process is usually repeated after the script is written, and each execution needs to start from the first step of the process. For long flows, the amount of work to debug is enormous and tedious.
An effective solution to the problems in the related art has not been proposed yet.
Disclosure of Invention
The present invention provides a front-end automated test debugging method, apparatus and computer readable storage medium for solving the above technical problems in the related art.
Therefore, the invention adopts the following specific technical scheme:
according to an aspect of the present invention, there is provided a front-end automated test debugging method applied in an electronic device, the method including:
receiving a test instruction and displaying a browser;
capturing a specified webpage in the browser according to a preset webpage capturing rule;
acquiring elements of the specified webpage;
repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
Further, the step of receiving the test instruction and displaying the browser comprises:
the step of receiving the test instruction and displaying the browser comprises the following steps:
sending a test task acquisition request to a test server;
receiving the test instruction returned by the test server;
and displaying the browser according to the test instruction. .
Further, the step of obtaining the elements of the specified web page includes:
setting front and back HTML tags of a designated position;
and extracting elements of the page between the front HTML tag and the rear HTML tag of the specified position from the webpage.
Further, the element positioning mechanism of the test tool comprises at least one of a positioning mechanism of a Selenium test tool or a positioning mechanism of an automated test framework.
Further, the step of writing the positioning information into an automated test script for automated testing comprises:
obtaining the threshold value of each test item in the positioning information;
analyzing the feedback test data according to the threshold value of each test item;
generating a test report according to the analysis result;
and determining the execution condition of each test script according to the test report.
The invention also provides an electronic device, which comprises a memory and a processor, wherein the memory is stored with a front-end automatic test debugging program which can run on the processor, and when being executed by the processor, the front-end automatic test debugging program realizes the following steps:
receiving a test instruction and displaying a browser;
capturing a specified webpage in the browser according to a preset webpage capturing rule;
acquiring elements of the specified webpage;
repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
Further, the step of receiving the test instruction and displaying the browser comprises:
sending a test task acquisition request to a test server;
receiving the test instruction returned by the test server;
and displaying the browser according to the test instruction.
Further, the step of obtaining the elements of the specified web page includes:
setting front and back HTML tags of a designated position;
and extracting elements of the page between the front HTML tag and the rear HTML tag of the specified position from the webpage.
Further, the step of writing the positioning information into an automated test script for automated testing comprises:
obtaining the threshold value of each test item in the positioning information;
analyzing the feedback test data according to the threshold value of each test item;
generating a test report according to the analysis result;
and determining the execution condition of each test script according to the test report.
According to yet another aspect of the present invention, a computer-readable storage medium is provided, on which a front-end automated test debugging program is stored, the front-end automated test debugging program being executable by one or more processors to implement the steps of the front-end automated test debugging method described above.
The invention has the beneficial effects that: the invention repeatedly adjusts the positioning information of the elements through the pre-configured test tool, and each adjustment does not need to start from the first step of the process, thereby improving the debugging efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a front-end automated test debugging method according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of an electronic device according to an embodiment of the invention.
FIG. 3 is a block diagram of an embodiment of an electronic device according to the invention.
Detailed Description
For further explanation of the various embodiments, the drawings which form a part of the disclosure and which are incorporated in and constitute a part of this specification, illustrate embodiments and, together with the description, serve to explain the principles of operation of the embodiments, and to enable others of ordinary skill in the art to understand the various embodiments and advantages of the invention, and, by reference to these figures, reference is made to the accompanying drawings, which are not to scale and wherein like reference numerals generally refer to like elements.
According to the embodiment of the invention, a front-end automatic test debugging method, a front-end automatic test debugging device and a computer readable storage medium are provided.
Referring to the drawings and the detailed description, the invention will be further described, as shown in fig. 1, in which a front-end automated test debugging method according to an embodiment of the invention is applied to an electronic device, and the method includes:
step S101, receiving a test instruction and displaying a browser;
step S102, capturing a specified webpage in the browser according to a preset webpage capturing rule;
step S103, acquiring elements of the specified webpage;
step S104, repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and step S105, after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
Further, step S101 includes:
sending a test task acquisition request to a test server;
receiving the test instruction returned by the test server;
and displaying the browser according to the test instruction.
The page fetching process involves at least one master node and at least one page fetching node, and the step S102 includes:
sending a request for acquiring the page grabbing node to a main control node;
receiving address information of the page grabbing nodes distributed by the main control node;
and capturing the specified webpage in the browser according to the webpage capturing node corresponding to the address information and a preset webpage capturing rule.
The main control node selects and distributes corresponding page grabbing node addresses for different requests in a page grabbing node list; for example, in a specific application, the information of two nodes, namely a first page capture node and a second page capture node, is in the current available page capture node list, the first page capture node is located at a first position in the list, the second page capture node is located at a second position in the list, the page capture node located at the first position can be selected according to a set rule according to the position sequence of the page capture nodes in the managed and maintained available page capture list each time, and if the first page capture node is located at the first position of the available page capture node list, after the first page capture node is selected, the address information of the selected and allocated first page capture node is output to a requester for acquiring the page capture node.
In order to ensure that the available page grabbing node list managed and maintained by the main control node is updated in time, the main control node, the first page grabbing nodes and the second page grabbing nodes preferably adopt a periodic bidirectional heartbeat mechanism to perform periodic mutual authentication through a communication network.
The periodic bidirectional heartbeat mechanism includes: the page grabbing node periodically provides information of normal work of the page grabbing node to the main control node; and the master control node periodically and actively sends verification information to the page grabbing nodes recorded by the master control node.
The page grabbing node periodically provides the information that the page grabbing node works normally to the main control node, and the page grabbing node is realized in the following mode: after the first page grabbing node and the second page grabbing node are started, periodically sending own identity identification information, such as information including an internet address and a process port number where the page grabbing node is located, to the main control node according to a set time interval; after receiving the identity identification information sent by the first page grabbing node and the second page grabbing node, the master control node judges whether the first page grabbing node and the second page grabbing node exist in an available page grabbing node list or not according to the identity identification information of the page grabbing nodes contained in the identity identification information; and if the first page grabbing node is already stored in the available page grabbing node list and the second page grabbing node is not, recording the second page grabbing node into the available page grabbing node list. The mechanism can enable the main control node to acquire all available page grabbing nodes, and omission is avoided.
Further, the step of obtaining the elements of the specified web page includes:
setting front and back HTML tags of a designated position;
and extracting elements of the page between the front HTML tag and the rear HTML tag of the specified position from the webpage.
For example, in a specific application, since valid information in a page is in an HTML tag, a designated position is generally an HTML tag, the designated position is defined by HTML tags before and after the designated position, and elements of the page between the HTML tags before and after the designated position are to be extracted. For example, for a page from a certain site server, if it is desired to extract certain information from the page, the customized page extraction rule should include the HTML tag < div > before and after the field. When the page is parsed, information between the two HTML tags < div > is extracted therefrom.
Further, the element positioning mechanism of the test tool comprises at least one of a positioning mechanism of a Selenium test tool or a positioning mechanism of an automated test framework.
Further, the writing the positioning information into an automated test script for automatic testing comprises:
obtaining the threshold value of each test item in the positioning information;
analyzing the feedback test data according to the threshold value of each test item;
generating a test report according to the analysis result;
and determining the execution condition of each test script according to the test report.
For example, in a specific application, the threshold of each test item refers to a standard value of each test item, after the machine to be tested completes the test, the test data corresponding to the test operation is fed back to the server, and the server compares the fed-back test data with the threshold of each test item, so as to determine the test condition. The fed back test data comprises the total number of the request resources, the total loading flow, the total request response time, the DOM loading time, the page loading time, the data flow of each url request, the total resource size of each data type, the total resource request time and the buried point configuration condition in the test process. And analyzing the fed back test data according to the threshold value of each test item, namely comparing the threshold value of each test item with the size of the fed back test data, generating a test report according to the comparison result, and determining the execution condition of each test script according to the test report.
The step of sending a test task acquisition request to the test server includes:
judging whether a test task corresponding to the test task acquisition request exists or not;
and if so, returning the corresponding test task to the test server.
Optionally, the step of sending the test task obtaining request to the test server further includes:
providing a front-end page, and receiving the submitted test tasks or test cases through the front-end page.
For example, in a specific application, a user can submit a test task and a test case to the test server by logging in a specified website. In addition, the user can log in different accounts according to the service types.
Optionally, the step of sending the test task obtaining request to the test server further includes:
receiving a registration request through the front-end page, and generating a corresponding account according to the registration request;
receiving a login request through the front-end page, authenticating the login request, and returning login success information through the front-end page after the authentication is successful;
and storing the submitted test tasks or test cases into the corresponding logged accounts.
For example, in a specific application, after logging in a designated account, the test server requests a test task under the account, and then determines whether there is a test task corresponding to the test task acquisition request, that is, determines whether there is an unexecuted test task in the account.
By means of the technical scheme, the positioning information can be repeatedly adjusted through a tool after the specified page is reached without starting from the first step of the process, and whether the positioning information is correct or not is determined; the element positioning mechanism of the tool is derived from the positioning mechanism of the Selenium and the automated testing framework, so that the positioning information obtained by debugging the tool can be ensured to be used for the automated testing script; the invention repeatedly adjusts the positioning information of the elements through the pre-configured test tool, and each adjustment does not need to start from the first step of the process, thereby improving the debugging efficiency.
The invention further provides an electronic device 1, which is shown in fig. 2 and is a schematic diagram of an internal structure of the electronic device 1 according to an embodiment of the invention.
In the embodiment, the electronic device 1 may be a computer or a server. The electronic device 1 comprises at least a memory 11, a processor 13, a communication bus 15, and a network interface 17.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic apparatus 1 in other embodiments, such as a plug-in hard disk provided on the electronic apparatus 1, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic apparatus 1. The memory 11 may be used to store not only application software installed in the electronic device 1 and various types of data, such as codes of the front-end automation test debugging program 111, but also temporarily store data that has been output or is to be output.
The processor 13 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data.
The communication bus 15 is used to realize connection communication between these components.
The network interface 17 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the electronic apparatus 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also comprise a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device and for displaying a visualized user interface.
While FIG. 2 shows only the electronic device 1 with the components 11-17, those skilled in the art will appreciate that the configuration shown in FIG. 2 is not intended to be limiting of the electronic device 1, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
In the embodiment of the electronic device 1 shown in fig. 2, the memory 11 stores therein a front-end automated test debugging program 111; the processor 13 implements the following steps when executing the front-end automated test debugger program 111 stored in the memory 11:
receiving a test instruction and displaying a browser;
capturing a specified webpage in the browser according to a preset webpage capturing rule;
acquiring elements of the specified webpage;
repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
Further, the steps include:
sending a test task acquisition request to a test server;
receiving the test instruction returned by the test server;
and displaying the browser according to the test instruction.
The page fetching process involves at least one master node and at least one page fetching node, and the step S102 includes:
sending a request for acquiring the page grabbing node to a main control node;
receiving address information of the page grabbing nodes distributed by the main control node;
and capturing the specified webpage in the browser according to the webpage capturing node corresponding to the address information and a preset webpage capturing rule.
The main control node selects and distributes corresponding page grabbing node addresses for different requests in a page grabbing node list; for example, in a specific application, the information of two nodes, namely a first page capture node and a second page capture node, is in the current available page capture node list, the first page capture node is located at a first position in the list, the second page capture node is located at a second position in the list, the page capture node located at the first position can be selected according to a set rule according to the position sequence of the page capture nodes in the managed and maintained available page capture list each time, and if the first page capture node is located at the first position of the available page capture node list, after the first page capture node is selected, the address information of the selected and allocated first page capture node is output to a requester for acquiring the page capture node.
In order to ensure that the available page grabbing node list managed and maintained by the main control node is updated in time, the main control node, the first page grabbing nodes and the second page grabbing nodes preferably adopt a periodic bidirectional heartbeat mechanism to perform periodic mutual authentication through a communication network.
The periodic bidirectional heartbeat mechanism includes: the page grabbing node periodically provides information of normal work of the page grabbing node to the main control node; and the master control node periodically and actively sends verification information to the page grabbing nodes recorded by the master control node.
The page grabbing node periodically provides the information that the page grabbing node works normally to the main control node, and the page grabbing node is realized in the following mode: after the first page grabbing node and the second page grabbing node are started, periodically sending own identity identification information, such as information including an internet address and a process port number where the page grabbing node is located, to the main control node according to a set time interval; after receiving the identity identification information sent by the first page grabbing node and the second page grabbing node, the master control node judges whether the first page grabbing node and the second page grabbing node exist in an available page grabbing node list or not according to the identity identification information of the page grabbing nodes contained in the identity identification information; and if the first page grabbing node is already stored in the available page grabbing node list and the second page grabbing node is not, recording the second page grabbing node into the available page grabbing node list. The mechanism can enable the main control node to acquire all available page grabbing nodes, and omission is avoided.
Further, the step of obtaining the elements of the specified web page includes:
setting front and back HTML tags of a designated position;
and extracting elements of the page between the front HTML tag and the rear HTML tag of the specified position from the webpage.
For example, in a specific application, since valid information in a page is in an HTML tag, a designated position is generally an HTML tag, the designated position is defined by HTML tags before and after the designated position, and elements of the page between the HTML tags before and after the designated position are to be extracted. For example, for a page from a certain site server, if it is desired to extract certain information from the page, the customized page extraction rule should include the HTML tag < div > before and after the field. When the page is parsed, information between the two HTML tags < div > is extracted therefrom.
Further, the step of writing the positioning information into an automated test script for automatic testing includes:
obtaining the threshold value of each test item in the positioning information;
analyzing the feedback test data according to the threshold value of each test item;
generating a test report according to the analysis result;
and determining the execution condition of each test script according to the test report.
For example, in a specific application, the threshold of each test item refers to a standard value of each test item, after the machine to be tested completes the test, the test data corresponding to the test operation is fed back to the server, and the server compares the fed-back test data with the threshold of each test item, so as to determine the test condition. The fed back test data comprises the total number of the request resources, the total loading flow, the total request response time, the DOM loading time, the page loading time, the data flow of each url request, the total resource size of each data type, the total resource request time and the buried point configuration condition in the test process. And analyzing the fed back test data according to the threshold value of each test item, namely comparing the threshold value of each test item with the size of the fed back test data, generating a test report according to the comparison result, and determining the execution condition of each test script according to the test report.
Further, the step of sending the test task acquisition request to the test server includes:
judging whether a test task corresponding to the test task acquisition request exists or not;
and if so, returning the corresponding test task to the test server.
Optionally, the step of sending the test task obtaining request to the test server further includes:
providing a front-end page, and receiving the submitted test tasks or test cases through the front-end page.
For example, in a specific application, a user can submit a test task and a test case to the test server by logging in a specified website. In addition, the user can log in different accounts according to the service types.
Optionally, the step of sending the test task obtaining request to the test server further includes:
receiving a registration request through the front-end page, and generating a corresponding account according to the registration request;
receiving a login request through the front-end page, authenticating the login request, and returning login success information through the front-end page after the authentication is successful;
and storing the submitted test tasks or test cases into the corresponding logged accounts.
For example, in a specific application, after logging in a designated account, the test server requests a test task under the account, and then determines whether there is a test task corresponding to the test task acquisition request, that is, determines whether there is an unexecuted test task in the account.
By means of the technical scheme, the positioning information can be repeatedly adjusted through a tool after the specified page is reached without starting from the first step of the process, and whether the positioning information is correct or not is determined; the element positioning mechanism of the tool is derived from the positioning mechanism of the Selenium and the automated testing framework, so that the positioning information obtained by debugging the tool can be ensured to be used for the automated testing script; the invention repeatedly adjusts the positioning information of the elements through the pre-configured test tool, and each adjustment does not need to start from the first step of the process, thereby improving the debugging efficiency.
An embodiment of the present invention further provides a computer-readable storage medium, where a front-end automated test and debug program is stored on the computer-readable storage medium, and the front-end automated test and debug program can be executed by one or more processors to implement the following operations:
receiving a test instruction and displaying a browser;
capturing a specified webpage in the browser according to a preset webpage capturing rule;
acquiring elements of the specified webpage;
repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
The embodiment of the computer readable storage medium of the present invention is substantially the same as the embodiments of the electronic device and the method, and will not be described herein in a repeated manner.
Alternatively, in other embodiments, the front-end automatic test debugging program may be further divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more microprocessors (in this embodiment, the processor 13) to implement the present invention.
For example, referring to fig. 3, a schematic diagram of program modules of the front-end automated test debugging program 111 in an embodiment of the apparatus of the present invention is shown, in this embodiment, the front-end automated test debugging program 111 may be divided into a receiving module 10, a page fetching module 20, an element obtaining module 30, an element locating module 40, and an element detecting module 50, which exemplarily:
the receiving module 10 is used for receiving the test instruction and displaying the browser;
the page grabbing module 20 is configured to grab a specified webpage in the browser according to a preset page grabbing rule;
an element obtaining module 30, configured to obtain an element of the specified webpage;
an element positioning module 40, configured to repeatedly adjust positioning information of the element through a preconfigured test tool to determine whether the positioning information is correct;
and the element detection module 50 is configured to, after determining that the positioning information is correct, write the positioning information into an automated test script for automatic testing.
The functions or operation steps implemented by the program modules such as the receiving module 10, the page fetching module 20, the element obtaining module 30, the element positioning module 40, and the element detecting module 50 when executed are substantially the same as those of the above embodiments, and are not described herein again.
In summary, with the above technical solution of the present invention, the positioning information can be adjusted repeatedly by a tool after reaching the designated page without starting from the first step of the process, so as to determine whether the positioning information is correct; the element positioning mechanism of the tool is derived from the positioning mechanism of the Selenium and the automated testing framework, so that the positioning information obtained by debugging the tool can be ensured to be used for the automated testing script; the invention repeatedly adjusts the positioning information of the elements through the pre-configured test tool, and each adjustment does not need to start from the first step of the process, thereby improving the debugging efficiency.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (10)
1. A debugging method of front-end automation test is applied to an electronic device, and is characterized in that the method comprises the following steps:
receiving a test instruction and displaying a browser;
capturing a specified webpage in the browser according to a preset webpage capturing rule;
acquiring elements of the specified webpage;
repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
2. The front-end automated test debugging method of claim 1, wherein the step of receiving test instructions and displaying a browser comprises:
sending a test task acquisition request to a test server;
receiving the test instruction returned by the test server;
and displaying the browser according to the test instruction.
3. The front-end automated test debugging method of claim 1, wherein the step of obtaining elements of the specified webpage comprises:
setting front and back HTML tags of a designated position;
and extracting elements of the page between the front HTML tag and the rear HTML tag of the specified position from the webpage.
4. The front-end automated test debugging method of claim 1, wherein the element localization mechanism of the test tool comprises at least one of a localization mechanism of a Selenium test tool or a localization mechanism of an automated test framework.
5. The front-end automated test debugging method of claim 1, wherein said step of writing said positioning information into an automated test script for automated testing comprises:
obtaining the threshold value of each test item in the positioning information;
analyzing the feedback test data according to the threshold value of each test item;
generating a test report according to the analysis result;
and determining the execution condition of each test script according to the test report.
6. An electronic device, comprising a memory and a processor, wherein the memory stores a front-end automated test debugger program executable on the processor, and the front-end automated test debugger program when executed by the processor implements the steps of:
receiving a test instruction and displaying a browser;
capturing a specified webpage in the browser according to a preset webpage capturing rule;
acquiring elements of the specified webpage;
repeatedly adjusting the positioning information of the element through a pre-configured testing tool to determine whether the positioning information is correct;
and after the positioning information is determined to be correct, writing the positioning information into an automatic test script for automatic test.
7. The electronic device of claim 6, wherein the step of receiving the test instruction and displaying the browser comprises:
sending a test task acquisition request to a test server;
receiving the test instruction returned by the test server;
and displaying the browser according to the test instruction. .
8. The electronic device of claim 6, wherein the step of obtaining the elements of the specified web page comprises:
setting front and back HTML tags of a designated position;
and extracting elements of the page between the front HTML tag and the rear HTML tag of the specified position from the webpage.
9. The electronic device of claim 6, wherein the step of writing the positioning information into an automated test script for automated testing comprises:
obtaining the threshold value of each test item in the positioning information;
analyzing the feedback test data according to the threshold value of each test item;
generating a test report according to the analysis result;
and determining the execution condition of each test script according to the test report.
10. A computer-readable storage medium having stored thereon a front-end automated test debugging program executable by one or more processors for performing the steps of the front-end automated test debugging method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910755964.XA CN110618934A (en) | 2019-08-15 | 2019-08-15 | Front-end automatic test debugging method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910755964.XA CN110618934A (en) | 2019-08-15 | 2019-08-15 | Front-end automatic test debugging method and device and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110618934A true CN110618934A (en) | 2019-12-27 |
Family
ID=68921207
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910755964.XA Pending CN110618934A (en) | 2019-08-15 | 2019-08-15 | Front-end automatic test debugging method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110618934A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666220A (en) * | 2020-06-30 | 2020-09-15 | 成都新潮传媒集团有限公司 | Method and device for generating Web page object test file |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102982161A (en) * | 2012-12-05 | 2013-03-20 | 北京奇虎科技有限公司 | Method and device for acquiring webpage information |
CN103729285A (en) * | 2012-10-11 | 2014-04-16 | 腾讯科技(深圳)有限公司 | Method, device and system for testing web page |
CN105095088A (en) * | 2015-09-02 | 2015-11-25 | 厦门美图移动科技有限公司 | Calculator automatic test method and test system based on uiautomator test framework |
CN106547689A (en) * | 2016-10-20 | 2017-03-29 | 金航数码科技有限责任公司 | A kind of automatic test cases development system and method based on web |
CN107451052A (en) * | 2017-07-11 | 2017-12-08 | 广州慧睿思通信息科技有限公司 | One kind is based on Web system positioning webpage element test method |
CN107957948A (en) * | 2017-12-07 | 2018-04-24 | 郑州云海信息技术有限公司 | A kind of user interface automatic test device and method |
US20180173606A1 (en) * | 2016-12-15 | 2018-06-21 | Syntel, Inc. | Hybrid testing automation engine |
CN108595329A (en) * | 2018-04-23 | 2018-09-28 | 腾讯科技(深圳)有限公司 | A kind of application testing method, device and computer storage media |
CN109254910A (en) * | 2018-08-08 | 2019-01-22 | 北京城市网邻信息技术有限公司 | A kind of test method of application program, device, electronic equipment and storage medium |
CN109710528A (en) * | 2018-12-25 | 2019-05-03 | 中国人民财产保险股份有限公司 | A kind of test script generation method, device, equipment and medium |
-
2019
- 2019-08-15 CN CN201910755964.XA patent/CN110618934A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103729285A (en) * | 2012-10-11 | 2014-04-16 | 腾讯科技(深圳)有限公司 | Method, device and system for testing web page |
CN102982161A (en) * | 2012-12-05 | 2013-03-20 | 北京奇虎科技有限公司 | Method and device for acquiring webpage information |
CN105095088A (en) * | 2015-09-02 | 2015-11-25 | 厦门美图移动科技有限公司 | Calculator automatic test method and test system based on uiautomator test framework |
CN106547689A (en) * | 2016-10-20 | 2017-03-29 | 金航数码科技有限责任公司 | A kind of automatic test cases development system and method based on web |
US20180173606A1 (en) * | 2016-12-15 | 2018-06-21 | Syntel, Inc. | Hybrid testing automation engine |
CN107451052A (en) * | 2017-07-11 | 2017-12-08 | 广州慧睿思通信息科技有限公司 | One kind is based on Web system positioning webpage element test method |
CN107957948A (en) * | 2017-12-07 | 2018-04-24 | 郑州云海信息技术有限公司 | A kind of user interface automatic test device and method |
CN108595329A (en) * | 2018-04-23 | 2018-09-28 | 腾讯科技(深圳)有限公司 | A kind of application testing method, device and computer storage media |
CN109254910A (en) * | 2018-08-08 | 2019-01-22 | 北京城市网邻信息技术有限公司 | A kind of test method of application program, device, electronic equipment and storage medium |
CN109710528A (en) * | 2018-12-25 | 2019-05-03 | 中国人民财产保险股份有限公司 | A kind of test script generation method, device, equipment and medium |
Non-Patent Citations (3)
Title |
---|
MAURIZIO LEOTTA: "Using Multi-Locators to Increase the Robustness of Web Test Cases", 《 2015 IEEE 8TH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST)》 * |
曹磊: "一种基于Selenium的Web应用软件的Web应用软件自动化测试平台设计与实现", 《科研信息化技市与应用》 * |
赵梦影: "基于Selenium的数据自动抓取软件设计与实现", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666220A (en) * | 2020-06-30 | 2020-09-15 | 成都新潮传媒集团有限公司 | Method and device for generating Web page object test file |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9229844B2 (en) | System and method for monitoring web service | |
RU2648966C2 (en) | Apparatus and method for processing multiple open api | |
CN106815031B (en) | Kernel module loading method and device | |
WO2019169757A1 (en) | Test control and test execution device and method, and computer storage medium | |
CN108829838B (en) | Batch processing method of account information and server | |
CN108874922B (en) | Client device, webpage rendering method based on single page application and storage medium | |
CN110798445B (en) | Public gateway interface testing method and device, computer equipment and storage medium | |
CN112800309A (en) | Crawler system based on HTTP proxy and implementation method thereof | |
CN109190062B (en) | Crawling method and device for target corpus data and storage medium | |
US20150302089A1 (en) | Recovery of Information from Commercial Web Portals | |
CN108427639B (en) | Automated testing method, application server and computer readable storage medium | |
CN108255735B (en) | Associated environment testing method, electronic device and computer readable storage medium | |
CN110750443A (en) | Webpage testing method and device, computer equipment and storage medium | |
CN111431767A (en) | Multi-browser resource synchronization method and device, computer equipment and storage medium | |
CN112672187B (en) | Page generation method and device, computer equipment and readable storage medium | |
US20180210819A1 (en) | System and method of controlling a web browser plug-in for testing analytics | |
CN111221711A (en) | User behavior data processing method, server and storage medium | |
CN112818270B (en) | Data cross-domain transfer method and device and computer equipment | |
CN114006885A (en) | Data acquisition method and device based on intelligent equipment and electronic equipment | |
CN113688022A (en) | Browser performance monitoring method, device, equipment and medium | |
CN110874475A (en) | Vulnerability mining method, vulnerability mining platform and computer readable storage medium | |
CN110618934A (en) | Front-end automatic test debugging method and device and computer readable storage medium | |
CN111046316B (en) | Application on-shelf state monitoring method, intelligent terminal and storage medium | |
CN115065510B (en) | Login method, device, system, electronic equipment and readable storage medium | |
CN107483294B (en) | Method and device for monitoring network request |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191227 |
|
RJ01 | Rejection of invention patent application after publication |