- Selenium is a set of software tools used to perform automation of web based applications across different browsers and platforms. However, it does not support automation of Desktop based applications.
- Selenium came into existence in 2004, founded by Mr. Jason Huggins during testing of an internal application at ThoughtWorks.
- Selenium has four major components:
- Selenium IDE
- Selenium Remote Control
- Selenium Web Driver
- Selenium Grid
- Lets discuss these components one by one
Selenium IDE:
Selenium IDE is a integrated development environment (IDE) for testing web applications. It is implemented as a Chrome and Firefox extension. It provides record and playback feature and allows recording, editing, and debugging of tests. It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. Selenese provides commands for performing actions in a browser like clicking, selection etc. It can also records user actions as they are performed and then exports them as reusable script in one of many programming languages that can be later executed.
Limitations :
- IDE only comes as Firefox and chrome extension. It does not support edge and Internet explorer.
- Selenium IDE is not suitable in case you want to built a robust frameworks.
- It does not support Database testing also.
Selenium Remote Control :
Selenium RC used to control a browser from a language of your choice. Selenium-RC server (Remote Control) acts as proxy between our Driver code and Application under Test . This methodology of Client-Server architecture of Selenium RC makes it slower then Selenium Web Driver.
Limitations :
-
- Selenium RC provides no support for Android and iOS Platform.
- Server need to be started every time to run a program.
- It uses JavaScript to talk to browser, which leads to same-origin policy issue. Every browser impose very strict security rules on the JavaScript being executed to protect the users from malicious scripts.
- RC does not support a headless browser.
- Native keyboard and mouse events cannot be handled in efficient manner
Selenium Web Driver:
The Selenium Webdriver architecture is completely different from RC. Unlike RC there is no proxy server between application under test and scripts. It makes direct calls to the browser using each browser’s native API support for automation. As Webdriver directly talks with browser, we can overcome the limitations of JavaScript security model which we have faced with Selenium Core in RC.
Features of Selenium WebDriver :
- Selenium WebDriver supports multiple programming Languages (Java, JavaScript, C#, Python, Ruby, PHP, Perl).
- Selenium WebDriver supports multiple browsers (Chrome, Firefox, edge, Internet Explorer etc).
- Selenium WebDriver can handle Mouse movements.
- It can handle rich APIs.
- Selenium WebDriver supports multiple platforms(iOS, MAC, Linux, Windows).
Selenium Grid:
Selenium Grid allows us to run your tests in parallel.It allows us to run our tests on different machines against different browsers.. Selenium Grid greatly improves the time it takes to run your suite by making use of parallel processing. Selenium Grid uses a hub-node concept, we only run the test on a single machine called a hub, but the execution will be done on different machines called nodes.
Installation of Selenium Web Driver is a three stage Process:
- Installation of JDK
- Installation of IDE (Eclipse)
- Install Selenium Driver Files
We will discuss these steps one by one in subsequent articles.