Introduction to Selenium Based...

Post on 23-May-2020

9 views 0 download

Transcript of Introduction to Selenium Based...

|

Introduction to Selenium Based Automation Presented by Brian Rock August 29, 2012

| 2

1. What is Selenium?

2. Selenium IDE

3. Two Demos of Selenium IDE

4. Selenium WebDriver

5. Quick Demo of Selenium WebDriver (Java)

6. An overview of the Page Object Framework

7. Wrap Up & Questions

Agenda

The Challenge

| | 3

What is Selenium?

|

What is Selenium?

4

• Automation API

– Selenium is a full featured automation framework for rapid

development of test automation in various languages.

• Automation IDE

– Selenium is an open source record and playbook tool for creating

on the fly automated test scripts. Very useful in exploratory testing.

• Automation Grid

– Selenium Grid is an automation framework upon which, many

permutations of tests can be executed in a multi-threaded env.

The Challenge

| | 5

Selenium IDE

|

Selenium IDE

6

• Selenium IDE

– Selenium IDE is a plug-in to Firefox to record and playback tests

– Includes an integrated right click menu for Firefox to record

advanced commands (asserts, waits, …)

– Recorded tests can be exported in several languages e.g. HTML,

Java , .NET , Perl , Ruby etc.

– Tests can then be integrated into a larger framework

– Very useful for bug reproduction and exploratory testing

The Challenge

| | 7

Demo of Selenium IDE

|

Demo of Selenium IDE

• Demo 1 :

– Create a Recorded test and execute with Selenium IDE

• Demo 2 :

– Convert Recorded testing into a Ruby::Test script and execute

8

The Challenge

| | 9

Selenium WebDriver

|

Selenium WebDriver

10

• Selenium WebDriver

– Selenium WebDriver is a collection of language specific APIs that

drive a browser

– This is the successor to Selenium RC which is now deprecated

– The following languages are supported

- Java, C#, Php, Ruby, Perl, and Python

– Selenium WebDriver designed to handle dynamic pages consisting

of Ajax requests

|

Selenium WebDriver

• Java Example

– Setup simple Java Maven Project using eclipse

– Setup Maven Selenium Dependency (and others as needed)

– Setup typical Page Object Pattern folder structure

– Start writing tests

• DEMO – Eclipse Example

11

The Challenge

| | 12

Page Object Pattern

|

Selenium WebDriver

13

• Page Object Pattern

– A simple design pattern that models each page (or page chunk) as

a class object that other classes / objects can interact with

– A very common pattern for implementing a automation framework

using selenium web driver

– Classes representing pages/chunks should provide the services

that a user would execute on the page

– They should not expose the underlying web driver instance

The Challenge

| | 14

Advanced Frameworks

|

Advanced Automation Frameworks

• Spredfast’s Automation Framework

– 800+ Automated Functional Scenarios

– Written using

- Selenium WebDriver

- Java

- Junit

- A page object pattern

– Executed using Jenkins and a battery of remote client machines on

AWS

– Results both logged to a mysql database for advanced reporting

and integrated directly into the Test Case Management System

– Since implementation (18 months ago) has executed more then

450k scenarios supporting test efforts across 15+ release

– A KEY contributor to the overall quality effort of the company

15

The Challenge

| | 16

Thank You

Questions?