selenium-tutorial

Selenium Tutorial for Beginners – Learn Selenium Online

Selenium Tutorial provides the basic and advanced concepts of Selenium and this Tutorial is designed for beginners and professionals to learn Selenium Tutorial Online. Selenium is one of the most powerful open source automation tool for web application testing (even we can say acceptance testing for web application). This tool is primarily developed in Java Script and browser technologies such as DHTML and Frames and hence supports all the major browsers on all the platforms.

Selenium Tutorial For beginners

What is Selenium?

Selenium is a set of different software tools each with a different approach to supporting test automation. Most Selenium QA Engineers focus on the one or two tools that most meet the needs of their project, however learning all the tools will give you many different options for approaching different test automation problems.

The entire suite of tools results in a rich set of testing functions specifically geared to the needs of testing of web applications of all types. These operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior. One of Selenium’s key features is the support for executing one’s tests on multiple browser platforms.

In terms of coverage for platform and browser, Selenium is probably one of the best tool available in the market for web applications. Selenium is an automate web application testing across many platforms.

Selenium Advantage

  1. Opensource tool
  2. No licensing cost associated with it
  3. Customize according to our requirement

Selenium Disadvantage.

  1. we cannot be assured of any add-ins which would be required if selenium fails to recognize objects
  2. Also Support provided for Selenium would be very less (Incase of QTP, Mercury provides standard solutions and supports to issues)

Selenium Tutorial

Variants of Selenium: There are four variants of Selenium, which can be used in isolation or in combination to create complete automation suite for your web applications.

  • Selenium IDE
  • Selenium Core
  • Selenium Remote Control
  • Selenium Grid

Functional Testing Tool:

Functional testing tool with its powerful set of features allows automated GUI testing in minutes. Listed below are some of the features of functional testing.

Scripting Capabilities

Simplified Script Creation – In selenium, the default script is in html and it is the most common scripting language used among peoples.

1), Keyword driven testing

2), Standard Scripting Language allows you to easily create/update scripts without much programming knowledge.

3), Object Repository is not available in selenium but it is one of the features of all Functional testing tool.

4), Data driven Testing enables you to perform functional testing in different scenarios by just changing the test data in an external data source. Selenium supports Data driven testing.

5), Unicode supports allows you to test multi-language deployments of your applications.

6), Supports pattern-matching capabilities to improve test script reuse, if application changes frequently.

Portability:

1), Allows you to record scripts in Windows and replay it in Linux without re-creating the scripts.

1), Browser Abstraction Layer allows scripts recorded in one browser to be replayed in all other supported browsers.

3), Runtime locale option lets you to simultaneously test all language versions of your application with a single script. 

Validation and Verification

1), Rich Library of Built in function added using the Function Generator tool. This helps you to construct function calls for specific testing requirements which include: In selenium, user has to create Built in function for their testing.

2), Checkpoints that include Text, GUI, XML, File and Database enable thorough validation of your web applications/web sites. In selenium, there is a similar thing for checkpoint called verify or asset. But user can’t able to check for images/bitmap. If user wants to check for database then they have to create a database connection with JavaScript and put it in user extensions.

3), Playback Options

Automatic/Customizable Error Recovery for unattended testing to handle unexpected window, like an ASSERT box, pop- ups, etc. But automatic error recovery for unattended testing is not available for selenium but user can write his/her own scripts to handle this.


Playback Synchronization to handle the variation in time the application takes to load a new page. Ex: In selenium ClickAndWait is a command which will wait for the page to load and start executing the next command.

Option to chain scripts for controlling the order of script execution. In selenium core, we can do the order of execution and if user wish he can execute everything as a batch file.

Multiple Play back options that enables testers to debug test errors while creating and maintaining test scripts. Selenium supports multiple play back options.

Allows execution of individual and/or groups of tests from one or many workstations.

Provision for command-line invocation allows invocation from batch files or scheduling utilities.

Reporting Capabilities

Clear and Powerful Reports are provided to indicate the status of the test execution.

Hyperlinks or color coding(RED color for failure) allow easy navigation through the report.

This helps you to quickly identify application failures and clearly assess application quality.

Future of Selenium 

The Selenium tool suite is constantly being worked on. Having been embraced by Google as one of their automation tools, with many of the key figures in Selenium development working at Google, It can often seem daunting choosing between the many open-source software testing tools to know which ones will be supported and maintained over the years. The fact that Google works with it means that there will remain a talented set of programming and testing talent behind the tool.

Selenium is also used in spin off tools like the load testing tool from BrowserMob.com, which uses the selenium API as its scripting language from JavaScript to write the automated tests. The current direction for Selenium, which should manifest as Selenium 2.0 merges the code bases for Selenium 1.0 and WebDriver.

Selenium takes the automation approach of driving the website through JavaScript with the Selenium RC server using Selenium Core to automate the site. This has some issues with security and cross browser scripting which is why there are so many ways of instantiating a browser session for the supported browsers. e.g. *iexplore, *firefox, *firefoxproxy, *iexploreproxy WebDriver takes a different approach. It calls the browsers directly through their respective automation interfaces.

WebDriver has a different API than Selenium. It is a far more Object Oriented interface and can seem cleaner. WebDriver also supports the use of HTML Unit which means you can test websites without creating a ‘real’ browser so tests can run faster and more easily in a Continuous Integration environment.

For Selenium 2.0 the plan is to support both APIs:

  • Selenium API (large set of commands off the Selenium interface)
  • WebDriver API (object oriented browser automation based interface)

This means that you should still be able to write tests using the Selenium API, but have the tool drive the browser directly. This should see an end to some of the JavaScript injection issues and make the tests faster to run. It also means that the WebDriver API can be used with the Selenium JavaScript injection approach, allowing WebDriver access to browsers which it doesn’t yet have a native automation driver for.

All of this basically means that:

  • Selenium is still being developed
  • The Selenium API you have started learning with this text will still exist and be usable in Selenium 2.0

The time you have spent learning Selenium should be an investment in time and you can look forward to continuing to learn more in the future.

Selenium Tutorial for beginners explain what Selenium, and it gives a brief understanding of messaging and important Selenium concepts are explained above post. I will be adding more posts in Selenium Tutorial, so please bookmark the post for future reference too.

Online Training Tutorials