Introduction to Selenium 3.0
Hello everyone. This article will help you understand the use of the automation tool Selenium and its advantages.
What Is Testing?
Testing is assessing the functionality of a project/product or its module. We know that the Software Development Life Cycle (SDLC) has the following stages:
- Analysis/Requirement
- Design
- Coding or implementing the functionality
- Testing
- Deployment
- Maintenance
Once the project/product is developed, three stages mentioned above (analysis, design, and coding ) have been completed, followed by the next stage - testing. Testing is usually performed to check the flow of the system and whether the functionality works properly and is based on the requirements. Software testers' work is to identify any bugs/errors to improve the quality product.
Differences Between Manual Testing and Automated Testing
Manual Testing
Manual testing is the process of testing an application manually by navigating to each scenario and testing the product in order to identify if any bugs/errors exist or not. It takes more effort and is time-consuming, as it is a manual process. Manual testers need to execute multiple test cases and finally produce a bug-free product. They have to follow the same process every day, navigating to the same screens and same scenarios. It is quite boring and repetitive work.
In manual testing, there will be multiple scenarios to test, and there are a few chances that the tester may leave certain scenarios, which we can overcome with automated testing.
In manual testing, we have different types of testing:
- Unit testing
- System testing
- Acceptance testing
- blackbox testing
- white box testing
- Smoke testing
- Regression testing
Automation Testing
Once the application is tested by the manual testers, there may be chances of leaving such scenarios; we can overcome the above problem with automation testing tools like Selenium, CodedUI, QTP, etc.
What Is Selenium?
Selenium is an open source tool which is used to execute test scripts on web applications. It supports various programming languages such as Java, C#, PHP, JavaScript, and Ruby.
Selenium supports various operating systems to execute the web applications, like Windows, Linux, MacOS, etc. Selenium is written using Java, and it is cross-platform. Selenium supports various programming languages and various platforms. For these reasons, most of the top companies prefer Selenium rather than using Quick Test Professional (QTP) and CodedUI, which are both licensed versions. It supports various browsers, such as Google Chrome, Edge Browser, Firefox Browser, Internet Explorer, and Safari.
Each browser has its own driver for executing the test scripts; for executing Selenium scripts on Chrome, we have Chromedrivers. For IE, we have Internet Explorer drivers. For Safari, we have Safari drivers. For Opera, we have Opera drivers. Internet Explorer (IE) and Google Chrome support both the 32bit and 64bit versions, which you can download and use based on your system requirements.
In Selenium's earlier versions, Selenium 1.0 and Selenium 2.0, we did not need to set up Firefox drivers to execute the scripts on the Firefox browser. By default, Selenium has support for Firefox. In Selenium 3.0, all the vendors like Google, Apple, Microsoft, Firefox have their own drivers to work on Selenium.
Selenium drivers can be downloaded from this link.
What Are the Components of Selenium?
We have the following Selenium components:
- Selenium Core
- Selenium RC
- Selenium IDE
- Selenium Grid
- Selenium Webdriver
Among these, Selenium 3.0 supports Selenium Grid and Selenium Webdriver and stops using Selenium RC directly. Selenium Core is completely removed from the latest version of Selenium 3.0.
New Features in Selenium 3.0
In the earlier versions of Selenium, like Selenium 2.0, we did not need to set up the Firefox driver, and Selenium doesn’t have a Firefox driver. By default, Selenium supports the Firefox driver.
Using OpenQA.Selenium.Firefox;
[TestMethod]
public void LaunchFireFox() {
FireFoxDriver driver = new FireFoxDriver();
driver.Navigate().GoToUrl("http://www.google.com");
driver.Manage().Window.Maximize();
driver.Quit();
}
In Selenium's latest version, Selenium 3.0, we have a separate driver for Firefox (Geckodriver).
You can download the Geckodriver from Selenium's official Website.
Using OpenQA.Selenium.Firefox;
[TestMethod]
public void LaunchFirefox() {
FireFoxDriverService driver = new FireFoxDriverService("Path of the GeckoDriver", "name of executable file(example geckodriver.exe)")
// code to Launch browser
}
Firefox browser version is supported from 47+. If we want to work with the older versions, i.e. less than version 47, there is no need to install Geckodriver, but working with 47+ either in Selenium 2.0 or Selenium 3.0 requires Geckodriver to be installed and configured.
In this version, we also have support for Microsoft’s Edge browser, which is Microsoft’s own browser.
Following are the prerequisites to work with the Edge Browser:
- The client machine should be installed with a Windows 10 operating system.
- It supports Java greater than version 8 to run Java code (hub).
- Support for the Safari (Apple OS) browser is provided by Safari drivers (10.0 version+).
- From 9+, versions of IE are supported in Selenium 3.0.
Now Selenium 3.0 has become a W3C (worldwide web consortium) standard. Selenium 3.0 removed Selenium Core but supports Selenium RC indirectly through back-end Webdriver.
Who Developed Selenium?
Selenium was developed as an internal project to test the internal applications at ThoughtWorks, which develops client-side technology like JavaScript by Jason Huggins. Later, this project became the first version of Selenium, Selenium 1.0 Core, in 2004.
Jason Huggins tested various internal applications and gave demos to different colleagues. They were excited about the success of the Selenium Core. Later, Paul Hammant joined his team and developed the second version of Selenium (Selenium RC), then this tool became open source to work with the different browsers and platforms.
Simon Stewart at ThoughtWorks developed an automation tool for the browser known as Webdriver, and later they merged Selenium RC with Webdriver to create Selenium Webdriver (Selenium 2.0).
Philippe Hanrigou at ThoughtWorks developed Selenium Grid in 2008. Selenium Grid is used for configuring single hub and multiple nodes. The current hub is capable of running multiple test cases on client machines as well as remote machines, which reduces the time as well as manpower.
Finally, Selenium 3.0 was developed this year with the new features. It is a combination of Selenium 2.0 and Selenium 1.0, which means it supports Selenium 2.0 features but doesn’t have support for Selenium 1.0, i.e. Selenium Core.
Thanks and I hope this article helps you.