Selenium is an open source Web UI (User Interface) automation testing suite. It was developed by Jason Huggins in 2004. Selenium supports automation across various platforms, browsers and programming languages. It can be easily deployed on platforms such as Windows, Linux, Solaris and Macintosh. Moreover, Selenium supports OS for mobile applications like windows mobile, iOS and android.
Selenium supports a variety of programming languages which are driver specific to each language. Languages supported by Selenium include JAVA, PHP, Python C#, Perl, and Ruby etc. Currently, Selenium Web driver is used widely with Java and C#. Selenium test scripts can be coded in any of the programming languages and can be run directly in the latest web browsers. Browsers supported by Selenium include Google Chrome and Safari Mozilla etc.
What is Software Testing and what is its importance?
Software testing is an activity to check whether the actual results expected results matches and to ensure that the software system doesn’t contain any error. It involves the execution of a software or system component to evaluate one or more properties of the system.
Software testing helps to identify errors, gaps or missing requirements which are not not mentioned in the actual requirements. It can be done both manually or using the automated tools. In simple terms, Software Testing means testing and Verification of Application under Test (AUT). This tutorial introduces Selenium to the audience and justifies its importance.
Topics covered in this Tutorial:
Selenium Suite of Tools
Selenium RC
Selenium IDE
Selenium Grid
Selenium WebDriver
Selenium RC
Selenium RC is a test tool that allows you to write automated web application UI tests in any language in any HTTP website using a mainstream JavaScript-enabled browser. Selenium Remote Control is great for testing AJAX-based web user interfaces under a Continuous Integration system.
Selenium RC comes in two parts.
A server whichlaunches automatically and kills browsers, and acts as an HTTP proxy for web requests
It acts as client libraries for your favorite computer language.
Selenuim IDE
Selenium IDE requires no additional setup other than installing the extension on the browser you are using. Selenium IDE is an easy to use tool that will give instant feedback.
Selenium IDE records multiple locators with all the elements it interacts. If any one of the locator fails during playback, the others will be tried until any one of it is successful.
Through the use of the run command, you can re-use one test case inside of another (e.g., It allows you to re-use your login in multiple places all over the a suite).
The Selenium IDE ships with an exclusive control flow structure, with various commands like if, while and times.
Selenium IDE can be extended through the use of various plugins. They can include new commands to the IDE or integrate the software with a third-party service. Write your own or install one that someone else has already written.
Selenium Grid:
What is Selenium Grid?
Selenium Grid is a part of the Selenium Suite that has
the ability of running multiple tests across various browsers, OS, and machines
simultaneously.
Selenium Grid has 2 versions – Grid 1 and Grid 2(new).
When to Use Selenium Grid?
You should use Selenium Grid when you want to do either one or both of following:
Run your tests against different browsers, OS, and machines all simultaneously. This ensures the application you are testing is completely compatible with a wide range of operating system and browser combinations.
If you set up Selenium Grid to run, 6 tests at a time, then you will finish the whole suite around 6 times faster.
Selenium Webdriver
What is WebDriver?
WebDriver is a web automation framework that enhances you to execute your tests against various browsers, not only Firefox and Chrome (unlike Selenium IDE).
WebDriver also enables you to use a programming language in creating your test scripts (This option is not available in Selenium IDE).
Limitations of WebDriver
WebDriver Cannot Readily Support New Browsers
WebDriver operates only on the OS level. Also, that various browsers communicate with the OS in different ways. If there is a browser, it may have a different process of communicating with the OS as compared to other browsers. So, you have to give the WebDriver team quite some time to figure that new process out before they can implement it on the next WebDriver release.
However, it is up to the organizations team of developers to decide if they should support the new browser or not.