CN110727603A - Improved method for automatically testing positioning elements based on UI (user interface) - Google Patents

Improved method for automatically testing positioning elements based on UI (user interface) Download PDF

Info

Publication number
CN110727603A
CN110727603A CN201911026311.4A CN201911026311A CN110727603A CN 110727603 A CN110727603 A CN 110727603A CN 201911026311 A CN201911026311 A CN 201911026311A CN 110727603 A CN110727603 A CN 110727603A
Authority
CN
China
Prior art keywords
positioning
excel
improved method
automatically testing
elements based
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
Application number
CN201911026311.4A
Other languages
Chinese (zh)
Inventor
刘德彬
陈玮
叶静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Yu Yu Da Data Technology Co Ltd
Original Assignee
Chongqing Yu Yu Da Data Technology Co Ltd
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 Chongqing Yu Yu Da Data Technology Co Ltd filed Critical Chongqing Yu Yu Da Data Technology Co Ltd
Priority to CN201911026311.4A priority Critical patent/CN110727603A/en
Publication of CN110727603A publication Critical patent/CN110727603A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof

Abstract

The invention discloses an improved method for automatically testing positioning elements based on a UI (user interface), which comprises the following steps: defining parameters in excel, adding test points, determining a method of using a positioning element, judging whether the parameters meet an expected value or not, and displaying a result; the invention has the beneficial effects that: different methods of the positioning elements are written into a public method, which positioning method is to be called is judged through one parameter, repeated manual inspection work of a tester is effectively reduced, inspection of the page elements is used as an independent test point and placed in an excel, maintenance cost is reduced, and code stability is facilitated; through the designed analysis positioning module for analyzing and positioning the log and the failed screenshot, the ability of assisting in quickly positioning the problem is achieved, the convenience of operation is improved, and the efficiency of positioning elements is further improved.

Description

