CN104809068A - Web automatic testing framework construction method based on selenium - Google Patents

Web automatic testing framework construction method based on selenium Download PDF

Info

Publication number
CN104809068A
CN104809068A CN201510234065.7A CN201510234065A CN104809068A CN 104809068 A CN104809068 A CN 104809068A CN 201510234065 A CN201510234065 A CN 201510234065A CN 104809068 A CN104809068 A CN 104809068A
Authority
CN
China
Prior art keywords
script
data
test
web
call
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
CN201510234065.7A
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.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry 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 Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201510234065.7A priority Critical patent/CN104809068A/en
Publication of CN104809068A publication Critical patent/CN104809068A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a web automatic testing framework construction method based on selenium, and belongs to the technical field of computer testing. The situation of rapid change of web application demands is fully considered, and a framework suitable for web automatic testing is constructed through uniform management of data, page-based longitudinal management of a UI (User Interface) object and operation script graded management in combination with the properties of supporting various operating system platforms, browser crossing and the like of a selenium tool on an execution layer. Through the constructed web automatic testing, the success rate of automatic testing is increased.

Description

A kind of web automated test frame construction method based on selenium
Technical field
The present invention discloses a kind of web automated test frame construction method, belongs to computer testing technology field; Specifically a kind of web automated test frame construction method based on selenium.
Background technology
Web application be a kind of can by the application program of web access.Web application makes user be easy to access application, and user only needs browser, does not need to install other software again.Web application miscellaneous is surging forward, picture chatroom, forum, ecommerce, information inquiry, full-text search etc., people can enjoy the Web application more easily such as information retrieval, message exchange, information processing finally, and Web application is because its iteration cycle is short, the special natures such as changes in demand is fast, UI is complicated, cross-platform, browser-cross, are developed also more and more.Simultaneously along with front-end technology Java script, Html5, wait constantly to be pushed out and perfect, Web application also become become increasingly complex gorgeous.Thering is provided to user easily simultaneously, bringing challenge but to the test for Web application.Selenium is based on Java script and carrys out the automatic test software of the true operation of analog subscriber in conjunction with its Web Driver, it has the ability of well process Ajax, and support that multiple browser is as Safari, IE, Firefox, Chrome, and may operate in above several operation systems.But Selenium just solves the problem of execution aspect, do not relate at the management aspect of data, object, script, cause the series of problems such as automatic test script later maintenance amount is large, reusability is low, easily cause the failure of automatic test.The invention provides a kind of web automated test frame construction method based on selenium, take into full account the fast-changing situation of web application demand, in conjunction with the speciality such as support several operation systems platform, browser-cross of selenium instrument in execution aspect, by point page vertical management, the differentiated control of operation script of the unified management to data, UI object, build the framework being applicable to web automatic test.By the separation of data, object, operation, and extract public code, realize reusing with height of script maintainable, the web automatic test utilizing the present invention to build, improves the success ratio of automatic test.
Summary of the invention
The present invention is directed to Selenium in data, object, the management aspect of script does not relate to, cause automatic test script later maintenance amount large, the defects such as reusability is low, easily cause the problem of the failure of automatic test, a kind of web automated test frame construction method based on selenium is provided, take into full account the fast-changing situation of web application demand, in conjunction with the support several operation systems platform of selenium instrument in execution aspect, the speciality such as browser-cross, by the unified management to data, point page vertical management of UI object, the differentiated control of operation script, build the framework being applicable to web automatic test, the web automatic test utilizing the present invention to build, improve the success ratio of automatic test.
The concrete scheme that the present invention proposes is:
A kind of web automated test frame construction method based on selenium:
The unified management of data: Systematic Design is carried out to test case and test data, data are separated with script, and usage data Core Generator generates test data, is stored in database, calls for test case;
Point page vertical management of UI object: enumerate UI object successively, in units of the page, webpage t itle is document title, in first level pages, the serial number attribute of object is 1, the pop-up box type clicked by first level pages object is the secondary page, in the secondary page, the serial number attribute of object is 2, the like, call for test case;
Operation script differentiated control: other specifications of foundation java coding criterion and project are carried out automatized script and write, design elementary script to call for intermediate script and senior script, design intermediate script to call for senior script, namely call for test case, perform final automatic test;
The separation of data, object, script three, builds the web automated test frame based on selenium, the demand change of applying once there be web, only changes corresponding object, data and script.
The unified management of described data also comprises usage data and deletes instrument to the destruction of data.
Described data generating tool is that the one in Test Data Builder, Data Factory, GenerateData or Fresh Trash Generator generates test data, is stored in database, calls for test case.
UI object is enumerated according to object oriented, object properties successively in point page vertical management of described UI object.
In described operation script differentiated control, elementary script is the inspection script of UI object, and intermediate script is for completing single business operation business unit script, and senior script has been the script of actual test, middle rank script can call elementary script, and senior script can call elementary and intermediate script.
Described elementary script is that special character checks that script, digital frame check script, the longest character check script, is stored in catalogue in Eclipse; Described intermediate script is that establishment is organized script, creates vcd script, created virtual machine script, is stored in catalogue in Eclipse.
Based on a web automated test frame system of selenium, comprise the unified management unit of data, point page vertical management unit of UI object, operation script differentiated control unit;
The unified management unit of data is responsible for carrying out Systematic Design to test case and test data, and data are separated with script, and usage data Core Generator generates test data, is stored in database, calls for test case;
Point page vertical management unit of UI object is responsible for enumerating UI object successively, in units of the page, webpage t itle is document title, in first level pages, the serial number attribute of object is 1, the pop-up box type clicked by first level pages object is the secondary page, in the secondary page, the serial number attribute of object is 2, the like, call for test case;
Operation script differentiated control unit is responsible for carrying out automatized script according to other specifications of java coding criterion and project and is write, design elementary script to call for intermediate script and senior script, design intermediate script to call for senior script, namely call for test case, perform final automatic test;
The separation of above three, builds the web automatic test basic framework based on selenium, the demand change of applying once there be web, only changes corresponding object, data and script.
Usefulness of the present invention is: the present invention takes into full account the fast-changing situation of web application demand, in conjunction with the speciality such as support several operation systems platform, browser-cross of selenium instrument in execution aspect, by point page vertical management, the differentiated control of operation script of the unified management to data, UI object, build the framework being applicable to web automatic test.By the separation of data, object, operation, and public code is extracted, realize reusing with height of script maintainable, improve the success ratio of automatic test, reduce the cost of automatized script later maintenance.
Accompanying drawing explanation
Fig. 1 data unified management schematic flow sheet;
Fig. 2 UI object unified management schematic flow sheet;
The classification of Fig. 3 code and call flow schematic diagram;
Fig. 4 builds schematic diagram based on the web automated test frame of selenium.
Embodiment
The present invention will be further described by reference to the accompanying drawings.
A kind of web automated test frame construction method based on selenium:
The unified management of data: Systematic Design is carried out to test case and test data, data are separated with script, and use the one in Test Data Builder, Data Factory, GenerateData or Fresh Trash Generator or use several simultaneously, test data is generated after contrasting, be stored in database, and setting data deletion instrument carries out, to the destruction of gibberish, calling for test case; See Fig. 1
Point page vertical management of UI object: enumerate UI object according to object oriented, object properties successively, or select other parameters to enumerate UI object successively, in units of the page, webpage t itle is document title, in first level pages, the serial number attribute of object is 1, and the pop-up box type clicked by first level pages object is the secondary page, and in the secondary page, the serial number attribute of object is 2, the like, call for test case; See Fig. 2;
Operation script differentiated control: other specifications of foundation java coding criterion and project are carried out automatized script and write, design elementary script to call for intermediate script and senior script, design intermediate script to call for senior script, namely call for test case, perform final automatic test;
Wherein elementary script is the inspection script of UI object, and such as special character checks that script, digital frame check script, the longest character check script;
Middle rank script, for completing single business operation business unit script, such as creates and organizes script, creates vcd script, creates virtual machine script, be stored in catalogue in Eclipse;
Senior script has been the script of actual test, and intermediate script can call elementary script, and senior script can call elementary and intermediate script.
The separation of data, object, script three, builds the web automated test frame based on selenium, the demand change of applying once there be web, only changes corresponding object, data and script.
Based on a web automated test frame system of selenium, comprise the unified management unit of data, point page vertical management unit of UI object, operation script differentiated control unit;
The unified management unit of data is responsible for carrying out Systematic Design to test case and test data, and data are separated with script, and usage data Core Generator generates test data, is stored in database, calls for test case;
Point page vertical management unit of UI object is responsible for enumerating UI object successively, in units of the page, webpage t itle is document title, in first level pages, the serial number attribute of object is 1, the pop-up box type clicked by first level pages object is the secondary page, in the secondary page, the serial number attribute of object is 2, the like, call for test case;
Operation script differentiated control unit is responsible for carrying out automatized script according to other specifications of java coding criterion and project and is write, design elementary script to call for intermediate script and senior script, design intermediate script to call for senior script, namely call for test case, perform final automatic test;
The separation of above three, builds the web automatic test basic framework based on selenium, the demand change of applying once there be web, only changes corresponding object, data and script.

