SELENIUM

What is SELENIUM ?

  • Suite of tools
  • Web application testing framework
  • Automate web browsers across many platform

SELENIUM'S

TOOL SUITE

Selenium IDE

Selenium RC

(Remote Control)

Selenium

WebDriver

Selenium Grid

Selenium RC + Selenium WebDriver = Selenium 2.0

  • create a network to connected test machine

Differences between Selenium IDE, Selenium RC and Selenium WebDriver

Features Selenium IDE Selenium RC Selenium WebDriver
Browser Mozilla All browsers All browsers
Support record & playback


Start Server
Core engine Javascript based Javascript based Interacts natively with browser application
Support to test iPhone/
Android application :



How Selenium 2.0 works ?

Test Scripts

 WebDriver

Browser

...

Selenium

WebDriver

API

  • ChromeDriver
  • IEDriver
  • GeckoDriver
  • OperaDriver
  • Appium
  • Selendroid

send request

communicate

Use Case

Technique in data extraction where you pull information from websites.

 Web Scraping

Examples :

  • Get the title of the website - getTitle
  • Get the content of the website - getText
  • Get the value from user input of the website - getValue

test.js

var webdriverio = require('webdriverio');
var options = {
    desiredCapabilities: {
        browserName: 'firefox'
    }
};
webdriverio
    .remote(options)
    .init()
    .url('http://www.google.com')
    .getTitle().then(function(title) {
        console.log('Title was: ' + title);
    })
    .end();

Output 

Functional Testing
  • Focuses only on software requirement and specification.

 

  • Only the functionality and behavior of modules are tested

 

  1. Ensure credit card information is remembered by the website.
  2. Go to the product 123.
  3. Add it to cart.
  4. Go to cart.
  5. One-click purchase.
  6. Repeat 2-5, entire test should take l< 10 seconds.
  7. Ensure the last step fails and the user is informed that:
  • The purchase was not made because there is a risk of mistake from the user,
  • The IP address was saved in case of abuse,
  • The e-mail was sent to inform the user about the risk of abuse,
  • The credit card was not debited.

A functional test such as:

Differences between Selenium 2.0, Phantomjs and Nightmarejs

Features Selenium 2.0 Phantomjs Nightmarejs
Supported Language All All(via Selenium)
    JavaScript
About Suite of tools to automate web browsers across many platforms. Headless WebKit scriptable with a JavaScript API.
 
High-level browser automation library 
Headless browser ​✔ ​✔
Scrapping  ​✔ ​✔ ​✔

The End

-THANK YOU-

Selenium

By nur amirah

Selenium

  • 245