Improved method for automatically testing positioning elements based on UI (user interface)
Technical Field
The invention belongs to the technical field of UI (user interface) automation test, and particularly relates to an improved method for automatically testing a positioning element based on a UI.
Background
With the rapid development of the software testing industry, many enterprises can use UI automated testing, so that labor can be saved, efficiency can be improved, and the future development trend of the software testing industry is realized. The most critical step of UI automation test is to locate elements, but there are many methods for locating elements, and there are some locating methods using less methods for locating elements through ID, class, xpath and css; therefore, when a tester writes a UI automation script for a stable system, especially when the number of elements to be positioned on a page is large, the tester needs to frequently find a positioning method suitable for the current element, which is quite time-consuming; when the current element is developed and modified, the element is correspondingly modified in the code, so that the cost for maintaining the UI automation script is increased.
The existing UI automation test positioning element has the following defects:
1. inaccurate positioning of an element often prompts that the element cannot be found;
2. when a plurality of elements are positioned, the required elements need to be positioned according to different methods, so that codes are repeated, and the reusability is not high;
3. when the developer modifies the element names, the corresponding tester needs to modify the names in the codes, and the maintenance cost is increased.
Disclosure of Invention
The invention aims to provide an improved method for automatically testing a positioning element based on a UI (user interface), which aims to solve the problems that the positioning element proposed in the background technology is inaccurate and cannot be found frequently; when a plurality of elements are positioned, the required elements need to be positioned according to different methods, so that codes are repeated, and the reusability is not high; when the developer modifies the element names, the corresponding tester needs to modify the names in the codes, and the maintenance cost is increased.
In order to achieve the purpose, the invention provides the following technical scheme: an improved method for automatically testing a positioning element based on a UI (user interface), which comprises the following steps:
the method comprises the following steps: parameters are defined in excel: defining 6 columns in excel;
step two: adding test points: opening a system to be tested, finding out a name which can uniquely determine the element, and filling the element into the excel correspondingly according to the defined parameters in the excel;
step three: determining a method of using the positional element;
step four: judging whether the expected value is met;
step five: and displaying the result.
As a preferred technical solution of the present invention, in the first step, 6 columns are defined in excel, and the title of each column is name, path, type, index, operation, and expect.
As a preferred technical solution of the present invention, in the second step, the system to be tested is opened, and the name that can uniquely determine the element is found through F12.
As a preferred technical solution of the present invention, in the second step, according to the parameters defined in excel, the name, path, type, index, operation, and expect of the element are filled in excel correspondingly.
As a preferred technical solution of the present invention, in the third step, a method for using a location element is determined according to a type and an index parameter.
As a preferred technical solution of the present invention, in the fourth step, whether the expected value is met is judged: and extracting the value displayed on the page by the element, and comparing the extracted value with the expect value according to the operation parameter to see whether the value meets the expectation of a tester or not.
As a preferred technical solution of the present invention, in the fifth step, the result is displayed: if the expected value is not met, printing out the reason; if the expected value is met, the test point passes.
The invention also comprises an analysis and positioning module which is used for analyzing and positioning the log and the screenshot in failure.
Compared with the prior art, the invention has the beneficial effects that:
(1) different methods of the positioning elements are written into a public method, which positioning method is to be called is judged through one parameter, repeated manual inspection work of a tester is effectively reduced, inspection of the page elements is used as an independent test point and placed in an excel, maintenance cost is reduced, and code stability is facilitated;
(2) through the designed analysis positioning module for analyzing and positioning the log and the failed screenshot, the ability of assisting in quickly positioning the problem is achieved, the convenience of operation is improved, and the efficiency of positioning elements is further improved.
Drawings
FIG. 1 is an overall flow chart of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention provides a technical solution: an improved method for automatically testing a positioning element based on a UI (user interface) comprises the following steps:
the method comprises the following steps: parameters are defined in excel: firstly, defining 6 columns in excel, wherein the title of each column is name (display name on page), path, type, index (subscript), operation (operator) and expect (expected value);
step two: adding test points: opening a system to be tested, finding out a name which can uniquely determine the element through F12, and filling the corresponding name, path, type, index, operation and expect of the element into the excel according to the defined parameters in the excel;
step three: determining a method for using the positioning element according to the type and index parameters: if type is class and index is-1, locate the element with find _ element _ by _ class _ name (path); if index >0, locate the element with find _ elements _ by _ class _ name (path) [ index ], if type is css and index is-1, locate the element with find _ element _ by _ css _ selector (path); if index >0, locate the element with find _ element _ by _ css _ selector (path), and so on;
step four: judging whether the expected value is met: after the element is positioned, the value displayed on the page of the element can be obtained, and then the obtained value is compared with the expect value according to the operation parameter to see whether the expected value of the tester is met;
step five: and displaying the result: if the expected value is not met, printing out the reason; if the expected value is met, the test point passes.
In this embodiment, the system preferably further includes an analysis and positioning module, and the module is configured to analyze and position the log and the failed screenshot, so as to assist in quickly positioning the problem, increase convenience in operation, and further improve efficiency of positioning the element.
Different methods of the positioning elements are written into a common method, which positioning method is to be called is judged through one parameter, and the method is only required to be called every time the elements are required to be positioned, so that the repetition rate of codes is reduced; and simultaneously, naming of the elements is written in the excel table, if the elements are changed, only the excel table is required to be modified, and the codes do not need to be modified, so that the stability of the codes is facilitated, and the maintenance cost is reduced.
excel-defined parameter content table
Figure BDA0002248708600000041
Figure BDA0002248708600000051
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (8)

