Selenium-1 || Understanding Selenium and Selenium WebDriver.

Selenium is a set of tools to automate the web applications. Selenium WebDriver is a powerful tool in selenium package. It helps to identify the component on a web browser, perform an action, comparing the result and generating the reports.

Selenium Packages:

Selenium Packages

Selenium is basically a package of n number of tools and utilities to make automation process easy, reliable and reusable. Majorly it contains below packages:

Selenium IDE:
  1. It stands for Selenium Integrated Development Environment.
  2. Easy to install as chrome and firefox extension.
  3. Having record and play ability.
  4. We can also edit and debug the script.
  5. Script can be converted into multiple languages.
  6. Simple commands to open URL, assert and verify titles, sending user-defined values, click on web elements.




Selenium Tutorials:

Window Handling: 

Test Frameworks: 

Related Links: 


Selenium RC:
  1. Stands for Selenium Remote Control.
  2. Supports client/server architecture.
  3. Can control any web browser on the local machine or remote machine using any programming language.
  4. Works in Multiple frameworks.
  5. Overcome the limitation of Selenium IDE and more powerful.
Selenium Grid:
  1. Extended version of Selenium RC.
  2. Runs test scripts on multiple servers at the same time using Selenium RC.
  3. Works on Hub-node concept using DesiredCapabilities and the RemoteWebDriver objects
  4. More on Selenium Grid…
Selenium WebDriver:
  1. Runs script without any client/server.
  2. Most popular automation tool in today’s world for web applications.
  3. WebDriver is an interface which would be used as a reference object for different browsers.
  4. Consist many API which provides n number of methods to play with browsers.
  5. Support multiple operating system and browsers.
  6. Supports multiple languages and frameworks.
  7. WebDriver is faster than RC as it makes a direct call to browser through browser drivers.
  8. It can’t support readily new browsers. We need to update browser drivers time to time according to the browser version.

WebDriver Architecture:

WebDriver Architecture

WebDriver has three level of communication while execution of the code as described in the above figure. Along with the WebDriver files we also need to download specific browser driver in exe form and keep the same on local system hard drive. Which can be used in the programming later.

Basic and Most powerful features of Selenium:

Selenium Features

Sample Code:

public class LaunchBrowsers {
        WebDriver driver;
        public static void main(String[] args) {
                LaunchBrowsers obj=new LaunchBrowsers();
//                obj.launchChrome();
//                obj.launchIE();
                obj.launchFirefox();
        }
        public void launchChrome()
        {
                System.setProperty("webdriver.chrome.driver","c:\\chromedriver.exe");
                driver=new ChromeDriver();
                driver.get("“http://www.allinoneblogs.com");
        }
        public void launchIE()
        {
                System.setProperty("webdriver.ie.driver","c:\\IEDriverServer.exe");
                driver=new InternetExplorerDriver();
                driver.get("“http://www.allinoneblogs.com");
        }
        public void launchFirefox()
        {
                System.setProperty("webdriver.gecko.driver","c:\\geckodriver.exe");
                driver=new FirefoxDriver();
                driver.get("“http://www.allinoneblogs.com");
        }
}

WebDriver Methods:

There are so many inbuilt methods are available to handle web browsers.

driver.navigate().back();
driver.navigate().forward();
driver.navigate().refresh();
driver.navigate().to(“http://www.allinoneblogs.com”);

Driver.close() : To close the currently active browser tab/window.
Driver.quit() : To close all the browser tabs/window associated with the WebDriver object.

4449total visits,8visits today

Leave a Reply

Your email address will not be published. Required fields are marked *