Selenium Webdriver Tutorials Test Automation Framework Testing Tools

The Automation Galaxy of Selenium Webdriver tools

Selenium needs no introduction. Unless you were sitting on a rock for past 10 years, you would know that Selenium Webdriver is the most popular web browser automation tool now-a-days. Whatever you do in a browser can be automated via Selenium Automation tool. Selenium WebDriver makes direct calls to the browser using each browser’s native support for automation. It support multiple browsers, operating systems and programming languages. What’s more? It’s FREE, ‘Open Source’ as we call it! Why do you think it’s so popular? 😉 Though Selenium Webdriver is at the epicenter of automated software testing, it is supported by different tools to make Automation Testing easy, effective & efficient – The Automation Galaxy of Selenium Webdriver tools!

Automation Galaxy of Selenium Webdriver Tools

Many would ask “Who decided the components of this galaxy?” I would say ‘common sense’. Pick up the QA job descriptions around you. Search for Selenium articles online. Talk with fellow Automation testers. Know different projects in your organization. Over a period of time, these tools have proved to be compatible with each other in delivering a common goal – automation! You use a tool to write scripts, other to automate the browser, one to organize your tests, other to build your automation suite, one for data management and other for reporting. These tools form the so-called Galaxy of Selenium Webdriver. You might use different tool as per the requirement & convenience, but the target to achieve is same. Just that these tools have been adopted by majority of testers, we have included these in the list.

Web Browser Automation | Selenium Webdriver

Needless to say, it is the first tool in the Galaxy of Selenium Webdriver – the epicenter. Selenium Webdriver offers a rich suite of testing functions specifically geared to the needs of testing of web applications of all types. Selenium Webdriver is probably the best option for automated testing of Websites today. It is becoming increasingly popular and it is the first choice of automation testers as well as organizations for automating the testing of Web-based applications for both the GUI as well as the functionality.

Click here to learn How to download Selenium Webdriver

Programming Language setup | Java, Python, Ruby

Since Selenium supports multiple programming languages like C#, Java, PHP, Python, Ruby etc., you can pick the language of your choice. It doesn’t matter in which language your application under test (AUT) is built. Selenium with Java is recommended because JAVA itself is a very powerful & commonly used language. Before anything else you need the required programming language setup on your machine!

Click here to learn How to install Java Development Kit (JDK)

Integrated Development Environment Tools | Eclipse, IntelliJ

What is the first thing that you need to write a code? Yeah, a text editor. But text editor doesn’t offer any other advantage like auto-correction, intelligent code completion or form designers. Here comes an IDE – Integrated Development Environment – a text editor with additional support for developing, compiling and debugging applications. E.g. Eclipse, Visual Studio, NetBeans OR IntelliJ.

Click here to learn How to Download Eclipse.

Testing Framework | TestNG

From the official website of TestNG,

“TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use”

Such as,

  • Annotations
  • Run your tests in arbitrarily big thread pools with various policies available (all methods in their own thread, one thread per test class, etc…).
  • Test that your code is multithread safe (allowing concurrent testing)
  • Flexible test configuration.
  • Support for data-driven testing (with @DataProvider).
  • Support for parameters.
  • Powerful execution model (grouping & prioritization, no more TestSuite).
  • Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…).
  • Embeds BeanShell for further flexibility.
  • Default JDK functions for runtime and logging (no dependencies).
  • Dependent methods for application server testing.
  • HTML Reporting
  • Parallel Testing
  • Flexible runtime configuration (using build tools or via IDE plugin with visual results etc.)

It is an open source framework; where NG refers to the “Next Generation”. TestNG eliminates most of the limitations of older frameworks and gives us the ability to write more flexible and powerful tests with the help of easy annotations, grouping, sequencing & parameterizing. The design goal of TestNG is to cover a wider range of test categories: unit, functional, end-to-end, integration, etc., with more powerful and easy-to-use functionalities.

Special Thanks to “Cedric Beust”, the creator of TestNG.

Build Automation Tools | Maven, ANT or Gradle

Build automation is the process of automating the creation of a software build and the associated processes. Considered to be the first step in moving toward implementing a culture of Continuous Delivery and DevOps, Build automation combined with Continuous Integration, deployment, application release automation, and many other processes help move an organization forward in establishing software delivery best practices. It helps to improve product quality, accelerate the compile and link processing, eliminate redundant tasks, minimize “bad builds”, have history of builds and releases in order to investigate issues and save time & money.

Build Automation Tools Maven ANT Gradle

Historically done via makefiles, today we use build automation tools to generate build artifacts through activities like compiling and linking source code. Ant and Maven both are build tools provided by Apache. The main purpose of these technologies is to ease the build process of a project. Maven is now more popular than Ant.

Maven or ANT: Maven is a build automation tool used primarily for Java projects. In Yiddish, the word maven means “accumulator of knowledge”. Maven addresses two aspects of building software: first, it describes how software is built, and second, it describes its dependencies. An XML file describes the software project being built, its dependencies on other external modules and components, the build order, directories, and required plug-ins. Maven dynamically downloads Java libraries and Maven plug-ins from one or more repositories such as the Maven 2 Central Repository, and stores them in a local cache. It allows a project to build using its project object model (POM) and a set of plugins that are shared by all projects using Maven, providing a uniform build system. It also provides plenty of useful project information like Change log, cross referenced sources, mailing lists, dependency list, unit test reports including coverage. The real strength of Maven is its dependency management. You only have to declare the dependencies and Maven will download them, setup the classpath, and even deploy the dependencies with the application, if required. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. The Maven project is hosted by the Apache Software Foundation, where it was formerly part of the Jakarta Project. Though Maven and ANT are build tool but main difference is that maven also provides dependency management, standard project layout and project management.

