In order to decide whether or not to automate functional tests, a number of questions need to be answered:-
1). What do you want to automate?
- Normally only regression type tests that are going to be run three or more times are candidate for the effort of automating.
- Whatever is to be automated, first needs to be stable and unchanging i.e. already system integration tested.
2). What is the expectation of automation?
- It should be understood that there is an upfront overhead related to automation and that time and cost will be incurred initially. The payback comes later in the form of quicker and more accurate test cycles.
- Automation involves the creation of computerized scripts. These scripts are initially recorded, but then require amendment to create things such as verification, the usage of spreadsheet type data, writing results to a report, pass/fail logic, looping, etc. There is no tool available that can do all this automatically and therefore time and effort is required to create the code to handle them.
- Once automation has been adopted, just as in manual testing, ongoing maintenance of the scripts will be required.
- Resource will need to be provided for initial scripting and the subsequent maintenance.
3). What type of resource will be required?
- Generally, a resource with automation experience will save a lot of time and effort and will direct automation in the correct direction.
- Depending upon the volume of tests to be automated, this resource may become utilized one hundred percent on automation.
It should be remembered that Functional testing is conducted by Testers and is not something that is a part of Development, nor should it be to avoid conflicts of interest.
Micro Focus Unified Functional Tester (UFT)
UFT is a tool that replaces Quick Test Pro (QTP) and is used primarily to automate regression testing. The recognized standard is to only automate regression tests that are to be run three or more times, to handle the effort and time of development. It should be understood that there is an overhead in script creation, that is compensated for by the speed of running the tests and their accuracy.
A feature of UFT, not commonly known, is that it also has the ability to test APIs.
The link between an application and UFT is the Repository, where application objects and their properties are stored. Identification of application objects is made using the properties held in the Repository. Some times objects cannot be recognized by the Repository and there are a number of ways to overcome this.
Manual regression tests are converted into automated tests by recording against a GUI and behave just as a user would, except that human vagaries are not introduced into the process. Having recorded a script, it then needs to be enhanced, using VBScript, by adding checkpoints, adding Pass/Fail conditions and creating any further logic that may be required.
Please note that a single UFT script can contain any number of associated manual scripts and so there is not necessarily a one to one correlation.
Data driven testing can be achieved by using external databases, spreadsheets or the inbuilt datasheet.
Automating your testing allows for quicker test cycles, complete reproducability and greater accuracy.
It is best to use QTP/UFT using the Expert View to allow the greatest control. Some people recommend creating numerous functions instead of using the Expert View - unfortunately this is not a very good idea, as it just makes the process take longer to create or update and is an absolute nightmare to debug and can't use the inbuilt QTP/UFT methods to determine where an error has occured.
Selenium (Open Source)
Selenium is a very good free tool for conducting Functional Testing on Web Sites or on Mobile Devices. It can achieve similar results to QTP/UFT. For the inexperienced, it can be a little difficult to install and configure, but once done can be used with Eclipse to create and run automated scripts. The tool is based upon the JAVA language.
It is often used with:-
- The Webdriver client to test web sites
- Log4J API for logging
- TestNG framework for reporting
- NodeJS and Appium for Mobile Devices
- SWTBot for testing Standard Widget Toolkit (SWT)
- Apache POI for interraction with Microsoft Documents e.g. Excel, Word, Powerpoint, Databases, etc.
Selenium has the ability to automation test mobile devices attached to a PC via USB and interacts with the applications in a similar way to a human. Dragging and dropping can be conducted, pages scrolled, objects tapped, text read/input etc.
Selenium projects are licensed under the Apache 2.0 License