INTRODUCTION TO SELENIUM

Hello readers and Friends,
It’s been while since I here. I’m here to share about selenium in this blog. You know when did I heard about selenium? In my 9th standard……!!!
At that time I know selenium as a chemical element not a tool. Selenium is a chemical element atomic number 34, p-block. But I’m not a chemistry student now, I’m Computer application student now. I know selenium as software testing tool.

Let’s see the introduction of Selenium:

  • > Selenium is used to automate the browsers.
    -> It is completely free and it is an open source, we can use this anywhere as long as we have system and internet.
    -> This tool can be executed on multiple platforms.
    -> Selenium can be controlled by many programming language and testing frameworks.
    -> It is also support provided from several other open source tools like Jenkins and ANT etc.,
    -> It can also integrated with several defect tracking tools.

History of Selenium:
-> Selenium was developed by Jason Huggins in 2004. When he created it he was working on a in-house project in Thoughtworks. and then he working on selenium core.

-> Dan Fabulich and Nelson Sproul are both created Selenium RC (Remote Control).
-> Shinya Kasatani in Japan become interested in Selenium, and realised that he could wrap the core code into IDE module into the Firefox browser, and be able to record tests as well as play them back in the same plugin.

-> Selenium is a robust tool that supports rapid development of test automation for web-based applications.
-> It can simulate a user navigation through pages and then assert for specific marks on the pages.
-> It’s an open source web-based testing automation tool and cross-browser compliant.
-> It is an open source tool and very easy to use.

SELENIUM COMPATIBILITY:

SELENIUM COMPONENTS:

SELENIUM RC (REMOTE CONTROL)
-> Selenium-RC provides a API (Application Programming Interface) and library for each of it’s supported languages for example HTML, Java, C#, Perl, PHP, Python and Perl.
-> This ability to use Selenium-RC with a high-level programming language to develop test cases also allows the automated testing to be integrated with a project’s automated build environment. It’s also called as Selenium 1.

Do you know how RC works?
See the picture below and it can explain what you trying….!

SELENIUM WEB DRIVER:
-> Selenium webdriver is a successor of Selenium Remote control which has been officially deprecated.
-> It is a collection of language specific binding to drive a browser.
-> It is designed in a simpler and more concise programming interface along with addressing some limitations in the Selenium-RC APL.
SELENIUM 1 + SELENIUM WEBDRIVER = SELENIUM 2

SELENIUM GRID:
->
Selenium Grid can run large test suites and test that must be run in multiple environments.
-> Tests can be run in parallel with simultaneous execution (different tests on different remote machines)
-> It allows for running your tests in a distributed test execution environment.
-> Used to run your tests again multiple browsers, multiple versions of browser and browser running on different operating systems.
-> It reduces the time it take for the test suite to complete a test pass.

SELENIUM IDE:
->
If you want to create quick bug reproduction scripts or create scripts to aid in automation-aided exploratory testing, then i suggest Selenium IDE.
-> Selenium IDE is an integrated development for Selenium scripts.
-> Its an add on with Firefox.
-> It has record and playback functionality, though it can only record only on Firefox, it can be modified to run in webdriver and RC.
-> The test can be modified, assertions can be added and test suite can be created.

FEATURES OF SELENIUM IDE:
-> We can easily record and playback.
-> Intelligent field selection will use IDs, names, or xpath Locators may need.
-> It will autocomplete for all common selenium commands.
-> It used to walkthrough tests.
-> Help us to debug and set the breakpoints.
-> It saves the test output as HTML, ruby scripts or any other format.
-> It also supports for Selenium user-extension.js file.
-> Option to automatically assert the title of every page.

DO YOU KNOW WHY SELENIUM USED OVER OTHER TOOLS?
-> Selenium is the most powerful open source tool available till now.
-> It can flexible with support many programming and script languages and also highly extensible.
-> Platform support — provides support on wide range of OS compared to any other tool.
-> It also supports parallel testing and its very easy to use.
-> ALM Integration Provides integration with several bug tracking tools.

COMPARISON OF QTP OVER SELENIUM

Sample automation code in selenium:

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class selIntroduction {

public static void main(String[] args) {

//Invoking Browser

//Chrome — ChromeDriver

System.setProperty(“webdriver.chrome.driver”,”C:\\Users\\ELCOT\\Documents\\chromedriver_win32\\chromedriver.exe”);

//WebDriver.Chrome.driver->value of path

WebDriver driver = new ChromeDriver();

driver.get(“https://www.facebook.com/");

driver.findElement(By.name(“email”)).sendKeys(“gokul.123@gmail.com”);

driver.findElement(By.name(“pass”)).sendKeys(“gok123ul”);

driver.findElement(By.name(“login”)).click();

System.out.println(driver.findElement(By.cssSelector(“_9ay7”)).getText());

System.out.println(driver.getTitle());

System.out.println(driver.getCurrentUrl());

//driver.close();

•}

•}

This code may look like confuse for whose seeing these in first time but If you read my upcoming blog then you may understand this code in future.

Thank you for reading this and I bet that your time is didn’t waste and see you at my next blog.
Stay focus and stay positive.

--

--

Gokul E An aspiring software test engineer.

To become a software tester It takes a lots of knowledge of what we test and the mind set of end user, even out of the box. I am proud to be a software tester.