Claims (7)

1., based on a web automated test frame construction method of selenium, it is characterized in that:
The unified management of data: Systematic Design is carried out to test case and test data, data are separated with script, and usage data Core Generator generates test data, is stored in database, calls for test case;
Point page vertical management of UI object: enumerate UI object successively, in units of the page, webpage t itle is document title, in first level pages, the serial number attribute of object is 1, the pop-up box type clicked by first level pages object is the secondary page, in the secondary page, the serial number attribute of object is 2, the like, call for test case;
Operation script differentiated control: other specifications of foundation java coding criterion and project are carried out automatized script and write, design elementary script to call for intermediate script and senior script, design intermediate script to call for senior script, namely call for test case, perform final automatic test;
The separation of data, object, script three, builds the web automated test frame based on selenium, the demand change of applying once there be web, only changes corresponding object, data and script.
2. a kind of web automated test frame construction method based on selenium according to claim 1, is characterized in that the unified management of described data also comprises usage data and deletes instrument to the destruction of data.
3. a kind of web automated test frame construction method based on selenium according to claim 1 and 2, it is characterized in that described data generating tool is the one generation test data in Test Data Builder, Data Factory, GenerateData or Fresh Trash Generator, be stored in database, call for test case.
4. a kind of web automated test frame construction method based on selenium according to claim 1 and 2, is characterized in that enumerating UI object according to object oriented, object properties successively in point page vertical management of described UI object.
5. a kind of web automated test frame construction method based on selenium according to claim 4, it is characterized in that in described operation script differentiated control, elementary script is the inspection script of UI object, middle rank script is for completing single business operation business unit script, senior script has been the script of actual test, middle rank script can call elementary script, and senior script can call elementary and intermediate script.
6. a kind of web automated test frame construction method based on selenium according to claim 5, it is characterized in that described elementary script is that special character checks that script, digital frame check script, the longest character check script, be stored in catalogue in Eclipse; Described intermediate script is that establishment is organized script, creates vcd script, created virtual machine script, is stored in catalogue in Eclipse.
7. based on a web automated test frame system of selenium, it is characterized in that the unified management unit comprising data, point page vertical management unit of UI object, operation script differentiated control unit;
The unified management unit of data is responsible for carrying out Systematic Design to test case and test data, and data are separated with script, and usage data Core Generator generates test data, is stored in database, calls for test case;
Point page vertical management unit of UI object is responsible for enumerating UI object successively, in units of the page, webpage t itle is document title, in first level pages, the serial number attribute of object is 1, the pop-up box type clicked by first level pages object is the secondary page, in the secondary page, the serial number attribute of object is 2, the like, call for test case;
Operation script differentiated control unit is responsible for carrying out automatized script according to other specifications of java coding criterion and project and is write, design elementary script to call for intermediate script and senior script, design intermediate script to call for senior script, namely call for test case, perform final automatic test;
The separation of above three, builds the web automatic test basic framework based on selenium, the demand change of applying once there be web, only changes corresponding object, data and script.
CN201510234065.7A 2015-05-08 2015-05-08 Web automatic testing framework construction method based on selenium Pending CN104809068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510234065.7A CN104809068A (en) 2015-05-08 2015-05-08 Web automatic testing framework construction method based on selenium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510234065.7A CN104809068A (en) 2015-05-08 2015-05-08 Web automatic testing framework construction method based on selenium

