54
Azizeh Hasan / QA Engineer Schedule 1. About Jordanian QA community 2. Why Automation 3. Introduction to selenium. 4. Introduction to selenium IDE. 5. Introduction to selenium RC & Webdriver 6. Q/A Jordanian QA Meetup #1 When Friday 2/12/2016 Time 03:00 PM- 05:00 PM Where zinc - king Hussein Business Park Coordinator Aziza Hasan

Introduction to automated testing by Jordanian QA community

Embed Size (px)

Citation preview

Azizeh Hasan / QA Engineer

Schedule 1. About Jordanian QA community 2. Why Automation3. Introduction to selenium.4. Introduction to selenium IDE.5. Introduction to selenium RC &

Webdriver6. Q/A

Jordanian QA Meetup #1

When Friday 2/12/2016Time 03:00 PM- 05:00 PM Where zinc - king Hussein Business Park Coordinator Aziza Hasan

Azizeh Hasan / QA Engineer

Jordanian QA Community

Co-Founder : Azizeh Hasan

Azizeh Hasan / QA Engineer

Who We Are ? ● We are the first software quality assurance community

in Jordan.● Why we introduced the Idea?

○ The field of Quality assurance should have the same importance as any other software development field, it is one of the primary and main phases of the software development steps.

Azizeh Hasan / QA Engineer

Who We Are ? ● We need a community to get experience from each other

and learn from each other.● We have found that all quality assurance engineers

should stand up and show the people what the real QA is!

● The idea was born in 2015, By Azizeh Hasan Quality Assurance Engineer, implemented after the support from Fronteersjo community.

Azizeh Hasan / QA Engineer

What We Do ?

● Empower QA engineer ● Learn new testing technologies.● Get started in automation testing ● Find talent and experienced people in the QA field.● Learn from each other and share the experience.

Azizeh Hasan / QA Engineer

Automation TestingSelenium

Azizeh Hasan / QA Engineer

Audience● QA Team

● Developer Team

Azizeh Hasan / QA Engineer

Materials

● Why Automation

● Introduction to selenium.

● Introduction to selenium IDE.

● Introduction to selenium RC & Webdriver

● How to get started ?

● How to write our code ?

Azizeh Hasan / QA Engineer

Why Automation Testing ?

Testing Sucks

Buggy Features sucks more

Azizeh Hasan / QA Engineer

Type of Testing

Unit

Functional

Load

Usability

Regression

Security

Accessibility

Smoke

Requirement Acceptance

Recovery

Black box testing

White box testing

And More ….

Azizeh Hasan / QA Engineer

It will be easier to do it in

one click

Azizeh Hasan / QA Engineer

Why Consider Automation Testing?

● It’s more consistent.● It works 24 hours a day● It gives consistent result● It never miss what it was trained to test● Less expensive than manual testing● Less time

Azizeh Hasan / QA Engineer

Introduction To Selenium

Azizeh Hasan / QA Engineer

Why Selenium ?

● It’s free● It’s Open source● It has an enormous community backing it

Azizeh Hasan / QA Engineer

Big companies are using Selenium

1. Google

2. Mozilla

3. LinkedIn

Azizeh Hasan / QA EngineerAzizeh Hasan / QA Engineer

Azizeh Hasan / QA EngineerAzizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Selenium And Components

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

Selenium And ComponentsSelenium:

❖ Selenium is an open source tool that used for automation testing❖ It is licensed under Apache License 2.0❖ Selenium is suite tool that helps in automation only web applications❖ SUPPORTS multiple languages (JAVA, RUBY, Python, C#, Perl, PHP ).

Components:

❖ Selenium Integrated Development Environment IDE❖ Selenium Remote Control RC❖ Selenium WebDriver❖ Selenium Grid

Azizeh Hasan / QA Engineer

What I Can Test With Selenium❖ Web Based Application

❖ Multiple operation system➢ Windows➢ IOS

➢ Linux

❖ Multiple Browser➢ FireFox➢ Chrome➢ IE 6+➢ Safari➢ Headless Browser (Ex: PhantomJS)

Azizeh Hasan / QA Engineer

Understanding the history of Selenium❖ First was IDE

➢ Only available in FireFox browser➢ Was a record and playback type of automated test

❖ RC: Remote Control➢ Failing to handle rich API➢ Failing to handle new version of browser

■ FireFox 14, Chrome 13, Mobile support

❖ WebDriver➢ Handle all major browser➢ Handles Android ➢ Talks directly to the browser

Azizeh Hasan / QA Engineer

How Selenium Locate Elements

1. ID2. Name3. Link Text4. CSS Selector5. XPath6. And More..

Azizeh Hasan / QA Engineer

Selenium IDE

Azizeh Hasan / QA Engineer

How IDE Work?

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA EngineerAzizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

● FireFox extension that allow you to record, edit and debug test case

● Easy record and playback● Easy Debugging● Programming language experience is

not required for Selenium IDE● Convert the test to different

programming languages

● IDE is FireFox extension● Does not support error handling ● Does not support database testing● Does not support Javascript or Ajax● Does not support security testing● Does not support multiple windows ● Does not support looping condition

statement

Disadvantages Advantages

Azizeh Hasan / QA Engineer

Selenium RC & Webdriver

Azizeh Hasan / QA Engineer

What is selenium 1.0 & Selenium 2.0 ?

Azizeh Hasan / QA Engineer

Selenium 1 or Selenium Remote Control or Selenium RC● Selenium RC is a popular UI automation library● RC allowing developers and testers to automate their interactions with a

Web Application Under Test (WAUT) by● Selenium RC chose to use generic JavaScript named Selenium Core to

drive the (WAUT) on a browser.

The question is how the browser handle Javascript ?

Azizeh Hasan / QA Engineer

How Browsers handle the Javascript?

➔ For every website that is loaded on it, the browser creates a separate sandbox for the website's JavaScript.

➔ which restricts the JavaScript to be executed only on it's respective website domain.➔ This way, a JavaScript that belongs to one website doesn't execute on another website that is

currently loaded on that browser.

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

How Selenium Remote Control Work?

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

How Selenium Webdriver Work?

Azizeh Hasan / QA Engineer

Azizeh Hasan / QA Engineer

● WebDriver can simulate a real user working with a browser

● Webdriver can use any browser ● Webdriver uses more than one programming

languages [Java, ruby, php...]● Webdriver can deal with dynamic data ● Support error handling ● Support ajax and javascript● Support security testing ● Support multiple window ● Support looping condition statement

● Need a programming skills ● The program is large ● The test generate a bigger network

traffic ● Takes time and consumes system

resources● The scraping process may take longer in

comparison with making simple HTTP requests to the web server.

Disadvantages Advantages

Azizeh Hasan / QA Engineer

Selenium 2 or Selenium WebDriver

Why they have create selenium 2 ??!

1. To give a better control on the browser by implementing browser-specific implementations.

2. To give a better programming experience to the developer by adhering more closely to the object-oriented programming fundamentals.

Azizeh Hasan / QA Engineer

How to get started

Azizeh Hasan / QA Engineer

First Step In Selenium

● You have to get up ! and start searching, Make Google your best friend.

● Stop Saying my company won't help me to get started, HELP YOURSELF!

● Read Read and Read, Then start doing your first demo alone.

Azizeh Hasan / QA Engineer

Selenium IDE OR Webdriver

● To get started you should start with Selenium IDE as a base, you should do everything in IDE and then you can start working on webdriver.

● IF you have programming skills you can start with webdriver other than that you should we stick with the original plan

● Based on your project you can define the tool you want to use.

Azizeh Hasan / QA Engineer

HomeworkFirst of all you need to learn basic JAVA language

1. Go to thenewboston website.2. Watch tell the video number 41

Do research on each item:

1. Selenium IDE2. Selenium RC3. Selenium Webdriver4. How to locate element in

selenium5. Java6. Junit/TestNG/Maven 7. FireBug

Azizeh Hasan / QA Engineer

How to write our code ?

Azizeh Hasan / QA Engineer

Write Our First Class package packageName;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class Test { public static void main(String[] args){

WebDriver driver = new FirefoxDriver();

driver.get("http://www.google.com");

}}

Azizeh Hasan / QA Engineer

Let's look at each line of codepackage packageName;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class Test{

public static void main(String[] args){

WebDriver driver = new FirefoxDriver();

driver.get("http://www.google.com");

}}

Package Name

Import necessary WebDriver Classes

The class declaration

Azizeh Hasan / QA Engineer

Let's look at each line of codeWebDriver driver = new FirefoxDriver();

AND ???!!

Azizeh Hasan / QA Engineer

webdriver driver = new firefoxdriver() meaning

● WebDriver is an Interface● we are defining a reference variable(driver) whose type is

an interface● Now any object we assign to it must be an instance of a

class(FireFoxDriver) that implements the interface.

Azizeh Hasan / QA Engineer

What is interface ?

Azizeh Hasan / QA Engineer

The EndAzizeh Hasan | QA Engineer

Azizeh Hasan / QA Engineer

Q/A