Selenium is a open source automated testing suite.

Software Testing: Software testing is a process of executing a program or application with the intent of finding the software bugs.Automated testing or test automation is a method in software testing that makes use of special software tools to control the execution of tests and then compares actual test results with predicted or expected results.Selenium is an open-source tool that is used for test automation.

Software Testing:

Software is a series of instructions for the computer that perform a particular task, called a program; the two major categories of software are system software and application software. System software is made up of control programs. Application software is any program that processes data for the user (spreadsheet, word processor, payroll, etc.). A software product should only be released after it has gone through a proper process of development, testing and bug fixing.

Testing looks at areas such as performance, stability and error handling by setting up test scenarios under controlled conditions and assessing the results. This is why exactly any software has to be tested. It is important to note that software is mainly tested to see that it meets the customers’ needs and that it conforms to the standards. It is a usual norm that software is considered of good quality if it meets the user requirements.

Software testing is being recognized as a profession now. Even though the word “Software Testing” is too common, the question “What is software testing” is being asked worldwide today.It is because of the crucial role software testing plays in the day to day life. It is also said to be an art to improve the quality of the software made. Software testing is the operating of software under controlled conditions to check whether the software works well and to rectify the errors, and also to make sure that we are delivering the correct software what the user intends.

The definition of testing according to the ANSI/IEEE 1059 standard is that “testing is the process of analyzing a software item to detect the differences between existing and required conditions (that is defects/errors/bugs) and to evaluate the features of the software item”.Testing the software is the process of validating and verifying of a software program. The errors are to be identified in order to fix those errors. Thus the main objective of software testing is to maintain and deliver a quality product to the client. Every software is expected to meet certain needs. So when a software is developed it is required to check whether it fulfills those needs. A banking software is entirely different from a software required in a shop. The needs and requirements of both those software are different. Hence it is important to check its potential.

The main goal of software testing is to know the errors of the software before the user finds them. A good tester is one who makes the software fail. He should always be in a mentality to destruct the software. A software tester should not be the one who makes the software.

Software testing helps to make sure that it meets all the requirement it was supposed to meet:

  • It will bring out all the errors, if any, while using the software.
  • Software testing helps to understand that the software that is being tested is a complete success
  • Software testing helps to give a quality certification that the software can be used by the client immediately.
  • It ensures quality of the product.

Testing Levels and Types:

There are basically three levels of testing i.e. Unit Testing, Integration Testing and System Testing. Various types of testing come under these levels.

Unit Testing :

To verify a single program or a section of a single program Integration Testing To verify interaction between system components Prerequisite: unit testing completed on all components that compose a system. System Testing To verify and validate behaviors of the entire system against the original system objectives.Software testing is a process that identifies the correctness, completeness, and quality of software.

Following is a list of various types of software testing and their definitions in a random order:

• Formal Testing: Performed by test engineers

• Informal Testing: Performed by the developers

• Manual Testing: That part of software testing that requires human input, analysis, or evaluation.

• Automated Testing: Software testing that utilizes a variety of tools to automate the testing process. Automated testing still requires a skilled quality assurance professional with knowledge of the automation tools and the software being tested to set up the test cases.

• Black box Testing: Testing software without any knowledge of the back-end of the system, structure or language of the module being tested. Black box test cases are written from a definitive source document, such as a specification or requirements document.

• White box Testing: Testing in which the software tester has knowledge of the back-end, structure and language of the software, or at least its purpose.

• Unit Testing: Unit testing is the process of testing a particular complied program.

Automated testing:

Automated testing refers to the process of testing a system by using some tools, software, and scripts.  While humans take care of the manual testing, the input of human is removed here and scripts and other tools are given the liberty to take absolute control over the testing.

Some of the reasons why many software development companies prefer automated testing to manual testing include:

  • Speed: This is definitely the first advantage of automated testing on the manual counterpart. While it will take days or weeks to fully test a program manually, automated testing will be through within a couple of hours. This saves time for the company. If the business lacks complex business rules, automated testing will be ideal in getting things done better and faster.
  • Reliability: Manually testing a program exposes it to some minor human errors. A bug may be accidentally overlooked, leading to more problems in the long run. An automated testing will definitely spot such bugs and report them for correction. A great advantage too.

When testing is expected to be repetitive for a good number of times and manual testing is found inefficient, automated testing will adequately fill the vacuum. This testing method is also the best for if the company wants to perform regressions in testing, acts that will involve frequent code changes.

Software Test Automation :

