Everyone already knows that software testing consumes a large proportion, and has a great impact in the software development life cycle. Performing manual testing will take up a lot of energy, such as dedicated testers, multiple environments on specific tests, inconsistency to run a test and finally it will use a lot of time and be costly.
High in demand test automation for both mobile and web applications cause more expectations of the automation capabilities. Having a cross-platform test, easy to write test script, complete reporting, integration to CI, test management support, and bug reporting are some of the features that comm only a user will be looking for in their test automation framework.
To write effective test automation, engineers need to switch their minds to think about the whole system rather than a single unit of functionality, or a manual tester needs to gain other skill sets to write proper test automation based on their expertise in business and process.
By following how manual tests conduct testing, the automation testing has to create test steps by entering the data then the test machine will perform the steps. We need to ensure that the object or element that we refer to as AUT is recognized by the driver that we use to run the test.
Currently, there are many automation tools and frameworks that can be selected to adjust to the needs of test automation. The appropriate way to writing test automation will make the test more effective compared to availability and capability of test resources.
Record and Playback
The record and playback feature has been a major feature of most automation tools. The software records and logs your manual testing, including every mouse movement, keystroke, and screenshots, and lets you replay them later.
It relieves the tedium of manual testing, especially when you have to perform regression tests, but it can be limited in its scope.
So here two main advantages for Record and Playback:
Easy for a manual tester who is just starting out with test automation
Faster in test development
Unless your developers only make changes once in a while, using record and playback will leave you with a pile of fragile test automation scripts. These tests also stress your network resources as they grow because the record and playback tools often duplicate lines of code, images, and objects each time they execute.
Many record and playback tools did offer the ability to tweak the recorded test scripts so that it possible make the necessary changes based on the previous test run.
Test Data Driven
When you have to run your test with different sets of input data to ensure that the application works as expected for various input values. This testing approach is called Test Data Driven.
You can record many tests with various input data with separate data from test commands. A data-driven test will read data from a storage or external stores i.e. csv, excel, etc.
Test data-driven performs the following operations in a loop:
Retrieves the portion of the test data from storage.
Enters the data in an application form and simulates other actions.
Continues testing with the next set of input data.
By applying test data-driven, the test script can be reused when needed and this makes the test code flexible, light and easily maintainable.
Keyword-driven testing is a scripting technique that uses data files to contain the keywords related to the application being tested. These keywords describe the set of actions that are required to perform a specific step.
As keyword-driven tests are technology-independent, they are easily readable for non-technical testers. While technically experienced team members can prepare the automation process and define keywords, you do not need any technical knowledge to design test cases with these keywords.
In Keyword-Driven Testing, we first identify a set of keywords and then associate an action (or function) related to these keywords.
Here, every testing action like opening or closing of a browser, mouse click, keystrokes, etc. are described by a keyword such as openbrowser, click, inputText and so on.
Example of keywords
|Open Browser||Driver open browser|
|Navigate To URL||Accessing provided URL|
|Set Text||Input value|
Driven Development (BDD). This lets us define application behaviour in plain meaningful English text using simple grammar defined by language.
What’s makes BDD different is:
Tests are written in plain descriptive English type grammar
Tests are explained as behaviour of application and are more user-focused
Uses examples to clarify requirements
Example of BDD Test:
Scenario: Successfully login
Given I login page
When I login with valid details
Then I should be redirected to homepage
And welcome pop up message is displayed
After a look at the above example code anybody can understand the working of the test and what it is intended to do. BDD makes it easy for anyone on the team to read and write test. Additionally, with this feature, it brings business users into the test process, helping teams to explore and understand requirements.
Reducing the duplication test script and applying the object pattern page to the test script is one way to increase the effectiveness of test automation. Moreover, the scripting process can be accelerated with the recording and the playback feature will shorten the time in making test script.
Reusing the page object from the recording processor generating the manual test script will make scripting time for creating test script more efficient. If there is any change in the UI, it will not need any changes made to the page object, only to the one place that must be maintained.
There are many ways to write test automation and it is important to identify the level of experience and skills for each of your team members and divide your automated testing efforts accordingly. Choosing the right way to write your test automation will help to reduce test creation effort and get test developed faster.
More Resources and References
Why is it so Hard to Design Automated GUI – Driven Functional Tests?: http://infiniteundo.com/post/80881879374/why-is-testing-hard
The Evolution of Test Automation, from Record and Playback to Object Mapping: https://www.stickyminds.com/article/evolution-test-automation-record-and-playback-object-mappin
Data-Driven Testing – Basic Concept: https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/basic-concepts.html
Keyword Driven Framework Testing: https://larion.com/resource/keyword-driven-framework-testing/
Automated Testing Best Practices and Tips: https://smartbear.com/learn/automated-testing/best-practices-for-automation/
Page Object Model with Page Factory in Selenium – Complete Guide|Software Testing Material: https://www.softwaretestingmaterial.com/page-object-model/