Publications (1)

Publication Number Publication Date
CN104809068A true CN104809068A (en) 2015-07-29

Family

ID=53693910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510234065.7A Pending CN104809068A (en) 2015-05-08 2015-05-08 Web automatic testing framework construction method based on selenium

Country Status (1)

Country Link
CN (1) CN104809068A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117338A (en) * 2015-08-27 2015-12-02 浪潮电子信息产业股份有限公司 Selenium-based automatic testing method
CN105159829A (en) * 2015-08-27 2015-12-16 浪潮电子信息产业股份有限公司 Demand tracking system based on automatic testing
CN105740148A (en) * 2016-01-29 2016-07-06 博雅网信(北京)科技有限公司 Script engine system of mobile terminal automation test and testing method
CN106776343A (en) * 2017-01-13 2017-05-31 中国科学院软件研究所 A kind of web application automated test tool and method
CN107204052A (en) * 2016-03-18 2017-09-26 福特全球技术公司 Script on Telematics control units
CN107562626A (en) * 2017-08-31 2018-01-09 国家电网公司 A kind of method that encapsulation Selenium and Sikuli realizes Web automatic tests
CN107797926A (en) * 2017-10-19 2018-03-13 郑州云海信息技术有限公司 A kind of system and method for realizing linux application test automations
CN107908564A (en) * 2017-11-27 2018-04-13 于海生 A kind of UI test frames based on data separating principle
CN108491319A (en) * 2018-02-11 2018-09-04 广州小百合信息技术有限公司 Web automated testing methods and system based on this method
CN108694114A (en) * 2017-04-06 2018-10-23 广东亿迅科技有限公司 Method and its system for detaching test case, test script and test data
US10223240B2 (en) 2017-01-31 2019-03-05 Wipro Limited Methods and systems for automating regression testing of a software application
CN110851356A (en) * 2019-10-30 2020-02-28 河海大学 Selenium-based Web application automatic test framework and construction method and system thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040107415A1 (en) * 2002-12-03 2004-06-03 Konstantin Melamed Web-interactive software testing management method and computer system including an integrated test case authoring tool
CN103984628A (en) * 2014-05-15 2014-08-13 中国南方航空股份有限公司 Automatic function test method and system applied to BS (browser/server) framework

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040107415A1 (en) * 2002-12-03 2004-06-03 Konstantin Melamed Web-interactive software testing management method and computer system including an integrated test case authoring tool
CN103984628A (en) * 2014-05-15 2014-08-13 中国南方航空股份有限公司 Automatic function test method and system applied to BS (browser/server) framework

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邢伟超 等: ""网页自动化测试框架的设计与实现"", 《计算机应用与软件》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159829A (en) * 2015-08-27 2015-12-16 浪潮电子信息产业股份有限公司 Demand tracking system based on automatic testing
CN105117338A (en) * 2015-08-27 2015-12-02 浪潮电子信息产业股份有限公司 Selenium-based automatic testing method
CN105740148B (en) * 2016-01-29 2018-03-06 博雅网信(北京)科技有限公司 The script engine system and method for testing of a kind of mobile terminal automation testing
CN105740148A (en) * 2016-01-29 2016-07-06 博雅网信(北京)科技有限公司 Script engine system of mobile terminal automation test and testing method
CN107204052A (en) * 2016-03-18 2017-09-26 福特全球技术公司 Script on Telematics control units
CN107204052B (en) * 2016-03-18 2022-03-04 福特全球技术公司 Scripts on a telematics control unit
CN106776343A (en) * 2017-01-13 2017-05-31 中国科学院软件研究所 A kind of web application automated test tool and method
US10223240B2 (en) 2017-01-31 2019-03-05 Wipro Limited Methods and systems for automating regression testing of a software application
CN108694114A (en) * 2017-04-06 2018-10-23 广东亿迅科技有限公司 Method and its system for detaching test case, test script and test data
CN107562626A (en) * 2017-08-31 2018-01-09 国家电网公司 A kind of method that encapsulation Selenium and Sikuli realizes Web automatic tests
CN107797926A (en) * 2017-10-19 2018-03-13 郑州云海信息技术有限公司 A kind of system and method for realizing linux application test automations
CN107908564A (en) * 2017-11-27 2018-04-13 于海生 A kind of UI test frames based on data separating principle
CN108491319A (en) * 2018-02-11 2018-09-04 广州小百合信息技术有限公司 Web automated testing methods and system based on this method
CN110851356A (en) * 2019-10-30 2020-02-28 河海大学 Selenium-based Web application automatic test framework and construction method and system thereof

