CN110737585A - UI (user interface) automatic test case and system and page element loading waiting method and system - Google Patents
UI (user interface) automatic test case and system and page element loading waiting method and system Download PDFInfo
- Publication number
- CN110737585A CN110737585A CN201910819938.9A CN201910819938A CN110737585A CN 110737585 A CN110737585 A CN 110737585A CN 201910819938 A CN201910819938 A CN 201910819938A CN 110737585 A CN110737585 A CN 110737585A
- Authority
- CN
- China
- Prior art keywords
- page
- page element
- time length
- searching
- target page
- 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.)
- Withdrawn
Links
Images
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
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- 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/3688—Test management for test execution, e.g. scheduling of test suites
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 provides UI automatic test cases and systems, and page element loading waiting methods and systems, which can be used for acquiring identification information of a target page element, searching a preset method for searching the page element in a page corresponding to the identification information, executing the searched method for searching the page element in the page, circularly searching the target page element in the target page at a preset frequency within a preset time length t1, continuing to execute the current UI automatic test case when the target page element is searched within a preset time length t1, and otherwise stopping executing the current UI automatic test case and returning corresponding error reporting information.
Description
Technical Field
The invention relates to the field of automatic test of a UI (user interface), in particular to UI automatic test cases and systems and a page element loading waiting method and system, which are used for improving the efficiency of executing the automatic test cases and increasing the stability of executing the automatic test cases in the process of executing the UI automatic test cases.
Background
In the UI automation test process, the response speed of the page and the loading speed of the page elements both affect whether the execution of the UI automation test case passes or not.
Currently, the processing methods for waiting for loading page elements in the UI automation test process include:
(1) explicit wait for page load:
this approach prespecifies a fixed duration of time to wait for page loading, i.e., every elements in the page need to wait for the fixed duration of time prespecified during loading, which is time-consuming and results in relatively inefficient execution of the automated test case.
(2) Implicit wait for page load:
based on the mode, after the whole page is loaded successfully within the specified time length, the phenomenon that the page elements are not loaded successfully within the specified time length often occurs, so that locating probability is not enough to locate the page element to be tested (namely, a target page element), the whole test is failed, and the stability of the test is influenced.
The invention provides UI automation test cases and systems and a page element loading waiting method and system, which are used for solving the problems.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides UI automatic test cases and systems and a page element loading waiting method and system, which are used for improving the efficiency of executing the automatic test cases and increasing the stability of executing the automatic test cases in the process of executing the UI automatic test cases.
, the invention provides page element loading waiting methods, which are used for UI automation test cases, and the page element loading waiting methods include:
acquiring identification information of a target page element; the identification information is id or element address information of the target page element; the target page element is a page element to be tested in the current UI automation test case;
searching a preset method for searching page elements in a page corresponding to the identification information;
executing the searched method for searching the page elements in the page, and circularly searching the target page elements in the target page at a preset frequency within a preset time length t 1;
and when the target page element is found within the preset time length t1, continuing to execute the current UI automation test case, otherwise, stopping executing the current UI automation test case and returning corresponding error reporting information.
Further , the different identification information corresponds to different methods for finding page elements in a page.
, the method for performing the search for finding the page element in the page circularly searches the target page element in the target page at a predetermined frequency within a preset time length t1, wherein the method for performing the search for finding the page element in the page searches the target page element times in a preset time length t1 at intervals of a preset time length t2, and the preset time length t2 is less than or equal to the preset time length t 1.
In step , the preset time period t1 is 1 minute, and the preset time period t2 is 5 seconds.
In a second aspect, the present invention provides kinds of page element loading waiting systems, for UI automation test cases, where the page element loading waiting system includes:
the element identification information acquisition unit is used for acquiring identification information of the target page element; the identification information is id or element address information of the target page element; the target page element is a page element to be tested in the current UI automation test case;
the searching method searching unit is used for searching a preset method for searching page elements in the page corresponding to the identification information;
the element loading waiting unit executes the searched method for searching the page element in the page, and circularly searches the target page element in the target page at a preset frequency within a preset time length t 1; and an element loading waiting result unit, when the target page element is found within a preset time length t1, continuing to execute the current UI automation test case, otherwise, stopping executing the current UI automation test case and returning corresponding error reporting information.
Further , the different identification information corresponds to different methods for finding page elements in a page.
, in the element loading waiting unit, the method for performing the search for finding the page element in the page circularly searches the target page element in the target page at a predetermined frequency within a preset time length t1, wherein the method for performing the search for finding the page element in the page searches the target page element times at intervals of a preset time length t2 within a preset time length t1, and the preset time length t2 is less than or equal to the preset time length t 1.
In step , the preset time period t1 is 1 minute, and the preset time period t2 is 5 seconds.
In a third aspect, the present invention provides UI automation test cases, where corresponding program codes are integrated in the UI automation test cases, and are used for automatically executing the methods in the foregoing aspects.
In a fourth aspect, the present invention provides UI automation test systems, including groups of automation test cases, where each automation test case employs the UI automation test case as described above.
The beneficial effect of the invention is that,
according to the UI automatic test case and system, the page element loading waiting method and system provided by the invention, the target page element can be circularly searched in the target page within the preset time length at the preset frequency, the current UI automatic test case is continuously executed when the target page element is searched, otherwise, the current UI automatic test case is stopped to be executed and corresponding error reporting information is returned.
In addition, the invention has reliable design principle, simple structure and very wide application prospect of .
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of embodiments of the invention.
Fig. 2 is a schematic block diagram of a system of embodiments of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a partial embodiment of of the present invention, rather than a whole embodiment.
The following explains key terms appearing in the present invention.
Example 1:
FIG. 1 is a schematic flow chart of a method of embodiments of the present invention for UI automation test cases for improving the efficiency of UI automation test case execution and improving the stability of UI automation test case execution.
As shown in fig. 1, the method 100 includes:
step 110, collecting identification information of a target page element; the identification information is id or element address information of the target page element; the target page element is a page element to be tested in the current UI automation test case;
step 120, searching a preset method for searching page elements in a page corresponding to the identification information;
step 130, executing the searched method for searching page elements in the page, and circularly searching the target page elements in the target page at a preset frequency within a preset time length t 1;
and 140, when the target page element is found within the preset time length t1, continuing to execute the current UI automation test case, otherwise, stopping executing the current UI automation test case and returning corresponding error reporting information.
Optionally, as embodiments of the present invention, the different identification information corresponds to different methods for searching for a page element in a page.
Optionally, as embodiments of the present invention, the method for performing finding to find a page element in a page circularly finds the target page element in the target page at a predetermined frequency within a preset time length t1, where the method for performing finding to find a page element in a page searches the target page element times at intervals of a preset time length t2 within a preset time length t1, and the preset time length t2 is less than or equal to the preset time length t 1.
Alternatively, as embodiments of the present invention, the preset time length t1 is 1 minute, and the preset time length t2 is 5 seconds.
In order to facilitate understanding of the present invention, the page element loading waiting method provided by the present invention is described in step below by using the principle of the page element loading waiting method of the present invention and combining with the processing procedure of waiting for page element loading in the embodiment.
Specifically, the page element loading waiting method includes:
and step S1, collecting the identification information of the target page element.
When the target page element has id information playing a role in identification, the acquired identification information of the target page element is the id of the target page element; when the target page element does not have id information but element address information, the acquired identification information of the target page element is the element address information of the target page element.
In this embodiment, it is noted that a page element to be currently tested in the UI automatic test case is a target page element a, id information exists in the target page element a, and the identification information of the target page element collected in the current step S1 is an id of the target page element a.
And step S2, searching a preset method for searching page elements in the page corresponding to the identification information.
Each method for searching page elements in the page is a corresponding code program packaged in advance.
In this embodiment, the method for searching for a page element in a page corresponding to the target page element a through the id of the target page element is method a.
And step S3, executing the searched method for searching page elements in the page, and circularly searching the target page elements in the target page at a preset frequency within a preset time length t 1.
The method a is executed, and times of the target page element a are searched in the target page every 5 seconds within 1 minute.
And step S4, when the target page element is found within the preset time length t1, continuing to execute the current UI automation test case, otherwise, stopping executing the current UI automation test case and returning corresponding error reporting information.
And when the target page element A is found in the 1 minute, continuously and automatically executing the current UI automation test case, otherwise, stopping executing the current UI automation test case, and returning error reporting information for waiting for the failure of loading the target page element A.
In summary, the page element loading waiting method provided by the present invention is applied to UI automation test cases, and can increase intelligent waiting when a target page element is found in the UI automation test case execution process, and increase intelligent waiting when a target page element is found for a single UI automation test case, which not only avoids that elements in a page need to wait for a predefined fixed duration when loading, but also avoids that the entire UI automation test termination phenomenon occurs caused by the fact that the entire page is successfully loaded within a predefined time length but the page elements are not successfully loaded within the predefined time length, as a result, the present invention not only improves the efficiency of UI automation test case execution at fixed degree, but also improves the stability of UI automation test case execution at fixed degree.
Example 2:
as shown in FIG. 2, the page element loading waiting system 200 is used for UI automation test cases, and comprises:
an element identification information acquisition unit 201 that acquires identification information of a target page element; the identification information is id or element address information of the target page element; the target page element is a page element to be tested in the current UI automation test case;
the searching method searching unit 202 searches a preset method for searching page elements in the page corresponding to the identification information;
the element loading waiting unit 203 executes the searched method for searching page elements in the page, and circularly searches the target page elements in the target page at a preset frequency within a preset time length t 1;
and the element loading waiting result unit 204 continues to execute the current UI automation test case when the target page element is found within the preset time length t1, otherwise, stops executing the current UI automation test case and returns corresponding error reporting information.
Wherein, different said identification information corresponds to different said method for searching page element in page.
In the element loading waiting unit 203, the method for executing the search for searching for the page element in the page circularly searches for the target page element in the target page at the preset frequency within the preset time length t1, and is to execute the method for searching for the page element in the page, wherein the method for searching for the page element in the page searches for the target page element in the target page times within the preset time length t1 at intervals of the preset time length t2, and the preset time length t2 is less than or equal to the preset time length t 1.
Alternatively, the preset time length t1 is 1 minute, and the preset time length t2 is 5 seconds.
In view of the correspondence between the system 200 and the method 100, the working process of the system 200 and the advantages achieved by the system can be referred to the description of the method 100, and will not be described again.
Example 3:
this embodiment provides UI automation test cases, in which corresponding program codes are integrated for automatically executing the method 100 described in embodiment 1.
Example 4:
the embodiment provides UI automation test systems, which include groups of automation test cases, wherein each of the automation test cases adopts the UI automation test case described in embodiment 3.
The same and similar parts in the various embodiments in this specification may be referred to each other.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1, page element loading waiting method, used for UI automation test case, characterized in that, the page element loading waiting method includes:
acquiring identification information of a target page element; the identification information is id or element address information of the target page element; the target page element is a page element to be tested in the current UI automation test case;
searching a preset method for searching page elements in a page corresponding to the identification information;
executing the searched method for searching the page elements in the page, and circularly searching the target page elements in the target page at a preset frequency within a preset time length t 1;
and when the target page element is found within the preset time length t1, continuing to execute the current UI automation test case, otherwise, stopping executing the current UI automation test case and returning corresponding error reporting information.
2. The method of claim 1, wherein different identification information corresponds to different methods for finding page elements in a page.
3. The page element loading waiting method as claimed in claim 1, wherein the method for performing the search for searching for the page element in the page circularly searches for the target page element in the target page at a predetermined frequency within a predetermined time length t1, and is characterized in that the method for performing the search for searching for the page element in the page searches for the target page element in the target page times within a predetermined time length t1 at intervals of a predetermined time length t2, and the predetermined time length t2 is less than or equal to a predetermined time length t 1.
4. The page element loading waiting method according to claim 3, wherein the preset time period t1 is 1 minute, and the preset time period t2 is 5 seconds.
5, kinds of page element loading waiting system, for UI automation test case, characterized in that, the page element loading waiting system includes:
the element identification information acquisition unit is used for acquiring identification information of the target page element; the identification information is id or element address information of the target page element; the target page element is a page element to be tested in the current UI automation test case;
the searching method searching unit is used for searching a preset method for searching page elements in the page corresponding to the identification information;
the element loading waiting unit executes the searched method for searching the page element in the page, and circularly searches the target page element in the target page at a preset frequency within a preset time length t 1;
and an element loading waiting result unit, when the target page element is found within a preset time length t1, continuing to execute the current UI automation test case, otherwise, stopping executing the current UI automation test case and returning corresponding error reporting information.
6. The system for waiting for page element loading according to claim 5, wherein different said identification information corresponds to different said method for finding page elements in a page.
7. The page element loading waiting system as claimed in claim 5, wherein in the element loading waiting unit, the method for performing lookup for searching for a page element in a page circularly searches for the target page element in the target page at a predetermined frequency within a predetermined time length t1, in order to perform the method for performing lookup for searching for a page element in a page, the method for searching for a page element in a page searches for the target page element times within a predetermined time length t1 at intervals of a predetermined time length t2, and the predetermined time length t2 is less than or equal to the predetermined time length t 1.
8. The page element loading waiting system according to claim 7, wherein the preset time length t1 is 1 minute, and the preset time length t2 is 5 seconds.
9, UI automation test cases, characterized in that, the UI automation test cases are integrated with corresponding program codes for automatically executing the method of any of claims 1-4.
10, UI automation test system, comprising groups of automation test cases, wherein each of said automation test cases uses the UI automation test case of claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910819938.9A CN110737585A (en) | 2019-08-31 | 2019-08-31 | UI (user interface) automatic test case and system and page element loading waiting method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910819938.9A CN110737585A (en) | 2019-08-31 | 2019-08-31 | UI (user interface) automatic test case and system and page element loading waiting method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110737585A true CN110737585A (en) | 2020-01-31 |
Family
ID=69267446
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910819938.9A Withdrawn CN110737585A (en) | 2019-08-31 | 2019-08-31 | UI (user interface) automatic test case and system and page element loading waiting method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110737585A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112559066A (en) * | 2020-12-08 | 2021-03-26 | 北京航天云路有限公司 | Intelligent wait for page element load operation page element |
CN112835764A (en) * | 2021-02-01 | 2021-05-25 | 长沙市到家悠享网络科技有限公司 | Front-end monitoring method, device, equipment and medium |
CN113485909A (en) * | 2021-06-01 | 2021-10-08 | 杭州网易云音乐科技有限公司 | Test method, test device, computing device, and medium |
CN113791974A (en) * | 2021-08-25 | 2021-12-14 | 微梦创科网络科技(中国)有限公司 | User interface UI element explicit waiting method and device |
CN114706753A (en) * | 2022-03-14 | 2022-07-05 | 马上消费金融股份有限公司 | Display interface testing method and device, electronic equipment and storage medium |
-
2019
- 2019-08-31 CN CN201910819938.9A patent/CN110737585A/en not_active Withdrawn
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112559066A (en) * | 2020-12-08 | 2021-03-26 | 北京航天云路有限公司 | Intelligent wait for page element load operation page element |
CN112835764A (en) * | 2021-02-01 | 2021-05-25 | 长沙市到家悠享网络科技有限公司 | Front-end monitoring method, device, equipment and medium |
CN113485909A (en) * | 2021-06-01 | 2021-10-08 | 杭州网易云音乐科技有限公司 | Test method, test device, computing device, and medium |
CN113485909B (en) * | 2021-06-01 | 2023-10-27 | 杭州网易云音乐科技有限公司 | Test method, test device, computing equipment and medium |
CN113791974A (en) * | 2021-08-25 | 2021-12-14 | 微梦创科网络科技(中国)有限公司 | User interface UI element explicit waiting method and device |
CN113791974B (en) * | 2021-08-25 | 2024-05-17 | 微梦创科网络科技(中国)有限公司 | Explicit waiting method and device for user interface UI element |
CN114706753A (en) * | 2022-03-14 | 2022-07-05 | 马上消费金融股份有限公司 | Display interface testing method and device, electronic equipment and storage medium |
CN114706753B (en) * | 2022-03-14 | 2024-09-24 | 马上消费金融股份有限公司 | Display interface testing method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110737585A (en) | UI (user interface) automatic test case and system and page element loading waiting method and system | |
US10552301B2 (en) | Completing functional testing | |
EP3051776A1 (en) | Method and apparatus for controlling turn-on and turn-off of smart socket | |
CN110058998B (en) | Software testing method and device | |
US20110029539A1 (en) | Metadata as comments for search problem determination and analysis | |
CN108508874B (en) | Method and device for monitoring equipment fault | |
CN104182348A (en) | Software test method and device | |
CN106339379B (en) | Website running state monitoring method and device | |
CN112948189B (en) | Margin test method, margin test system and related device | |
CN107562619B (en) | Automatic control traversing method and terminal based on neuron model | |
CN116401113B (en) | Environment verification method, device and medium for heterogeneous many-core architecture acceleration card | |
CN106649584B (en) | Index processing method and device in master-slave database system | |
CN105204929B (en) | Batch processing dispatching method, device and system | |
CN106326089B (en) | Automatic testing method, device and system | |
CN106445949A (en) | Method and device for detecting data change in data table | |
CN109561126B (en) | Data synchronization method and device, storage medium and processor | |
CN116467161A (en) | Application testing method and device, electronic equipment and storage medium | |
CN111666200A (en) | Testing method and terminal for time consumption of cold start of PC software | |
US11061808B2 (en) | Troubleshooting test failures that occurred during a testing phase of a continuous integration pipeline | |
CN113110991A (en) | Page element positioning method and device, storage medium and electronic device | |
CN110059071B (en) | Data comparison monitoring method, system, equipment and medium based on storage process | |
CN111240999A (en) | Method and system for improving script test execution efficiency | |
CN110990395B (en) | Data processing method and device | |
CN114138578B (en) | Server testing method and device | |
CN114154162B (en) | Penetration test path planning method and device, and computer readable storage medium |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200131 |