Pursuing A Techie Dream
Tips And Resources from An Experienced Automation Engineer
By Alexandru Vozaru, QA Engineer, Cognizant Softvision
Have you ever thought about becoming an automation engineer? You may have some questions. Where would you start on your career journey? What are the daily tasks involved and what exactly is the value of the automation testing? As an automation testing engineer, I’d like to share my journey, as well as some tips and resources that helped me along the way.
The Journey Begins
My passion for technology began at a young age. As a child, I was always curious about how things worked around me. After finishing high school, I attended the University of Craiova to study technology in the Automation, Computers and Electronics program. Upon graduation I joined Cognizant Softvision, where I participated in the QA Automation Pre-Employment Program, an intensive, month-long training that teaches the basics of automation.
The Pre-Employment training offered by Cognizant Softvision was very well structured. The sessions began with recapping the basic principles of programming, including Object-Oriented Programming, and covered examples of when and how some of the most popular tools in automation are used, depending on the context. Although the course was comprehensive, it offered only a basic overview of what automation really means.
So, What Exactly Is Automation Testing?
Automation testing is the process of testing products with special testing tools and frameworks, to minimize human intervention and maximize quality. In this process the manual tasks are automated in order to reduce the manual effort. Once the test suite is automated, minimal human intervention is required, mostly for maintenance and refactoring. Test results are generated automatically by comparing the expected results with the actual ones. The goal is to reduce the number of test cases to be run manually, not to eliminate the manual testing. Automation engineers can run a set of tests daily to make sure that the main functionalities are working as expected, e.g. the login functionality for a website.
To truly learn automation, you must dedicate yourself to self-study for several hours a day. As a starting point for going in depth with automation learning, one can use the e-learning platforms available at Cognizant Softvision, such as Udemy and Pluralsight. But since there are so many courses available on these platforms, it can be difficult to choose the best one. With so many different tools and libraries that can be used for almost the same thing, the process can become confusing.
Steps To Building An Automation Framework
To save precious practice time, confusion and headaches, the following walks you through the steps required for learning and building an automation framework for a web application.
In this process, It is important to decide which tools and libraries will serve us best. I will explain my choices and offer my view on what I considered to be the best online instruction.
To get started, we need:
1) A programing language
2) A library that helps with Web Elements interaction (I will explain what these are and the ways to find them)
3) A code structure for easy test maintenance — a Design Pattern.
4) An easy way to write test cases for both technical and non-technical audiences
I chose JAVA as a programming language, Selenium webDriver and Page Object Model (POM) as a Design Pattern, along with Cucumber for test case writing.
1) The Programming Language
Many would agree that the most important thing when it comes to automation is the programming language. You have to learn how to use it and understand the logic behind it in order to become a successful engineer.
Java is preferred by 43% of customers when it comes to choosing a programming language for developing automated tests. It’s one of the greatest programming languages for automation because it comes with complete test frameworks, packages and information sources.
Recommended Resource: This Java course is a complete guide and excellent for all stages of learning.
2) The Library
Selenium webDriver is a library that can be used with different programing languages, such as Java, C#, and Python. It is used for testing Web applications from the UI perspective and it helps us interact with the web elements (e.g. Text Boxes, Buttons, Check Boxes, etc.).
Selenium Locators are used to identify and to interact with these web elements. The correct identification of WebElement is very important in the process of creating automation scripts. There are different ways of locating web elements with Selenium: by Id, by CSS Selector, by Xpath, by Name, by Link Text.
Recommended resource: Here is a helpful cheat sheet for Selenium locators syntax.
With time and practice you will learn which is the best locator for your testing scenario. The most recommended method is to locate elements by ID, because these webElements IDs should be unique and, in this way, you can be sure that you are finding the correct element in the web page. But there are times when the IDs are unavailable, or IDs are dynamic and their value is changed at every page refresh. In this case, you must use other ways of locating the correct element, depending on what info you have available (class, name, LinkText, etc.) Also you can use custom Xpath using the available methods. Check out this article for more information.
The most important thing is to make sure that, no matter what happens to the webpage structure, you will always locate/interact with the desired web element.
3) The Design Pattern
Page Object Model (POM) is a design pattern that has become popular in test automation for enhancing the test maintenance and reducing code duplicates. POM will allow us to keep a clean and structured code.
Recommended resource: You can find more information about POM design principles in this video.
4) Test Framework
Cucumber is a test framework that supports Behavioral Driven Development (BDD). BDD is a software development approach where tests are written in a shared language and has the advantage of improving the communications between tech and non-tech teams. BDD tests are user-focused and are based on the system’s behavior. Some of the benefits of using BDD include:
- Better communication between team members
- Technical and non-technical audiences find it easy to understand
- Simpler maintenance of the test framework structure
In Cucumber, the BDD specifications are written in plain, simple English which is defined by the Gherkin language. In other words, Gherkin is a language that Cucumber understands.
The following is an example of Gherkin code, but keep in mind that for every step there, some Java code is attached in the background.
Feature: User Authentication Background:Given the user is already registered to the website Scenario:Given the user is on the login pageWhen the user inputs the correct email addressThen the user should be authenticated
Words of Advice
In my journey, I found the exercise of building the automation solution from scratch to be extremely helpful. I also discovered an online course that teaches exactly that: building an automation solution with the technologies mentioned above and writing clean and structured automation tests.
Recommended resource: This course has two sections: the first section focuses on Cucumber and the second one focuses on Selenium WebDriver. After completing this course, you will have a better understanding on how Selenium (a testing tool for web apps) works with Cucumber (a BDD automation framework) and how to set your very own automation solution.
Now it’s time to start practicing! For your first steps I suggest using this web application because it contains the most common web elements and actions.
While no journey comes without some bumps in the road, especially when starting out, with work and perseverance you can reach your goals. Practice and study every day and, when you find something you’re unsure about, don’t be afraid to ask for help.
Are you beginning your journey to becoming an automation engineer? What have you learned along the way? Let us know in the comments!
Get more insights from our engineering and design experts on our website!