At the data-driven scripting level we can draw many significant advantages from test automation that are:
1) Same script can be used to run many different tests with very little extra effort. Here the software testing engineers just need to specify a new set of input data and corresponding expected results for every additional test case. Thus similar tests can be added very quickly without the need to implement any more scripts.
For example, a test for a banking application needing entering the particulars of a new account and verify that the database has been correctly updated. Another test would do exactly the same except it would work upon a different bank account. It needs the same instructions but different inputs and different expected outcomes (the values that describe a different bank account). Both these tests can be implemented with the help of the same test script and one data file.
2) We can add many more test cases around every original regression tests & automate them, since these are expected to use exactly the same script instructions, except areas of frequent change being the input data and the expected outcomes. Ref figure below.
3) We can easily customize the format of the data file to suit the needs of the software-testing engineer.
For example, the tester can add comments to the data file that the script will be made to ignore thereby making the data file much more understandable and maintainable.
4) Testers can specify the test input from a spreadsheet package being from an entirely different input format. Once the spreadsheet is completed it can be converted to a neutral format like a comma-separated text file. The spreadsheet is kept as the master version and any changes required are made directly to the spreadsheet instead in the data file. Whenever changes are made the data file is regenerated from the spreadsheet.
5) Testers can easily choose the format and layout of their test data and can comfortably add the test data without much of the programming knowledge of the scripting language supported by the tool.
6) The scripts become comparatively simpler & lighter due to the removal of the test inputs and the expected results from the script and transfer to the data file. Every expected result is directly associated with a particular test input, thus when the inputs are in the data file, the results to compare are also parked in the data file.
Many automation tools are available that encourage this by providing effective means for capturing information on the screen and storing it elsewhere as expected results for comparison with new results generated by a later run of the test.
7) This doesnít call for any additional effort towards maintenance of comprehensive set of test scripts especially when we have hundreds rather than dozens of tests.
8) For large systems involving large number of tests which are expected to last long and change frequently, organizations tend to realize tangible gains of saved efforts.