Tool for Writing Automated Tests
It is necessary to prepare autotests for performing automated testing of applications.
One can utilize the framework TestNG, which has such options as a description of the autotests in annotations, use of xml for flexible tests configurations, multi-threaded testing, and things like that.
Example of Annotations:
- dependsOnGroups – the input parameters are the names of the methods groups on which the annotated test depends;
- dependsOnMethods – the input parameters are the names of the methods on which the annotated test depends;
- groups – defines the relationship of the test or class to a particular group;
- priority – defines the method priority.
One may utilize built-in TestNG generator in conjunction with ReportNG to document the statements. A sample report is below.
The utility Apache Ant can be used for building and running the project. It is possible to manage the building process by means of XML-script, also known as Build-file.
In the first place, this file contains the definition of the project, consisting of separate targets. The targets are comparable with procedures in programming languages and contain activations of tasks.
Each task is an indivisible, atomic command that performs an elementary action. Certain dependencies can be between the targets - each target is performed only after all targets, on which it depends, had been performed (if they have already been performed previously, they are not performed again).
Typical Examples of the Goals Are:
- clean – removing of the temporary files;
- compile – compilation of all the classes;
- deploy - application deployment on the server.
A certain set of goals and their interrelation depend on the project specificity. Ant allows to define customized types of tasks by means of creation of Java-classes that implement certain interfaces.
One may create autotests utilizing the technology of Selenium 2 in order to automate functional testing or other type of tests.
Selenium is a framework for performing web site testing, it implements a new approach to validation of web-based applications. Unlike most of the tools that are used during web site testing and that attempt to simulate HTTP requests, Selenium operates in course of web-based testing as if it were a browser.
When a Selenium automated test is launched, the frame starts a browser and makes the browser perform all the steps from the test, in the same way the user would do it interacting with the application.
Specialists in automated testing often utilize Selenium.