Automating testing is no different from a programmer using a coding language to write programs to automate any manual process. One of the problems with testing large systems is that it can go beyond the scope of small test teams. Because only a small number of testers are available the coverage and depth of testing provided are inadequate for the task at hand.Expanding the test team beyond a certain size also becomes problematic with increase in work over head. Feasible way to avoid this without introducing a loss of quality is through appropriate use of tools that can expand individual’s capacity enormously while maintaining the focus (depth) of testing upon the critical elements.

Selenium:

Selenium is one of the most widely used open source Web UI (User Interface) automation testing suite.It was originally developed by Jason Huggins in 2004 as an internal tool at Thought Works. Selenium supports automation across different browsers, platforms and programming languages.Selenium can be easily deployed on platforms such as Windows, Linux, Solaris and Macintosh. Moreover, it supports OS (Operating System) for mobile applications like iOS, windows mobile and android.

Selenium supports a variety of programming languages through the use of drivers specific to each language.Languages supported by Selenium include C#, Java, Perl, PHP, Python and Ruby.Currently, Selenium Web driver is most popular with Java and C#. Selenium test scripts can be coded in any of the supported programming languages and can be run directly in most modern web browsers. Browsers supported by Selenium include Internet Explorer, Mozilla Firefox, Google Chrome and Safari.

Selenium can be used to automate functional tests and can be integrated with automation test tools such as Maven, Jenkins, & Docker to achieve continuous testing. It can also be integrated with tools such as TestNG, & JUnit for managing test cases and generating reports.

Selenium Basic Terminology:

Before proceeding with this tutorial, let us first understand some of the key concepts associated with Automation testing of an application.With the growing need for efficient software products, every software development group need to carry out a series of tests before launching the final product into the market. Test engineers strive to catch the faults or bugs before the software product is released, yet delivered software always has defects. Even with the best manual testing processes, there's always a possibility that the final software product is left with a defect or is unable to meet the end user requirement. Automation testing is the best way to increase the effectiveness, efficiency and coverage of your software testing.

Automation testing uses the specialized tools to automate the execution of manually designed test cases without any human intervention. Automation testing tools can access the test data, controls the execution of tests and compares the actual result against the expected result. Consequently, generating detailed test reports of the system under test.

Automation testing covers both functional and performance test on an application.

  • Functional automation is used for automation of functional test cases. For example, regression tests, which are repetitive in nature, are automated.
  • Performance automation is used for automation of non-functional performance test cases. For example, measuring the response time of the application under considerable (say 100 users) load.

Automation Testing tools which are used for functional automation:

  • Quick Test Professional, provided by HP.
  • Rational Robot, provided by IBM.
  • Coded UI, provided by Microsoft.
  • Selenium, open source.
  • Auto It, open Source.

Automation Testing tools which are used for non-functional automation:

  • Load Runner, provided by HP.
  • JMeter, provided by Apache.
  • Burp Suite, provided by PortSwigger.
  • Acunetix, provided by Acunetix.

Selenium Features:

  • Selenium is an open source and portable Web testing Framework.
  • Selenium IDE provides a playback and record feature for authoring tests without the need to learn a test scripting language.
  • It can be considered as the leading cloud-based testing platform which helps testers to record their actions and export them as a reusable script with a simple-to-understand and easy-to-use interface.
  • Selenium supports various operating systems, browsers and programming languages. Following is the list:
    • Programming Languages: C#, Java, Python, PHP, Ruby, Perl, and JavaScript
    • Operating Systems: Android, iOS, Windows, Linux, Mac, Solaris.
    • Browsers: Google Chrome, Mozilla Firefox, Internet Explorer, Edge, Opera, Safari, etc.
  • It also supports parallel test execution which reduces time and increases the efficiency of tests.
  • Selenium can be integrated with frameworks like Ant and Maven for source code compilation.
  • Selenium can also be integrated with testing frameworks like TestNG for application testing and generating reports.
  • Selenium requires fewer resources as compared to other automation test tools.
  • WebDriver API has been indulged in selenium whichis one of the most important modifications done to selenium.
  • Selenium web driver does not require server installation, test scripts interact directly with the browser.
  • Selenium commands are categorized in terms of different classes which make it easier to understand and implement.
  • Selenium Remote Control (RC) in conjunction with WebDriver API is known as Selenium 2.0. This version was built to support the vibrant web pages and Ajax.

