Automation Testing & Selenium

Tharun Varshanth Krishnamoorthy
6 min readJan 19, 2021

Automation Testing or Test Automation is a software testing technique that performs using special automated testing software tools to execute a test case suite. Some software development life cycle’s require’s test suite repeatedly. Once test suite is automated, no human intervention is required, no human intervention is required. This improved ROI of Test Automation. The goal of Automation is to reduce the number of test cases to be run manually and not to eliminate Manual Testing altogether. Test Automation is the best way to increase the effectiveness, test coverage, and execution speed in software testing.

Advantages of Automation testing

  • Test Automation increases the speed of test execution
  • costs and efficiency
  • quality
  • resusable

Automated testing disadvantages

• Need better tools and training

• A lot of testing areas left uncovered

• Lack of experience

• Lack of clear goals

Types of Automated testing

  • Code driven (ex :- Unit Tests)
  • GUI(End to End Automation) (ex:- UI object property based, Image recognition based)
  • API/Service Test Automation (Restful APIs, SOAP)
  • Mobile Test Automation (Android , IOS, Hybrid)

Testing types and tools

GUI -web testing

  • united functional testing
  • Selenium
  • testcomplete

Mobile Testing tools

  • Perfacto
  • appium
  • calabash

GUI -Windows

  • TestComplete
  • sikuli
  • ranorex

API Testing

  • Postman
  • RapidApi
  • SoapUI

Automated Testing Frameworks

Frameworks is supporting structure which something can be built, increase usability, reusability maintainability ,error handling.

  1. Linear Automation Framework
  2. Modular Based Testing Framework
  3. Library Architecture Testing Framework
  4. Data-Driven Framework
  5. Keyword-Driven Framework
  6. Hybrid Testing Framework

Automated Testing Process:

Following steps are followed in an Automation Process

Step 1) Test Tool Selection

Step 2) Define scope of Automation

Step 3) Planning, Design and Development

Step 4) Test Execution

Step 5) Maintenance

Selenium

Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that.Boring web-based administration tasks can (and should) also be automated as well. It also provides a test (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. The tests can then run against most modern web browsers. Selenium runs on Windows, Linux, and macOS. It is open-source software released under the Apache License 2.0.

It provides extensions to emulate user interaction with browsers, a distribution server for scaling browser allocation, and the infrastructure for implementations of the W3C WebDriver specification that lets you write interchangeable code for all major web browsers.This project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available for anyone to use, enjoy, and improve.Selenium brings together browser vendors, engineers, and enthusiasts to further an open discussion around automation of the web platform. The project organises an annual conference to teach and nurture the community.At the core of Selenium is WebDriver, an interface to write instruction sets that can be run interchangeably in many browsers.

Selenium has many projects that combine to from a versatile testing system

Selenium IDE

Selenium Web driver

Selenium Web Driver

Selenium IDE

Selenium IDE is a complete for Selenium tests. It is implemented as a Firefox Add-On and as a Chrome Extension. It allows for recording, editing and debugging of functional tests. It was previously known as Selenium Recorder. Selenium-IDE was originally created by Shinya Kasatani and donated to the Selenium project in 2006. Selenium IDE was previously little-maintained. Selenium IDE began being actively maintained in 2018.

Scripts may be automatically recorded and edited manually providing autocompletion support and the ability to move commands around quickly. Scripts are recorded in Selenese, a special test scripting language for Selenium. Selenese provides commands for performing actions in a browser (click a link, select an option) and for retrieving data from the resulting pages.

Advantages

Web Ready

Simple, turn-key solution to quickly author reliable end-to-end tests. Works out of the box for any web app.

Easy Debugging

Enjoy easier test debugging with rich IDE features like setting breakpoints and pausing on exceptions.

Cross-browser Execution

Run your tests on any browser/OS combination in parallel using the Command-line Runner for Selenium IDE.

Selenium web driver

if we are beginning with desktop website or mobile website test automation, then you are going to be using WebDriver APIs. WebDriver uses browser automation APIs provided by browser vendors to control browser and run tests. This is as if a real user is operating the browser. Since WebDriver does not require its API to be compiled with application code, it is not intrusive. Hence, you are testing the same application which you push live.

where the Selenium server was necessary to run tests, Selenium WebDriver does not need a special server to execute tests. Instead, the WebDriver directly starts a browser instance and controls it. However, Selenium Grid can be used with WebDriver to execute tests on remote systems (see below). Where possible, WebDriver uses native operating system level functionality rather than browser-based JavaScript commands to drive the browser. This bypasses problems with subtle differences between native and JavaScript commands, including security restrictions.

Advantages

Simple and concise

WebDriver is simple, it is designed as a concise and compact programming interface.

Works in all major browsers

Through a simple setup, WebDriver can be used with all major browsers. Automate real user interactions in Firefox, Safari, Edge, Chrome, Internet Explorer and more!

Selenium WebDriver refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just WebDriver.

WebDriver is a W3C Recommendation!

The W3C is an international community that works to develop Web standards. In June 2018, WebDriver became a W3C recommendation.

What does this mean? Major browser vendors (Mozilla, Google, Apple, Microsoft) support WebDriver and work constantly to improve the browsers
and browser controlling code, which leads to a more uniform behaviour across the different browsers, making your automation scripts more stable.

Selenium Grid

Selenium Grid is a server that allows tests to use web browser instances running on remote machines. With Selenium Grid, one server acts as the central hub. Tests contact the hub to obtain access to browser instances. The hub has a list of servers that provide access to browser instances (WebDriver nodes), and lets tests use these instances. Selenium Grid allows running tests in parallel on multiple machines and to manage different browser versions and browser configurations centrally (instead of in each individual test).

The ability to run tests on remote browser instances is useful to spread the load of testing across several machines and to run tests in browsers running on different platforms or operating systems. The latter is particularly useful in cases where not all browsers to be used for testing can run on the same platform.

Selenium Grid allows you to run test cases in different machines across different platforms. The control of triggering the test cases is on the local end, and when the test cases are triggered, they are automatically executed by the remote end.

After the development of the WebDriver tests, you may face the need of running your tests on multiple browser and operating system combinations. This is where Grid comes into the picture.

Advantages

Multiple browsers, versions, and operating systems

Grid helps you to run your automation scripts across multiple combinations of browsers, versions and operating systems.

Reduce execution time

Finally ,Testing tools can help automate tasks such as product installation, test data creation, GUI interaction, problem detection (consider parsing or polling agents equipped with test oracles), defect logging, etc., without necessarily automating tests in an end-to-end fashion.

--

--