Selenium Tutorial With Java Easy & Free

This free selenium tutorial is designed to learn and understand selenium automation testing easily. Beginners can start from basic of selenium testing and advanced level users can learn advanced topics of selenium testing using this selenium tutorial. We will learn about selenium webdriver architecture, installation, test case creation, different commands, running webdriver test on different browsers, locating web element by different element locating strategies, handling and interacting with different web elements and framework creation.

Selenium Tutorial

What is selenium?

Selenium is widely used automation testing tool in software industry. It is framework which is designed to validate and automate web application on different web browsers and platforms. There are many testing tools available in market. But most of them are paid. Selenium webdriver is open source testing tool so you not need to pay for any license. You can download and use it in free of cost which makes is popular in software testing industry. Selenium project is developed by hundreds of volunteer contributors by spending their own thousands of hours which made it open source for everyone to use and improve.

Different components of selenium Suite

Selenium is not single tool. There are different four tools as below which are designed to perform different testing activity.

Different tools of selenium

Selenium IDE(Integrated Development Environment)

Selenium beginners can start from selenium IDE as one not need any coding language knowledge to automate and run tests in selenium IDE. It is browser extension supported in Firefox and chrome browsers. You can record your tests and play it again to execute test. You can debug your tests as well in selenium IDE. 

Selenium RC

Selenium RC or selenium 1 was main project of selenium. Later on selenium 2 was released by merging selenium and webdriver and selenium RC deprecated.

There were two components selenium server and client libraries in selenium RC. Server used to launch and kill browsers, Executes selenese commands, Verifying http messages passing between the AUT and browser.

WebDriver

Selenium WebDriver is W3C recommended which drives browser natively as user would. Webdriver is Object Oriented API and being used by most of testers as it drives the browser very effectively. As of now, selenium 3 is latest version of webdriver. We will learn more about selenium webdriver in this selenium tutorial.

Selenium Grid

Selenium grid allows to run webdriver tests on multiple machines in parallel. You can run tests on different web browsers, browser versions and perform cross platform testing.

Selenium History

  • 2004 : Initial development of selenium was started by Jason Huggins of ThoughtWorks. He developed JavaScript TestRunner to automate frontend user interactions.
  • 2005 : Dan Fabulich and Nelson Sproul has developed Selenium RC or selenium 1 by working on selenium driver code.
  • 2006 : Selenium IDE was developed by Shinya Kasatani by wrapping driver code in an IDE module.
  • 2007 : Simon Stewart made it possible to run selenium tests in each popular browsers by separating driver clients for each browser. Which is known as selenium webdriver or selenium 2.
  • 2008 : Server created by Philippe Hanrigou which allows to run selenium test on n number of remote devices.
  • 2016 : Selenium 3 launched.
  • 2021 : Selenium 4 released.

Languages support in selenium 3

In selenium, you can write test scripts in different languages as below.

  • Java
  • Python
  • C#
  • Ruby
  • JavaScript (Node.JS)
  • Kotlin
Selenium 3 supported languages
Java is widely used language with selenium.

Selenium supported testing types

You can perform below given wide variety of testing types using selenium suite.
  • Regression testing
  • Integration testing
  • System testing
  • End to end testing
  • Compatibility testing
  • Performance testing
Selenium Supported Testing types

Selenium WebDriver supported OS Platforms

Selenium webdriver support below given different OS platforms.
  • Windows
  • MAC
  • Linux/Unix
Selenium Webdriver Supported OS Platforms.png

Selenium WebDriver supported Browsers

You can perform web application testing on below given all the web browsers using selenium webdriver.
  • Google Chrome
  • Mozilla Firefox
  • Edge
  • IE
  • Safari
Selenium Webdriver Supported Web Browsers

Locators supported by selenium webdriver

To perform any action like click, type, select on web element, you need to locate element. Selenium support many different locators as below.
  • ID
  • Name
  • className
  • tagName
  • linkText
  • partiallinkText
  • CSS Selector
  • XPath
selenium webdriver supported locators

When to use selenium IDE and when to use selenium webdriver?

You can automate simple test cases like login, form filling, site navigation etc. in selenium IDE. Also you not need and coding language knowledge in selenium IDE. It is simple plug and play tool. You can record your test scenarios and then play them to re execute tests whenever required. In improved versions of selenium IDE, you can perform data driven testing as well but it is little bit complicated in selenium IDE.

Complicated and lengthy test cases can not be automated in selenium IDE. You need selenium Webdriver or selenium 3 to automate complicated tests. For using selenium webdriver, you must know basics of any language supported by selenium webdriver.

Easy to implement

Selenium is very easy to implement which makes it user friendly. If you are good programmer then you can develop your own extension as per your requirement and plug it with selenium.

Tools and frameworks support

You can use different tools/frameworks like maven, JUnit, TestNG, for easy test and project management and CI/CD tool like Jenkins for easy deployment process.

Is selenium easy to learn?

Learn selenium in 15 days or 30 days or 60 days are false claims. I am not believing on all these claims. It is not very tough to learn selenium if you start learning it with proper discipline and strategy. You should start with basics first. Clear basic concepts of HTML, Java, selenium first then you can proceed with advanced learning step by step. You need to spend one or two hour daily. Read and implement online selenium tutorial java basics tutorial, HTML tutorial, watch videos tutorials. Slowly start implementation of same in your project.

How can I learn selenium by myself?

Trend of selenium automation tool is increasing day by day. It is must have a skill for every software test engineer and developers. If you are selenium beginner learner then you can follow below given process to start with selenium.
  • Learn HTML basics
  • Learn any programming language like Java which is most popular with selenium.
  • Learn element locators
  • Install eclipse and configure selenium webdriver in eclipse.
  • Learn basic test case creation with selenium.
  • Install and Integrate JUnit or TestNG to use with selenium.
  • Implement and automate lengthy scenarios with selenium.
  • Learn and and implement frameworks like data driven, Keyword driven, Hybrid, POM etc.
  • Install and integrate CI/CD tools like Jenkins.

Is selenium good career opportunity?

Yes, Demand of selenium testers is increasing exponentially. Most of the companies are using selenium as an automation tool. I think, your future will be bright if you are choosing selenium as career.

Which is best language for selenium?

Selenium support many different languages but most popular language to work with selenium is Java and Python.

Why selenium is popular software testing tool?

There are hundreds of software testing tools available in market but most of them are paid or hard to implement, less community support and OS limitations. Selenium is popular because it is open source, support multiple languages, allow to work across multiple OS platforms, cross browser compatibility, allow to integrate different open source frameworks, can perform cross device testing, easy to implement, reusability, cursor and keyboard simulation, no server requirement and interact with browser as a user. Selenium webdriver is constantly updated by voluntary contributors so it is improving day by day. Lots of new features are being implemented, Bugs getting fixed to improve user experience and easy usage.

No comments:

Post a Comment