1. An improved method for automatically testing a positioning element based on a UI (user interface) is characterized by comprising the following steps: the improvement method comprises the following steps:
the method comprises the following steps: parameters are defined in excel: defining 6 columns in excel;
step two: adding test points: opening a system to be tested, finding out a name which can uniquely determine the element, and filling the element into the excel correspondingly according to the defined parameters in the excel;
step three: determining a method of using the positional element;
step four: judging whether the expected value is met;
step five: and displaying the result.
2. The improved method for automatically testing location elements based on UI according to claim 1, wherein: in the first step, 6 columns are defined in excel, and the title of each column is name, path, type, index, operation, and expect.
3. The improved method for automatically testing location elements based on UI according to claim 1, wherein: in the second step, the system to be tested is opened, and through F12, the name that can uniquely determine the element is found.
4. The improved method for automatically testing location elements based on UI according to claim 3, characterized in that: in the second step, according to the parameters defined in excel, filling the corresponding name, path, type, index, operation and expect of the element into excel.
5. The improved method for automatically testing location elements based on UI according to claim 1, wherein: and in the third step, determining a method for using the positioning element according to the type and the index parameters.
6. The improved method for automatically testing location elements based on UI according to claim 1, wherein: in the fourth step, whether the expected value is met is judged: and extracting the value displayed on the page by the element, and comparing the extracted value with the expect value according to the operation parameter to see whether the value meets the expectation of a tester or not.
7. The improved method for automatically testing location elements based on UI according to claim 1, wherein: in the fifth step, the result is displayed: if the expected value is not met, printing out the reason; if the expected value is met, the test point passes.
8. The improved method for automatically testing location elements based on UI according to claim 1, wherein: the system also comprises an analysis and positioning module which is used for analyzing and positioning the log and the screenshots in failure.
CN201911026311.4A 2019-10-25 2019-10-25 Improved method for automatically testing positioning elements based on UI (user interface) Pending CN110727603A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911026311.4A CN110727603A (en) 2019-10-25 2019-10-25 Improved method for automatically testing positioning elements based on UI (user interface)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911026311.4A CN110727603A (en) 2019-10-25 2019-10-25 Improved method for automatically testing positioning elements based on UI (user interface)

Publications (1)

Publication Number Publication Date
CN110727603A true CN110727603A (en) 2020-01-24

Family

ID=69223227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911026311.4A Pending CN110727603A (en) 2019-10-25 2019-10-25 Improved method for automatically testing positioning elements based on UI (user interface)

Country Status (1)

