Test Automation

Asif Raihan

asifraihan21@gmail.com

@asifraihan21

What  it is?

The use of software and tools to perform the testing.

Why  we use??

In order to test 100's of high priority TC within a few hours we need test automation.

Manual tests are slow, expensive, for fast deployment, test automation is a must have.

Benefits of Testing Automation

Cheaper in a long run.

Repeatable.

Can utilize time and space better, e.g. run test automation during after office hours.

Different types of testing

requirement

smoke

usability

unit

functional

UI

integration

regression

accessibility

load

acceptance

security

Testing Tools

SoapUI

Watir

Smart Beer

Jmeter

Robotium

Selenium

Silk

HP

Egg Plant

IBM

and more.......

Selenium

Selenium is a browser based open source

software that is used for automation testing.

It supports rapid development of test automation for web base applications.

Works anywhere JavaScript is supported.

Hooks for many languages - Java, Ruby, Python.

Advantage of using Selenium

Open Source free of cost for companies.

Supports native testing for all major browser.

Customize according to the requirements.

Only tool support test cases language of choices.

Java, C#, Python, Ruby, JavaScript.

Selenium 2.0 web drivers are developed by Google and all products of Google are tested with Selenium.

Web 2.0 companies such as Facebook, Twitter, LinkedIn uses Selenium.

Selenium IDE

Selenium IDE used for Selenium tests.

Capture interaction with system and replay it

It is implemented as a Firefox extension, and allows you to record, edit, and debug tests.

Example

Type amujamu in the search box

Subimt

Works Fine :)

Selenium IDE flaws

Type amujamu in the search box

Subimt

Login not found :)

Click Login

Submit

Selenium RC

Selenium Remote Control (RC) :

Selenium RC is a test tool that allows you to write automated web application UI tests in any programming language against HTTP website using any mainstream JavaScript-enabled browser.

Selenium WebDriver

Selenium 1.0 + WebDriver = Selenium 2.0

Biggest change in Selenium recently has been inclusion of WebDriver API.

Selenium Suite

UI Testing


public static void main(String[] args) throws Exception {
		WebDriver driver;
		System.setProperty("webdriver.gecko.driver", "G:\\geckodriver.exe");
		driver = new FirefoxDriver();
		String baseURL = "http://www.google.com";
		driver.get(baseURL);

		driver.findElement(By.id("lst-ib")).sendKeys("amujamu");
		driver.findElement(By.name("btnK")).click();
		driver.findElement(By.xpath("//*[@id='rso']/div[1]/div/div/div/div/h3/a")).click();

                driver.findElement(By.linkText("Login")).click();
		driver.findElement(By.name("_username"));
		driver.findElement(By.name("_password"));
		driver.findElement(By.name("_submit")).click();
        
        }
    }

UI Testing

Integration Testing

HTTP Request
HTTP Responses

public static void main(String[] args) throws Exception {
		WebDriver driver;
		System.setProperty("webdriver.gecko.driver", "G:\\geckodriver.exe");
		driver = new FirefoxDriver();
		String baseURL = "http://www.google.com";
		driver.get(baseURL);

		driver.findElement(By.id("lst-ib")).sendKeys("amujamu");
		driver.findElement(By.name("btnK")).click();
		driver.findElement(By.xpath("//*[@id='rso']/div[1]/div/div/div/div/h3/a")).click();

                driver.findElement(By.linkText("Login")).click();
		driver.findElement(By.name("_username")).senddKeys("Asif Raihan");
		driver.findElement(By.name("_password")).senddKeys("Asif Raihan");
		driver.findElement(By.name("_submit")).click();
        
        }
    }

Integration Testing

Unit Testing

required field

password length

name length

valid email address

unique email address

Which one to use !!!

Test Pyramid

This concept was developed by Mike Cohn.

Testing should have many more low-level unit tests than high level end-to-end tests running through a GUI.

Test Pyramid

Test Automation

By Asif Raihan Ananta

Test Automation

  • 56