Building test automation solution in BDD environment

a1qa test automation team managers shares the company’s approach to building test automation solution in the projects with the implemented BDD approach.
26 October 2016
Test automation
The article by a1qa

In the previous article we spoke about describing test scenarios with Gherkin syntax. Today Sergey Senyuk, Manager of a1qa test automation team, describes how their team develops custom-tailored test automation solutions into the BDD mindset.

Test automation in BDD context

When the end users of the automation solution are QA specialists who have no skills in programming and creating tests themselves, we offer to use the following approach to deliver effective automation solution that will work on the client’s side:

Stage 1: Regardless of the type of the application that is to be tested (mobile, web or desktop) we create framework with the basic logics necessary for application automated testing.

Stage 2: Using the Page Object and other relevant patters we design solution structure, write form classes that should contain the fields that correspond to the app’s UI elements and methods of handling these elements. We also create tests classes with form objects to implement the defined usage methods.

Stage 3: We put test data to the external files, thus removing logic details from behavior tests.

Stage 4: Implementing the BDD approach, we integrate relevant libraries to the project to use Gherkin syntax. Then the steps of test scenarios should be developed using the keywords Given/When/Then.

Graphically the delivered solution will look as follows:

As a result, by adopting this approach we let QA engineers work with Gherkin source files containing feature descriptions in their localized language. The documentation also serves as executable automated tests. By making various steps combinations a QA engineer may easily create new tests on his or her own.

A report of the successfully executed test will look as follows:

Every feature description may contain several user scenarios. Every scenario may consist of one or several steps. Every step may need a number of actions to be taken. All this data will be presented in a tree-type structure.

For every test that has failed there will be the following information available in the logs:

  • A step with the mistake occurred marked in red.
  • Description of the actual and expected outcome.
  • The string of the program code with the failed check.
  • List of actions that have been completed before a mistake occurred.
  • Application screenshot.

Another question is how to build and maintain effective communication between software testing engineers and automation engineers within the BDD projects.

Communication between automation engineers and QA team

In order to ensure a bug-free test automation solution that will take effect and deliver tangible results to the customer, it’s vital for both teams involved to understand the scope of their duties.

We advise to separate the obligations of QA team from those of test automation engineers.

At the initial stage, of the project, be it a pilot one or Proof of Concept, testing engineers convert the set of test scenarios in Gherkin or create their own scenarios. After that, automation engineers develop automated tests based on the given scenarios within the BDD approach. They also set up a continuous integration test environment to enable tests launch and storage of their run reports.

Upon the project completion, automation engineers submit the following deliverables to the client:

  • Test scenarios in Gherkin.
  • Automated tests and framework.
  • Continuous integration environment for tests launching.
  • Test automation solution documentation (architecture description, launching procedure in CI, etc.).

Automation engineers should also train QA team how to handle the delivered solution.

Hereafter, the automation engineers’ duties will be limited to working with the code:

  • Maintaining the existing tests and updating them in case of the UI or business logics changes.
  • Creating new tests.
  • Developing additional steps to improve the variability of the automated tests.

QA engineers, who will act as primary users of the delivered solution, will be expected to do the following:

  • Launch tests to check the existing scenarios on numerous data sets.
  • Analyze test run results and provide the client with the detailed report containing logs, screenshots, tests execution metrics, etc.
  • Create new tests using the keywords and scenarios in Gherkin.

It’s also important to take into account a number of factors that may increase the final costs of the automation project with the BDD mindset:

  1. Teaching Gherkin grammar and syntax to QA team.
  2. The solution development will take by 10-15% longer due to the necessity of developing test scenarios steps.
  3. Converting clients’ test scenarios in Gherkin to enable further creation of automated tests on their basis.

Despite extra costs, the number of BDD advantages will significantly prevail.

The key benefits will be the following:

  • Documentation and automated tests are stored in one project and the feature description is actually an executable test. There is also an option to develop the automation solution so that the scenarios in Gherkin will be stored in any test-tracking system and automated tests will request them when necessary.
  • The solution can be handled by users who have no programming skills. QA specialists will be able to launch tests, analyze their runs and create new test scenarios.
  • The steps in Gherkin syntax are reusable and the keywords may be combined in many different ways to create different scenarios.
  • The system description in Gherkin will be common for all teams involved. As a result, their vision of the system will also be the same.

Let’s sum it all up

Combination of BDD approach and Gherkin language takes a number of positive effects on projects where QA team has no skills in writing automated tests. However, in order to ensure maximum effect, it’s vital to take into account and calculate the costs of QA team training and converting test scenarios in Gherkin.

Judging by our experience, the benefits of implementing BDD in test automation prevail if done properly.

More Posts

19 April 2022,
by a1qa
5 min read
What prevents companies from boosting eCommerce customer experience: 4 common mistakes
Dreaming of a flawless online shopping journey for your users? Explore 4 widespread situations that hamper achieving this goal.
Cybersecurity testing
Performance testing
Test automation
Usability testing
2 February 2022,
by a1qa
5 min read
Interview with Mike Urbanovich: How to build a robust test automation strategy?
The Head of testing department at a1qa answers the questions on how to smartly build a winning test automation strategy and talks about the advantages you may obtain with it.
Test automation
31 January 2022,
by a1qa
4 min read
Scriptless test automation: revealing the truth via 3 misconceptions
Planning to go scriptless but in doubt? Explore 3 delusions of codeless test automation and its benefits when introduced smartly.
Test automation
test auto speed
11 November 2021,
by a1qa
4 min read
Test automation: 3 core activities to keep pace with dynamic software changes
Planning to release high-quality IT solutions faster? Find out which test automation activities help keep up with constantly updating products.
Test automation
29 October 2021,
by a1qa
4 min read
4 key QA activities to solve test automation challenges via AI and ML
How to address the difficulties caused by implementing test automation? Learn how to do it via applying AI and ML.
Test automation
13 May 2021,
by a1qa
4 min read
How to attain in-sprint test automation to reinforce development processes
Learn how in-sprint test automation improves business workflows. Consider the top 5 essential steps to introduce it smoothly.
Test automation
12 April 2021,
by a1qa
5 min read
Watch out for 6 telecom trends and QA tips to implement them
In our article, we unleash the upcoming telecom trends and reveal how to be certain in introducing them correctly by applying QA practices.
Test automation
31 March 2021,
by a1qa
4 min read
QA scenario to introduce 6 eCommerce trends in 2021
Discover what trends will rule the eCommerce industry in 2021 and how QA can help implement them with confidence and ease.
Cybersecurity testing
Test automation
25 February 2021,
by a1qa
4 min read
9 QA points for delivering high-quality SaaS-based solutions
In the article, we’ve gathered 9 QA factors relying on the SaaS specifics that may help to perform SaaS testing with ease.
Cloud-based testing
Cybersecurity testing
Functional testing
Performance testing
Test automation

Get in touch

Please fill in the required field.
Email address seems invalid.
Please fill in the required field.
We use cookies on our website to improve its functionality and to enhance your user experience. We also use cookies for analytics. If you continue to browse this website, we will assume you agree that we can place cookies on your device. For more details, please read our Privacy and Cookies Policy.