Similar Documents

Publication Publication Date Title
CN104809068A (en) Web automatic testing framework construction method based on selenium
CN103019928B (en) A kind of automated testing method and system
CN104461484B (en) The implementation method and device of front-end template
CN105243159A (en) Visual script editor-based distributed web crawler system
CN103309904B (en) A kind of method and device generating data warehouse ETL code
CN104572043A (en) Method and device for embedding points for controls of client application in real time
CN103678120B (en) Web application automated testing method based on modeling
CN102184184B (en) Method for acquiring webpage dynamic information
CN108491199A (en) A kind of method and terminal automatically generating interface
CN104793961A (en) Quick JavaWeb development method and system using native Web codes
CN102521232B (en) Distributed acquisition and processing system and method of internet metadata
CN102236672A (en) Method and device for importing data
CN102508919B (en) Data processing method and system
CN102761628B (en) Pan-domain name identification and processing device and method
CN103164323A (en) Data automatic generation method and data automatic generation system
CN102184101B (en) Software application frame and development system thereof for smartphones
CN103093038A (en) Updating method and updating device for bills of material (BOMs)
CN103853543A (en) Method used for quickly constructing forms in enterprise information system development process
CN101937335B (en) Method for generating Widget icon, method for generating Widget summary document and Widget engine
CN104021198A (en) Relational database information retrieval method and device based on ontology semantic index
CN103309806A (en) Device and method for fast developing and testing
CN104657274A (en) Method and device for testing software interface
CN104965914A (en) Page display method and apparatus
CN105354236A (en) Reconciliation information generation method and system
CN103761257A (en) Webpage handling method and system based on mobile browser

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150729

RJ01 Rejection of invention patent application after publication