Country Link
CN (1) CN110727603A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083992A (en) * 2020-09-02 2020-12-15 李振 UI automation test method
CN112131124A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Page element positioning method, device, equipment and storage medium
CN112181412A (en) * 2020-09-27 2021-01-05 的卢技术有限公司 Ui element positioning method, system, electronic equipment and storage medium
CN112181809A (en) * 2020-09-14 2021-01-05 麒麟软件有限公司 Automatic graphical user interface testing method based on multiple positioning methods
CN114385514A (en) * 2022-03-23 2022-04-22 杭州天谷信息科技有限公司 Method, equipment and storage medium for detecting webpage elements

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398782A (en) * 2007-09-28 2009-04-01 Arm有限公司 Generating a compressed trace stream for a data processing apparatus
KR20150022542A (en) * 2013-08-23 2015-03-04 캠프모바일 주식회사 Method and system for sharing user interface element of mobile application
CN104424087A (en) * 2013-08-21 2015-03-18 阿里巴巴集团控股有限公司 Web page element positioning method, apparatus and system
CN104657377A (en) * 2013-11-20 2015-05-27 阿里巴巴集团控股有限公司 Multi-channel webpage control positioning method and device
CN105095067A (en) * 2014-05-21 2015-11-25 北京奇虎科技有限公司 User interface element object identification and automatic test method and apparatus
CN107577607A (en) * 2017-09-07 2018-01-12 携程旅游信息技术(上海)有限公司 User interface automated testing method, device, electronic equipment, storage medium
CN107957948A (en) * 2017-12-07 2018-04-24 郑州云海信息技术有限公司 A kind of user interface automatic test device and method
CN109669854A (en) * 2018-10-25 2019-04-23 深圳壹账通智能科技有限公司 Page assembly rapid extracting method and system based on data processing
CN109739751A (en) * 2018-12-19 2019-05-10 贵阳朗玛信息技术股份有限公司 Realize the method and system of webpage automatic test

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398782A (en) * 2007-09-28 2009-04-01 Arm有限公司 Generating a compressed trace stream for a data processing apparatus
CN104424087A (en) * 2013-08-21 2015-03-18 阿里巴巴集团控股有限公司 Web page element positioning method, apparatus and system
KR20150022542A (en) * 2013-08-23 2015-03-04 캠프모바일 주식회사 Method and system for sharing user interface element of mobile application
CN104657377A (en) * 2013-11-20 2015-05-27 阿里巴巴集团控股有限公司 Multi-channel webpage control positioning method and device
CN105095067A (en) * 2014-05-21 2015-11-25 北京奇虎科技有限公司 User interface element object identification and automatic test method and apparatus
CN107577607A (en) * 2017-09-07 2018-01-12 携程旅游信息技术(上海)有限公司 User interface automated testing method, device, electronic equipment, storage medium
CN107957948A (en) * 2017-12-07 2018-04-24 郑州云海信息技术有限公司 A kind of user interface automatic test device and method
CN109669854A (en) * 2018-10-25 2019-04-23 深圳壹账通智能科技有限公司 Page assembly rapid extracting method and system based on data processing
CN109739751A (en) * 2018-12-19 2019-05-10 贵阳朗玛信息技术股份有限公司 Realize the method and system of webpage automatic test

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HIRO-D: "selenium对元素定位和操作方法的封装", 《HTTPS://WWW.CNBLOGS.COM/A565810497/P/11599594.HTML》 *
OSC_BHMYQUSC: "python webdriver 从无到有搭建混合驱动自动化测试框架的过程和总结", 《HTTPS://MY.OSCHINA.NET/U/4263192/BLOG/3885378D》 *
邢伟超等: "网页自动化测试框架的设计与实现", 《计算机应用与软件》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083992A (en) * 2020-09-02 2020-12-15 李振 UI automation test method
CN112181809A (en) * 2020-09-14 2021-01-05 麒麟软件有限公司 Automatic graphical user interface testing method based on multiple positioning methods
CN112181412A (en) * 2020-09-27 2021-01-05 的卢技术有限公司 Ui element positioning method, system, electronic equipment and storage medium
CN112131124A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Page element positioning method, device, equipment and storage medium
CN114385514A (en) * 2022-03-23 2022-04-22 杭州天谷信息科技有限公司 Method, equipment and storage medium for detecting webpage elements

Similar Documents

Publication Publication Date Title
CN110727603A (en) Improved method for automatically testing positioning elements based on UI (user interface)
CN109710508B (en) Test method, test device, test apparatus, and computer-readable storage medium
US6058493A (en) Logging and reproduction of automated test operations for computing systems
US7752501B2 (en) Dynamic generation and implementation of globalization verification testing for user interface controls
US20120192156A1 (en) Test case pattern matching
US10437717B2 (en) Defect reporting in application testing
CN104111852A (en) Web application automated testing system and testing method based on data drive
US9734042B1 (en) System, method, and computer program for automated parameterized software testing
CN104239219A (en) Software defect positioning technology on-line evaluating and experimenting platform and method based on coverage
CN110688173B (en) Positioning method and device of components in cross-platform interface framework and electronic equipment
CN110286882B (en) Foreground system design and verification method based on model detection
CN114020645A (en) Test method, device, equipment, readable storage medium and computer program product
CN113515443A (en) Multi-language automatic checking method, device, computer equipment and storage medium
CN108629012B (en) Intelligent verification method and system for forensic data analysis accuracy
CN112486802A (en) Flutter test auxiliary method and device
CN111767222A (en) Data model verification method and device, electronic equipment and storage medium
CN110618932A (en) Input box testing method based on Web automatic test and readable storage medium
CN113076092B (en) Processing method and device for A2L file of vehicle-mounted controller
CN111143221B (en) Test method and device
CN112380113A (en) Software testing method and system
CN113742214A (en) Static report-based merging analysis method, system and medium
CN114116519A (en) Interface test method and device, electronic equipment and storage medium
CN116225954A (en) SQL sentence rapid debugging method, device, equipment and storage medium
CN112597040A (en) Interface automatic testing method and device and electronic equipment
CN117251334A (en) Method, device, equipment and medium for checking chip module interface connection

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200124