Limitations:

  • Selenium does not support automation testing for desktop applications.
  • Selenium requires high skill sets in order to automate tests more effectively.
  • Since Selenium is open source software, you have to rely on community forums to get your technical issues resolved.
  • We can?t perform automation tests on web services like SOAP or REST using Selenium.
  • We should know at least one of the supported programming languages to create tests scripts in Selenium WebDriver.
  • It does not have built-in Object Repository like UTF/QTP to maintain objects/elements in centralized location. However, we can overcome this limitation using Page Object Model.
  • Selenium does not have any inbuilt reportingcapability; you have to rely on plug-ins like JUnit and TestNG for test reports.
  • It is not possible to perform testing on images. We need to integrate Selenium with Sikuli for image based testing.
  • Creating test environment in Selenium takes more time as compared to vendor tools like UFT, RFT, Silk test, etc.
  • No one is responsible for new features usage; they may or may not work properly.
  • Selenium does not provide any test tool integration for Test Management.

Selenium is a free (open source) automated testing suite for web applications across different browsers and platforms. It is quite similar to HP Quick Test Pro (QTP now UFT) only that Selenium focuses on automating web-based applications. Testing done using Selenium tool is usually referred as Selenium Testing.Selenium is not just a single tool but a suite of software's, each catering to different testing needs of an organization. It has four components.

  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • WebDriver
  • Selenium Grid

Selenium WebDriver:

Selenium WebDriver is the most important component of Selenium Tool's Suite. The latest release "Selenium 2.0" is integrated with WebDriver API which provides a simpler and more concise programming interface.Selenium WebDriver was first introduced as a part of Selenium v2.0. The initial version of Selenium i.e Selenium v1 consisted of only IDE, RC and Grid. However, with the release of Selenium v3, RC has been deprecated and moved to legacy package.

 Introduction Selenium IDE:

Selenium Integrated Development Environment (IDE) is the simplest framework in the Selenium suite and is the easiest one to learn. It is a Firefox plugin that you can install as easily as you can with other plugins. However, because of its simplicity, Selenium IDE should only be used as a prototyping tool. If you want to create more advanced test cases, you will need to use either Selenium RC or WebDriver.

Introduction Selenium Remote Control (Selenium RC):

Selenium RC was the flagship testing framework of the whole Selenium project for a long time. This is the first automated web testing tool that allowed users to use a programming language they prefer. As of version 2.25.0, RC can support the following programming languages:

  • Java
  • C#
  • PHP
  • Python
  • Perl
  • Ruby

Introduction WebDriver:

The WebDriver proves itself to be better than both Selenium IDE and Selenium RC in many aspects. It implements a more modern and stable approach in automating the browser's actions. WebDriver, unlike Selenium RC, does not rely on JavaScript for Automation. It controls the browser by directly communicating with it.

The supported languages are the same as those in Selenium RC.

  • Java
  • C#
  • PHP
  • Python
  • Perl
  • Ruby

Selenium Grid:

Selenium Grid is a tool used together with Selenium RC to run parallel tests across different machines and different browsers all at the same time. Parallel execution means running multiple tests at once.

       Features:

  • Enables simultaneous running of tests in multiple browsers and environments.
  • Saves time enormously.
  • Utilizes the hub-and-nodes concept. The hub acts as a central source of Selenium commands to each node connected to it.

Advantages of Selenium:

1) Selenium is an Open Source Software.

2) Selenium supports various programming languages to write programs (Test scripts)

3) Selenium supports various operating systems (MS Windows, Linux, Macintosh etc…)

4) Selenium supports various Browsers (Mozilla Firefox, Google Chrome, IE, Opera, Safari etc…)

5) Selenium supports Parallel Test Execution.

6) Selenium uses less Hardware resources.

Disadvantages of Selenium:

1) No reliable Technical Support from anybody.

2) It supports Web based applications only.

3) Difficult to use, takes more time to create Test cases.

4) Difficult to Setup Test Environment when it compares to Vendor Tools like UFT, RFT, SilkTest etc…

5) Limited support for Image Testing.

6 New features may not work properly.

7) No Test Tool integration for Test Management.

8) No Built-in Reporting facility.

Summary:

  • The entire Selenium Tool Suite is comprised of four components:
  • Selenium IDE, a Firefox add-on that you can only use in creating relatively simple test cases and test suites.
  • Selenium Remote Control, also known as Selenium 1, which is the first Selenium tool that allowed users to use programming languages in creating complex tests.
  • WebDriver, the newer breakthrough that allows your test scripts to communicate directly to the browser, thereby controlling it from the OS level.
  • Selenium Grid is also a tool that is used with Selenium RC to execute parallel tests across different browsers and operating systems.
  • Selenium RC and WebDriver was merged to form Selenium 2.
  • Selenium is more advantageous than QTP in terms of costs and flexibility. It also allows you to run tests in parallel, unlike in QTP where you are only allowed to run tests sequentially.