Gradle: Gradle combines good parts of ANT & Maven – it has Ant’s power and flexibility with Maven’s life-cycle and ease of use. Gradle was released in 2012 and gained a lot of attention in a short period of time. For example, Google adopted Gradle as the default build tool for the Android OS. Gradle does not use XML. Instead, it had its own DSL based on Groovy (one of JVM languages). As a result, Gradle build scripts tend to be much shorter and clearer than those written for Ant or Maven. Initially, Gradle used Apache Ivy for its dependency management. Later own it moved to its own native dependency resolution engine.

Behavior Driven Development | Cucumber

Behavior Driven Development

Behavior Driven Development (BDD) is a rising methodology to test your code. Behavior Driven Development gives us an opportunity to create test scripts from both the tester’s and the customer’s perspective as well. At the start, brainstorm about the acceptance test scenarios which should be passed in order to call the software successful. These Test scripts are in simple English language, so it serves the purpose of documentation also. By the time the code is ready, test scripts are ready too. The code has to pass the test scripts defined in BDD. If it does not happen, code refactoring will be needed. Code gets freeze only after successful execution of defined test scripts. In BDD, whatever you write must go into Given-When-Then steps.

  • Given: provides context for the test scenario about to be executed.
  • When: specifies the set of actions that triggers the test.
  • Then: specifies the expected result.

Example,

    Given I navigate to the Facebook application

    When I try to login with valid credentials

    Then I should see that I logged in successfully

It’s like writing the documentation for application functionalities. And what do we need in order to implement BDD? Yeah! A Behavior Driven Development (BDD) Framework. Cucumber is one such open source tool, which supports behavior driven development.

Cucumber

Cucumber BDD

Cucumber, a flagship BDD tool, is a testing framework which supports Behaviour Driven Development (BDD) by allowing us to define application behavior in plain meaningful English using a simple grammar defined by a language called Gherkin. Central to the Cucumber BDD approach is its plain language parser called Gherkin. It is designed to be non-technical and human readable, and collectively describes use cases relating to a software system.

  • Tests are written in plain language based on the behavior-driven development (BDD) style of Given, When, Then, which any layperson can understand.
  • Test cases are then placed into feature files that cover one or more test scenarios.
  • Cucumber interprets the tests into the specified programming language and uses Selenium to drive the test cases in a browser.

It helps in shifting the focus from Tests to Behavior by offering a way to write tests that anybody can understand, regardless of their technical knowledge. BDD frameworks such as Cucumber, JBehave or SpecFlow are an enabler, acting a “bridge” between Business & Technical Language.

Continuous Integration Tools | Jenkins

Jenkins Continuous Integration

Continuous Integration is a development practice that requires automation testers to integrate code into a shared repository at regular intervals. This concept was meant to remove the problem of finding later occurrence of issues in the build life-cycle. Continuous integration requires the testers to have frequent builds. The common practice is that whenever a code commit occurs, a build should be triggered. Jenkins is an open source automation server written in Java that allows continuous integration. It is a server-based system that runs in servlet containers such as Apache Tomcat. Builds can be triggered by various means – commit in a version control system, scheduling via a cron-like mechanism or requesting a specific build URL. The basic functionality of Jenkins is to execute a predefined list of steps, e.g. to compile Java source code and build a JAR from the resulting classes. Jenkins monitors the execution of the steps and allows to stop the process, if one of the steps fails. Jenkins can also send out notification in case of a build success or failure.

Other Tools in the Automation Galaxy

Apart from these common & popular tools, Automation testing using Selenium Webdriver also requires other tools like,

  • AutoIT: to work on windows-based popups (since it’s not web-based)
  • Apache POI: API for Selenium Data driven tests. Apache POI is an open source java library to create and manipulate various file formats based on Microsoft Office like DOC, DOCX, PPT, PPTX, XLS, XLSX. It is mostly used for reading and writing excel documents. Like Apache POI, there are other libraries for performing operations on Excel files.
  • ExtentReports: To generate dynamic HTML logs, step-by-step test case summary, execution history, filter reports based on test status, captures details like OS-Memory-Java version and attach error screenshots within the report.
  • ReportNG: A TestNG plug-in, used to create better reports then the default reports generated by TestNG. Once you execute the tests, TestNG generates a test output folder at the root of the project containing detailed report (errors, test groups, execution time, step-by-step logs) in the <index.html> file and a Summary report (test pass/fail/skip count) in the <emailable-report.html> file. Summary report is an email friendly report which you can embed and share with the stakeholders.

With this we conclude our list that make up the Automation Galaxy of Selenium Webdriver tools. It might not be exhaustive but it will help you understand about the different integrations involved in a Software automation project. Apart from that organizations are slowly moving ahead of Selenium Webdriver and looking for candidates with holistic knowledge about this galaxy of tools. Any other tool which you think should be added to the list? Did we miss anything? Any feedback or comment is really appreciated. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *