CN104111852A - Web application automated testing system and testing method based on data drive - Google Patents
Web application automated testing system and testing method based on data drive Download PDFInfo
- Publication number
- CN104111852A CN104111852A CN201410346058.1A CN201410346058A CN104111852A CN 104111852 A CN104111852 A CN 104111852A CN 201410346058 A CN201410346058 A CN 201410346058A CN 104111852 A CN104111852 A CN 104111852A
- Authority
- CN
- China
- Prior art keywords
- test
- file
- driven
- unit
- selenium
- 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
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a Web application automated testing system and a testing method based on data drive, and belongs to the field of an automated testing technology. The testing system provided by the invention comprises a test request end and a test response end, the test request end comprises a Selenium RC cell, an Extended Selenium RC cell, a data drive document memory cell and a testing result memory cell. The method comprises the testing steps: firstly, preparing a data drive document; secondly, parsing the data drive document by the Extended Selenium RC cell; thirdly, performing automated testing operation on a webpage by the Selenium RC cell; fourthly, comparatively storing test results by a testing result storage unit; and fifthly, inspecting the comparison results by an inspector. The data drive document provided by the invention is simple in preparation rule, the development difficulty of an automatic testing engineering can be greatly reduced, the times for performing testing is more, the efficiency is higher and the testing cost is lower.
Description
Technical field
The present invention relates to automatization testing technique field, more particularly, relate to a kind of Web application automatization test system and method for testing based on data-driven.
Background technology
Software test is the important means that guarantees software quality, and the B/S framework Web that " thin-client " be feature of take is applied in and " under the overall situation that cloud computing develops rapidly, becomes gradually popular client's first-selection.Can Web application work normally and efficiently and have great significance for its exploitation, operation enterprise.Therefore, the research of Web application automatization testing technique and application are had to very important theory and using value.Automatization test system is also just day by day in widespread attention as the gordian technique means that guarantee software quality.
The main implementation method of traditional Web program manual test is manually to click the Web page, and running program is with the naked eye confirmed the correctness of test result, and this method of testing is in the face of a large amount of reperformance test work limitation rates is low, and reusability is poor.Automatic test writes after test procedure, just can automatically perform, and aspect repeated test job, with plurality of advantages such as its low cost with respect to manual test, high reusability, high-level efficiency, is becoming gradually one of study hotspot of software circle.
A automatization test system that Selenium RCShi ThoughtWorks company writes for web application specially.Its application principle is roughly: user writes test procedure, utilizes test procedure to remove to call the API that Selenium RC provides, and the Web page to be tested is tested, and whole test procedure runs directly in browser, just as real user operation.The browser that Selenium RC supports comprises IE, Google, Chrome, Firefox etc., and its major function has:
(1) with the test of browser compatibility: whether test Web application can normally work in multiple browser and operating system;
(2) test of systemic-function: create decline test verification software function and user's request, support automatic recording action and automatically generate, support the test script of the different languages such as Net, Java, Perl.
Use Selenium RC on browser, to move test and mainly contain two benefits:
(1) by writing the Selenium RC test script that imitates user's operation, help tester to leave for test web application from terminal user's visual angle;
(2), by using different browsers that Web is applied and tested, make tester can be more prone to find the incompatibility of Web application and browser.
The core texture of Selenium RC is Browser Bot, utilizes JavaScript to write, and this can move test script on the browser of any support JavaScript.The task of Browser Bot is order the execution that receives test script, and test script can be used HTML table layout to write, and also can use the programming language of its support to write, as Java, and Ruby.The applicable browser of Selenium RC is as shown in table 1:
The applicable browser of table 1Selenium RC
? | Internet?Explorer | Firefox | Mozilla | Safari |
Windows?XP | 6.0 | 0.8+,0.9+,1.0 | 1.6+,1.7+ | Do not support |
RedHat?Linux | Do not support | 0.8+,0.9+,1.0+ | 1.6+,1.7+ | Do not support |
MacOSX?10.3 | Do not support | 0.8+,0.9+,1.0+ | 1.6+,1.7+ | 1.3+ |
From analysis above, Selenium RC is the automated test tool of a excellent performance, but Selenium RC equally all needs tester to write necessary test script program with existing most automatization testing techniques, writing of test script needs tester skillfully to grasp Java, Ruby, associative programming languages such as Perl and have certain project development level, this has proposed certain requirement to tester's programming and working experience, the threshold and the cost that have not only improved Web application automatic test, the efficiency of automatic test is also lower.Therefore, still need the automatic test performance of Selenium RC further to optimize.
Summary of the invention
1. the technical matters that invention will solve
The object of the invention is to overcome existing automatization testing technique needs tester to write test script, test threshold is high and testing efficiency is low, and manual test problem very consuming time provides a kind of Web application automatization test system and method for testing based on data-driven.Technical scheme provided by the invention replaces test script to write driven file, and the redaction rule of driven file is easy to learn, and the development difficulty of automatic test engineering is reduced greatly, and testing efficiency significantly improves; Meanwhile, the present invention adopts powerful Beyong Compare text contrast instrument, and the test result of automatic batch contrast page source code, has saved the time of tester's manpower comparing to source code greatly; Technical scheme provided by the invention is than traditional test script automated testing method and manual test method of writing, and the number of times of test execution is more, and efficiency is higher, testing cost is lower.
2. technical scheme
For achieving the above object, technical scheme provided by the invention is:
A kind of Web application automatization test system based on data-driven of the present invention, comprises test request end and test response end, and this test request end is connected by network with test response end; Wherein, described test response end comprises server unit, and this server unit has been disposed tested system; Described test request end comprises Selenium RC unit, Extended SeleniumRC unit, driven file storage unit and test result storage unit;
Described driven file storage unit is for storing the driven file that user writes;
The driven file that described Extended SeleniumRC unit reads data drives file storage unit to preserve, and described driven file is resolved, according to analysis result, control Selenium RC unit and carry out corresponding actions; Meanwhile, Extended SeleniumRC unit receives the result that Selenium RC unit returns, and described result is sent to test result storage unit;
Described Selenium RC unit completes corresponding webpage test function;
The test result of described test result storage unit contrast page source code, generates and preserves comparison report.
A kind of Web application automated testing method based on data-driven of the present invention, the steps include:
Step 1, write driven file, and be stored in driven file storage unit;
The driven file that step 2, Extended SeleniumRC unit reads data drive file storage unit to preserve, and driven file is resolved;
The resolution data that step 3, Extended SeleniumRC unit obtain according to step 2, controls Selenium RC unit and carries out the operation of webpage automatic test;
Step 4, Extended SeleniumRC unit receive the test result that Selenium RC unit returns, and test result is flowed to the preservation of comparing of test result storage unit;
Step 5, tester extract the comparing result of test result storage unit, check whether comparing result difference part is accurate.
Further, the XML file that described driven file is text formatting.
Further, described XML file, according to content measurement, comprises some child nodes under its root node, the corresponding test instruction of node name of described child node, the corresponding test parameter of property parameters of this child node.
Further, when in step 2, Extended SeleniumRC unit reads data drives file, the sequencing of storing in driven file storage unit according to driven file reads; Individual data is driven to file, and Extended SeleniumRC unit adopts the mode reading line by line, and reading out data drives test instruction and the test parameter comprising in file.
Further, described Selenium RC unit adopts webpage testing tool Selenium RC, and the API that this webpage testing tool Selenium RC comprises is corresponding with the test instruction in driven file.
Further, the test result storage unit described in step 4 adopts Beyong Compare text contrast instrument, and webpage source code and standard source code that Extended SeleniumRC unit is carried are compared, and generate and preserve comparison report.
3. beneficial effect
Adopt technical scheme provided by the invention, compare with existing known technology, there is following remarkable result:
(1) a kind of Web application automatization test system based on data-driven of the present invention, based on driven file, make test instruction and test parameter in the automatic analyzing XML file in Extended SeleniumRC unit, generate voluntarily corresponding test script and control Selenium RC unit and carry out webpage test operation, obtain test result, in this process, tester only need test instruction and test parameter is complete with the XML format editing of appointment after, just can allow test job automatically carry out, the present invention is particularly useful for the regression test stage of a large amount of repeated test work of needs, can significantly reduce testing cost,
(2) a kind of Web application automated testing method based on data-driven of the present invention, its driven file adopts XML form to write, XML file edit is simple in rule, tester only need read relevant documentation study redaction rule, just can carry out test operation, the development difficulty of automatic test engineering reduces greatly, and testing efficiency significantly improves;
(3) a kind of Web application automated testing method based on data-driven of the present invention, adopt powerful Beyong Compare text contrast instrument, the test result of automatic batch contrast page source code, and by webpage source code and the red demonstration of standard source code different piece mark, whether tester only need contrast the red part difference of mark and conform to expection, has greatly saved the time of tester's manpower comparing to source code.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of a kind of Web application automatization test system based on data-driven of the present invention;
Fig. 2 is welcome interface schematic diagram when automatic test starts in embodiments of the invention 2;
Fig. 3 is that in embodiments of the invention 2, test event is selected block diagram;
Fig. 4 is Selenium background server display interface schematic diagram in embodiments of the invention 2;
Fig. 5 is Selenium control desk display interface schematic diagram in embodiments of the invention 2;
Fig. 6 is the WEB page schematic diagram of test in embodiments of the invention 2;
Fig. 7 inputs the WEB page schematic diagram of password when wrong in embodiments of the invention 2;
Fig. 8 is the journal file schematic diagram producing when test macro moves in embodiments of the invention 2;
Fig. 9 is the WEB page source code schematic diagram that in embodiments of the invention 2, test macro is obtained;
Figure 10 is by the schematic diagram that extracts page source code and standard source code and compare in embodiments of the invention 2;
Figure 11 is that method of testing of the present invention is carried out 30 regression tests analysis schematic diagram of cost T.T. with general automated testing method, manual test method;
Figure 12 is that method of testing of the present invention is carried out 30 regression tests cost analysis schematic diagram of averaging time with general automated testing method, manual test method.
Embodiment
For further understanding content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments.
Embodiment 1
Referring to Fig. 1, a kind of Web application automatization test system based on data-driven of the present embodiment, described automatization test system comprises test request end and test response end, described test request end is connected by network with test response end.Test request end comprises Selenium RC unit, Extended SeleniumRC unit, driven file storage unit and test result storage unit.
Described test response end comprises server unit, this server unit has been disposed tested system, server unit receives by network the webpage test request signal that Selenium RC unit sends, and according to the webpage test request signal receiving, corresponding test webpage is carried out to information extraction; The info web of extraction is sent it back to Selenium RC unit, Selenium RC unit extracts the webpage source code in info web, sends to Extended SeleniumRC unit again.
Described Selenium RC unit adopts the webpage testing tool Selenium RC that increases income public, this webpage testing tool Selenium RC comprises the API (application programming interface) for Extended SeleniumRC cell call, different API comprises different webpage test instructions, completes corresponding webpage test function.
Described Extended SeleniumRC unit drives the driven file of file storage unit storage for reading out data, according to the test instruction in driven file, call API corresponding to Selenium RC unit, and the test parameter in driven file is sent to Selenium RC unit, receive the test result that Selenium RC unit returns, and test result is sent to test result storage unit.
Described test result storage unit adopts powerful Beyong Compare text contrast instrument, receive the webpage source code that Extended SeleniumRC unit sends, automatic batch webpage source code and standard source code are compared, generate and preserve comparison report, for tester's observation analysis.
A kind of Web application automated testing method based on data-driven of the present embodiment, its improvement is: (1) utilizes the driven file of writing text formatting to replace writing test script program, XML file edit is simple in rule, tester only need read relevant documentation study redaction rule, just can carry out test operation, the development difficulty of automatic test engineering reduces greatly, and testing efficiency significantly improves; (2) in measuring executing process, the test result of automatic batch contrast page source code, and by webpage source code and the red demonstration of standard source code different piece mark, whether tester only need contrast the red part difference of mark and conform to expection, has greatly saved the time of tester's manpower comparing to source code.The testing procedure of the present embodiment is:
Step 1, write driven file, and be stored in driven file storage unit.
In described driven file, comprise test required whole test instructions and test parameter, the XML file that this driven file is text formatting; The redaction rule of driven file is: in each node of XML file edit, and the corresponding test instruction of node name, the corresponding test parameter of the attribute of writing in node, several nodes of data-driven file including, are exactly some test instructions.
The sequencing reading out data that step 2, described Extended SeleniumRC unit are stored in driven file storage unit according to driven file drives file, and the test instruction that each driven file is comprised and test parameter read line by line, for every a line, first read node name, then read each property value in node.
Step 3, Extended SeleniumRC unit are mapped to according to the test instruction of reading in step 2 the corresponding API that Selenium RC unit provides, the API providing due to the test instruction of reading and Selenium RC is one to one, so mapping process is to find corresponding API by test instruction, and call the process of this API.Complete after aforesaid operations, subsequent web pages test is just completed by the webpage testing tool Selenium RC that increases income public, Selenium RC carries out concrete webpage test instruction in API, to test response end, send request of access signal, test response termination is received the request of access signal of Selenium RC unit, and according to corresponding request of access signal, need test webpage is extracted to info web, then the info web of extraction is sent it back to Selenium RC unit.
The webpage source code that step 4, Extended SeleniumRC unit obtain Selenium RC cell processing sends to test result storage unit.Test result storage unit adopts Beyong Compare text contrast instrument, and the webpage source code receiving and the standard source code of storage are in advance contrasted, and generates and preserve comparison report.
Step 5, tester extract the comparing result of test result storage unit, difference in comparing result is partly given prominence to and marked red and be shown on computer screen curtain, tester only need check whether the difference part in comparing result is correct, if difference is estimated, test can be passed through so, otherwise test can not be passed through.
For the ease of understanding the test process of the present embodiment, below in conjunction with a simplified example, be specifically introduced:
The present embodiment is to replace traditional test script by writing the driven file of XML file layout, comprises test instruction and test parameter in driven file, and test instruction and test parameter are write with the form of general XML formatted file.Driven file root node is testing engineering name, by editor, named voluntarily, root node comprises some child nodes, represent test instruction node, instruction node name is consistent with the API Name that webpage testing tool Selenium RC provides, specifically with reference to official's specification documents of webpage testing tool SeleniumRC.Each test instruction node comprises several parameter child nodes, and child node name parameter represents that this node is parameter child node name, the value=wherein comprising " * * * ", represent that parameter value is " and * * * ".Test macro sequentially reads each test instruction and test parameter thereof, calls test instruction that and instruction node is of the same name, imports parameter into, completes test function.
In the following example, editor Login.xml file, this document completes after login page input username and password, clicks the test function of Button Login on the page.
Above Login node is the root node of file, and called after Login represents that this document is to test Login (logging in) function.Login node has 3 child nodes: two <type>, a <click>, these 3 nodes represent test instruction, and these 3 nodes comprise some child node <parameter>.Test macro is after reading above file, first call article one instruction type, and import idInput and two parameters of userId in type instruction, and the function completing is: to input of character string in the page elements of id=" idInput " in webpage " userId ".In like manner, second <type> node completes to input of character string in the page elements of id=" pwdInput " in webpage " password ".The 3rd <click> node represented id=in webpage clicking " loginButton " the function of element.
Write a few style of writing presents in above example, only require tester: (1) reads official's specification documents of webpage testing tool SeleniumRC, understands the function of its API and the meaning of parameter; (2) according to the explanation of API, write instruction node and the parameter node of driven file.And first traditional mode of writing test script requires tester at least to grasp the programming language that a kind of SeleniumRC supports, next requires tester to read official's specification documents of SeleniumRC, then writes, compiles, moves test code.These are high more a lot of than the requirement of the present embodiment to the professional requirement of tester's programming.
Tester is stored in driven file storage unit by editor's driven file, and a self-defined file represents engineering name in the Projects of test macro file, the driven file of Login.xml and other test function is left in the file of self-defined engineering name, and in the configuration file selenium-config.xml of test macro, record engineering name and driven file name, when starting test macro, system reads selenium-config.xml file automatically, user selects after testing engineering, system is by the sequencing of the driven file recording in selenium-config.xml, reading out data drives file, carry out test function.
The example of selenium-config.xml file as follows.
In above test file, be illustrated in a self-defined testing engineering file MailTest under Projects file, under this testing engineering file, deposit 3 driven file: Login.xml, CheckMail.xml, SendMail.xml.After the test macro of the present embodiment starts, system reads selenium-config.xml automatically, read the child node MailTest of testing engineering Projects, system reads three child nodes of MailTest again, then remove in order to read 3 driven files, executing data drives the test instruction in file, reads corresponding data and drives the code of file as follows:
For reading of driven file, what the present embodiment adopted is the general method that reads xml file of Java programming language.Top-down, by node, read, when reading test instruction node and property parameters thereof, the API corresponding with test instruction in invoking web page testing tool SeleniumRC, imports parameter into, realizes test function.
Above code completes the function that node one by one reads XML file.
Above code is to read after test instruction node and property parameters thereof, and the API corresponding with test instruction in invoking web page testing tool SeleniumRC, imports parameter into.
The webpage testing tool SeleniumRC that the present embodiment is used is the free product of increasing income, and version number is 0.9.2, principle is realized in its inside herein and repeats no more.
Often test after a page, Selenium RC can utilize its API providing to obtain webpage source code, and webpage source code is sent to test result storage unit stores.After whole testing engineering finishes, test result cell stores the source code of all pages.Test result storage unit contrasts the source code of the page and the standard source code of both having deposited, and preserves comparing result report.The implementation procedure of contrast is to call the process of existing text compare tool Beyond Compare, and the Beyond Compare version number of calling in the present embodiment is 3.3.8.
In comparing result report file, if the webpage source code of obtaining in test process has not identical place with the standard source code of both having deposited, contrast instrument, by the red demonstration of different piece mark, is convenient to tester and is checked test result.So tester completes after the contrast of page source code at test macro, check each comparing result report, specifically comprise: 1, check that whether comparing result quantity is correct, guarantee that each page of tested software is covered to; 2, emphasis is checked in report and is marked red part, sees whether difference belongs to normal condition, to reach the object of checking test result.
Embodiment 2
A kind of Web application automatization test system based on data-driven of the present embodiment is substantially with embodiment 1, and its method of testing is applied to the regression test of the free postal of 126 Neteases.
The Free mailbox system towards netizen that 126 companies of free You Shi Netease of Netease have released since founding in June, 1997, this mailing system is since founding, from initial, only provide around the simple mail transmission/reception function of mail collection super large 280M net dish by now, intelligent address list, the functions such as mail filter are in the bulky systems of one, the systemic-function regression tested quantity experiencing during this is quite huge---the interpolation of new function each time, the correction of bug (leak), after the optimization of performance, all needing to carry out a considerable amount of regression tests just can reach the standard grade for user, otherwise, the consequence producing, loss for company of Netease is very large, therefore this system is carried out to a large amount of regression tests to be necessary.Yet if each test all adopts manual testing's mode, it is extremely huge that cost can become because of the increase of testing time.If adopt the method for testing of the present embodiment to carry out automatic test to it, after having write the driven file that all tests need, just test macro can be in unattended situation, efficient, fast, repeat test job.After mailing system is upgraded, also, as long as change or addition portion divided data drive file just can re-use and carry out regression test in former testing engineering, economic benefit is considerable.
Utilize the method for testing of the present embodiment to carry out the example exploitation of testing engineering, as space is limited, tested application is carried out to partial function test, and except logging in, do not carry out the functional test of abnormal system.Particular content comprises: 1, account logs in: by different account numbers, enter user respectively and log in, comprise non-existent account, account exists but the account of password mistake, and account number cipher is correct account all; 2, consult mail: after logging in, open inbox, check the content of a certain envelope mail in inbox; 3, send mail: write an envelope mail and send to appointment mailbox, and consulting outbox, in checking outbox, having the mail having sent.By this three partial function is tested, reach the object to the Automation regression testing of mailbox basic function.
The sharpest edges of the present embodiment are the thresholds of further simplifying the process of test development on the basis of traditional automatic test, reducing test development.The exploitation of testing engineering mainly comprises following step:
(1) registration testing engineering
Automatization test system comprises file selenium-config.xml, this document is in ExtendSelenium RC unit, after test macro starts, ExtendSelenium RC reads the information in selenium-config.xml in unit, obtains the information of the testing engineering that needs execution.All testing engineerings could tested system be identified after all must registering in this file.This file root node is Projects, its child node is the title of testing engineering, in this exploitation, testing engineering title is MailTest, and the child node Services of engineering name represents that this file comprises how many driven files, a child node service of the corresponding Services of each driven file.MailTest testing engineering comprises 3 content measurement: Login, CheckMail, SendMail, and corresponding data drives file Login.xml, CheckMail.xml and SendMail.xml respectively.
(2) editor's configuration file
#126Mail?Server?Config
The tested access URL to picture of #
MAIL_SERVER_URL-http://www.126.com
#Selenium server position
SELENIUM_SERVER_HOST=localhost
#Selenium server place port numbers
SELENIUM_SERVER_PORT-4444
The browser type using in # operation test process
BROWSER_TYPE=*firefox
# determines the operating system at Server place, Linux or windows
# is defaulted as under (SuSE) Linux OS, under windows operating system
OS=windows
Before the operation of # program, please guarantee the existence of following file
# preserves the position of the page, lives under the root directory of Java project
FOLDER_PAGE=Projects\\WADAutoTest\\OutPutPages\\
The entrance method of # extension class
EXTENSION_CLASS_METHOD=run
The various information that mainly comprise tested software in configuration file, comprise the access URL of software, the necessary informations such as port numbers, and after these information are correctly filled in, test job could be carried out smoothly, comprises altogether 7.
(3) editor of driven file
Driven file is the important content of whole testing engineering, is the core of whole testing engineering, and test macro drives file to carry out test job by resolution data.The present embodiment is write 3 sample datas and is driven file part content, with "/* */", represent annotation word, be respectively that user logs in driven file Login.xml, CheckMail.xml, SenderMail.xml checks that in inbox, mail data drives file and sends mail data move.
(4) operation testing engineering
1. startup system is welcome interface
Fig. 2 is that test macro is welcome interface, clicks Open button and ejects engineering selection dialog box as shown in Figure 3.Selected, need to carry out after testing engineering, click after Execute button, testing engineering is just smooth.
2. select test event
Starting to carry out after testing engineering, first testing engineering starts Selenium background server as shown in Figure 4, shows the various running state information of test macro in server.
3. project is moved automatically
After project brings into operation, can show Selenium control desk as shown in Figure 5, control desk can show log file and the instruction of sending to server simultaneously, and Selenium starts browser, loads and wants test page, carries out corresponding operating.
In Fig. 6, shown to No. id of web page and inputted hqiaobill in idInput page elements, id inputs adfd in the input page elements of pwdInput, then click the button that page id is loginBtn, this process is the input account number hqiaobill showing in as Fig. 7, password adfd, finally clicks Button Login.Owing to having inputted wrong password, thus the page can jump to as in the page of Fig. 7, prompt cipher input error.In these a series of implementations, all can generate journal file as shown in Figure 8, and if while occurring that the new page or page status change, system is preserved page source code automatically, as shown in Figure 9.
(5) confirm the test result of memory module
Journal file when Fig. 8 is system operation, provides system log.Fig. 9 obtains the page source code of testing software by system.System standard source code is compared with the source code of obtaining in test, obtain comparative result as shown in figure 10, left side is standard source code, the source code of obtaining when right side is system operation, with both differences of red-label (not shown), be the variation point of software, confirm whether variation point is desired value, just reach and confirm test result object.
The present embodiment drops in real work, the tester who is ignorant of program language exploitation is driven after file in study simple data, with regard to the exploitation automatic test project of having the ability, it has further reduced difficulty and the cost of the exploitation of automatic test script on the basis of automatic test, shortened the construction cycle, and can impel the coordination concurrent working of development department and software test portion, realization is finished the work in a plurality of departments iteration, reduced because the wait between link causes personnel's standby time, improved total work efficiency.
(1) automatic test and manual test comparison
Data driven automation test based on the present embodiment and the automatic test (hereinafter to be referred as general automatic test) based on the exploitation of program language script, the time cost of carrying out manual test compares, in the test preparatory stage, the time of data-driven test and general automatic test cost is much larger than the time of manual test, because automatic test not only comprises the design activity of test case, also need to realize extraly test automation script or data-driven time, and compare from each test execution, the time that two kinds of automatic tests expend is obviously short than the manual test time, the time that at every turn completes once test due to manual test is basically identical, and subsequently the single test duration of automatic test much smaller than manual test, therefore along with constantly adding up of testing time, gap between the T.T. of manual test and the T.T. of automatic test can reduce gradually, and surpass T.T. of the latter, this has just proved that automatic test is very suitable for the engineering of software development that requires testing time a lot, and obtain after universalization at automatic test framework, its average operation time can be shorter and shorter, because the redaction test for old product, testing engineering only needs tester to revise code or the test case code of portioned product module, and do not need to rebuild code.
(2) data driven automation test and the comparison of script exploitation automatic test
The advantage of the data driven automation test based on the present embodiment is mainly reflected in without study relevant programming language and the corresponding API of Selenium compared with the advantage of general automatic test, only need read data to drive to grasp its edit methods after document just can carry out the exploitation of testing engineering, reduced the threshold that testing engineering is developed.Table 2 is the comparisons of the time of 3 kinds of method of testings comparing and tester is required.
From table 2, can find out, for tester's requirement, the requirement of manual test is obviously minimum, by test model book defined, software is operated.Utilize method of testing that the present embodiment provides than general automatic test require much lowerly, without study development language, without study, use the API of Selenium RC, say technically it is only the edit methods that learning data drives file.
The test of table 2 data driven automation, general automatic test, manual test comparative analysis
Table 3 is illustrated in 30 regression tests, the single consumption of three kinds of method of testings and total time consuming contrast situation.Testing time is that setup time is tested in 0 expression, data driven automation test the 0th single time be mainly test model design and the editor of driven file, the design and development that general automatic test the 0th single time is test model design, test case, the 0th the single time of manual test refers to that design test pattern book and test execution person are to the familiar time of tested software.
30 regression test time contrasts of table 33 kind of method of testing
Automatic test need to spend many time to prepare in early stage conventionally as seen from Figure 11, after test starts, the time of its total cost can approach with T.T. manual test gradually, when the 13rd test, the T.T. of manual test has surmounted data-driven automatic test T.T., and at the 23rd time, the T.T. of manual test surpasses the T.T. of general automatic test, after this, the advantage of automatic test is more and more obvious.Data driven automation test T.T. is compared when total with general automatic test, and it does not have too many variation in the mistiming initially staying, and this is mainly because both single test duration gaps are little, so the gap of its T.T. is also not too obvious.
From 30 regression tests of 3 kinds of tests shown in Figure 12, analyze averaging time, the single test duration of manual test is too many variation not, and the driven file that the single test duration of general automatic test and data driven automation test causes because content measurement changes and script are revised slightly fluctuating, and the single time fluctuation of general automatic test is larger, this is mainly because the modification of test script wants difficulty high than the modification of driven file.
Facts have proved, automatic test application comprises data driven automation test and general automatic test, after surpassing the test execution number of times of some, can save the cost of execution, and the number of times of carrying out is larger, the cost that can save is more, and exploitation automatic test has also been with challenge and entertaining for tester's work, has reduced uninterestingly, and this is that automatic test is compared the most significant advantage with manual test.
Utilizing the general automatic test of data driven automation test comparison of the present embodiment exploitation is mainly to reduce by the 0th time in the advantage aspect the test duration, thereby with editing data, drives the time of file to replace the time of script design use-case to save time.
A kind of Web application automatization test system and method for testing based on data-driven described in embodiment 1~2, feature, automatization testing technique and the various automatization test system of current Web application have been analyzed, theoretical and the automated test tool SeleniumRC based on existing automatic test, after surpassing the test execution number of times of some, can save the cost of execution, and the number of times of carrying out is larger, and the cost that can save is more.
Below schematically the present invention and embodiment thereof are described, this description does not have restricted, and shown in accompanying drawing is also one of embodiments of the present invention, and actual structure is not limited to this.So, if those of ordinary skill in the art is enlightened by it, in the situation that not departing from the invention aim, without the creationary frame mode similar to this technical scheme and the embodiment of designing, all should belong to protection scope of the present invention.
Claims (7)
1. the Web application automatization test system based on data-driven, is characterized in that: comprise test request end and test response end, this test request end is connected by network with test response end; Wherein, described test response end comprises server unit, and this server unit has been disposed tested system; Described test request end comprises Selenium RC unit, Extended SeleniumRC unit, driven file storage unit and test result storage unit;
Described driven file storage unit is for storing the driven file that user writes;
The driven file that described Extended SeleniumRC unit reads data drives file storage unit to preserve, and described driven file is resolved, according to analysis result, control Selenium RC unit and carry out corresponding actions; Meanwhile, Extended SeleniumRC unit receives the result that Selenium RC unit returns, and described result is sent to test result storage unit;
Described Selenium RC unit completes corresponding webpage test function;
The test result of described test result storage unit contrast page source code, generates and preserves comparison report.
2. the Web application automated testing method based on data-driven, the steps include:
Step 1, write driven file, and be stored in driven file storage unit;
The driven file that step 2, Extended SeleniumRC unit reads data drive file storage unit to preserve, and driven file is resolved;
The resolution data that step 3, Extended SeleniumRC unit obtain according to step 2, controls Selenium RC unit and carries out the operation of webpage automatic test;
Step 4, Extended SeleniumRC unit receive the test result that Selenium RC unit returns, and test result is flowed to the preservation of comparing of test result storage unit;
Step 5, tester extract the comparing result of test result storage unit, check whether comparing result difference part is accurate.
3. a kind of Web application automated testing method based on data-driven according to claim 2, is characterized in that: the XML file that described driven file is text formatting.
4. a kind of Web application automated testing method based on data-driven according to claim 3, it is characterized in that: described XML file is according to content measurement, under its root node, comprise some child nodes, the corresponding test instruction of node name of described child node, the corresponding test parameter of property parameters of this child node.
5. according to a kind of Web application automated testing method based on data-driven described in claim 3 or 4, it is characterized in that: when in step 2, Extended SeleniumRC unit reads data drives file, the sequencing of storing in driven file storage unit according to driven file reads; Individual data is driven to file, and Extended SeleniumRC unit adopts the mode reading line by line, and reading out data drives test instruction and the test parameter comprising in file.
6. a kind of Web application automated testing method based on data-driven according to claim 5, it is characterized in that: described Selenium RC unit adopts webpage testing tool Selenium RC, and the API that this webpage testing tool Selenium RC comprises is corresponding with the test instruction in driven file.
7. a kind of Web application automated testing method based on data-driven according to claim 6, it is characterized in that: the test result storage unit described in step 4 adopts Beyong Compare text contrast instrument, webpage source code and standard source code that Extended SeleniumRC unit is carried are compared, and generate and preserve comparison report.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410346058.1A CN104111852A (en) | 2014-07-18 | 2014-07-18 | Web application automated testing system and testing method based on data drive |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410346058.1A CN104111852A (en) | 2014-07-18 | 2014-07-18 | Web application automated testing system and testing method based on data drive |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104111852A true CN104111852A (en) | 2014-10-22 |
Family
ID=51708652
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410346058.1A Pending CN104111852A (en) | 2014-07-18 | 2014-07-18 | Web application automated testing system and testing method based on data drive |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104111852A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105095070A (en) * | 2015-04-03 | 2015-11-25 | 中国科学院信息工程研究所 | Method and system for obtaining QQ group data base on test assembly of browser |
CN106598829A (en) * | 2015-10-15 | 2017-04-26 | 腾讯科技(深圳)有限公司 | Webpage automation test method and apparatus |
CN107506302A (en) * | 2017-08-23 | 2017-12-22 | 杭州安恒信息技术有限公司 | The method and apparatus that multinomial content accuracy is searched for generally based on selenium checkings |
CN109213672A (en) * | 2017-07-07 | 2019-01-15 | 博彦科技股份有限公司 | Dialog box removing method, device, storage medium and processor |
CN109828900A (en) * | 2018-12-14 | 2019-05-31 | 深圳壹账通智能科技有限公司 | Test script automatic generation method, device, electronic equipment and storage medium |
CN110048932A (en) * | 2019-04-03 | 2019-07-23 | 北京奇安信科技有限公司 | Validation checking method, apparatus, equipment and the storage medium of mail Monitoring function |
CN110347409A (en) * | 2019-07-12 | 2019-10-18 | 威创集团股份有限公司 | Autocontrol method, client and server |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050267976A1 (en) * | 2004-03-11 | 2005-12-01 | Microsoft Corporation | Data driven test automation of web sites and web services |
CN1791037A (en) * | 2005-12-26 | 2006-06-21 | 北京航空航天大学 | Method for realizing Web service automatic test |
CN101217425A (en) * | 2008-01-04 | 2008-07-09 | 中兴通讯股份有限公司 | Web testing method and device |
-
2014
- 2014-07-18 CN CN201410346058.1A patent/CN104111852A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050267976A1 (en) * | 2004-03-11 | 2005-12-01 | Microsoft Corporation | Data driven test automation of web sites and web services |
CN1791037A (en) * | 2005-12-26 | 2006-06-21 | 北京航空航天大学 | Method for realizing Web service automatic test |
CN101217425A (en) * | 2008-01-04 | 2008-07-09 | 中兴通讯股份有限公司 | Web testing method and device |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105095070A (en) * | 2015-04-03 | 2015-11-25 | 中国科学院信息工程研究所 | Method and system for obtaining QQ group data base on test assembly of browser |
CN105095070B (en) * | 2015-04-03 | 2017-12-19 | 中国科学院信息工程研究所 | QQ group's data capture method and system based on browser testing component |
CN106598829A (en) * | 2015-10-15 | 2017-04-26 | 腾讯科技(深圳)有限公司 | Webpage automation test method and apparatus |
CN109213672A (en) * | 2017-07-07 | 2019-01-15 | 博彦科技股份有限公司 | Dialog box removing method, device, storage medium and processor |
CN107506302A (en) * | 2017-08-23 | 2017-12-22 | 杭州安恒信息技术有限公司 | The method and apparatus that multinomial content accuracy is searched for generally based on selenium checkings |
CN109828900A (en) * | 2018-12-14 | 2019-05-31 | 深圳壹账通智能科技有限公司 | Test script automatic generation method, device, electronic equipment and storage medium |
CN110048932A (en) * | 2019-04-03 | 2019-07-23 | 北京奇安信科技有限公司 | Validation checking method, apparatus, equipment and the storage medium of mail Monitoring function |
CN110347409A (en) * | 2019-07-12 | 2019-10-18 | 威创集团股份有限公司 | Autocontrol method, client and server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104111852A (en) | Web application automated testing system and testing method based on data drive | |
WO2018010552A1 (en) | Test method and device | |
CN108345532A (en) | A kind of automatic test cases generation method and device | |
CN202339542U (en) | Software product test system | |
CN110362490B (en) | Automatic testing method and system for integrating iOS and Android mobile applications | |
CN108572911A (en) | Automate safety detecting method, device, electronic equipment and readable storage medium storing program for executing | |
CN103186467A (en) | Method and device for verifying data correctness | |
CN106294128B (en) | A kind of automated testing method and device exporting report data | |
CN111382055B (en) | Automatic unit testing method and device based on unified description language | |
CN110727603A (en) | Improved method for automatically testing positioning elements based on UI (user interface) | |
CN111782117A (en) | Interface display method and device, storage medium and electronic device | |
US20200293592A1 (en) | Methods and systems for browser extension used to generate relative xpath, absolute xpath and/or css selectors | |
CN108923997A (en) | A kind of cloud service node automatic test approach and device based on python | |
CN117493158A (en) | Test method and device, electronic equipment and storage medium | |
CN113127312A (en) | Method and device for testing database performance, electronic equipment and storage medium | |
CN112231197A (en) | Page testing method and device and storage medium | |
CN113900629A (en) | Automatic engine implementation system of computer process | |
CN102882737B (en) | Transaction language-1(TL1) command automatically testing method based on extensible markup language (XML) script | |
Wang et al. | The research of data-driven testing based on QTP | |
WO2023275887A1 (en) | System and method for automated software testing | |
CN114218105A (en) | UI automatic regression testing system based on configuration application mode | |
CN114297057A (en) | Design and use method of automatic test case | |
CN114461514A (en) | Automatic testing method and system based on low codes | |
CN114064469A (en) | Interface automation test method and storage medium | |
CN115437621A (en) | Process editing method and device based on robot process automation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into 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: 20141022 |