+ All Categories
Home > Documents > Introduction to Selenium Based...

Introduction to Selenium Based...

Date post: 23-May-2020
Category:
Upload: others
View: 8 times
Download: 0 times
Share this document with a friend
16
| Introduction to Selenium Based Automation Presented by Brian Rock August 29, 2012
Transcript
Page 1: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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

Page 2: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

| 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

Page 3: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 3

What is Selenium?

Page 4: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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.

Page 5: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 5

Selenium IDE

Page 6: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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

Page 7: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 7

Demo of Selenium IDE

Page 8: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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

Page 9: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 9

Selenium WebDriver

Page 10: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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

Page 11: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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

Page 12: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 12

Page Object Pattern

Page 13: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design 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

Page 14: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 14

Advanced Frameworks

Page 15: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

|

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

Page 16: Introduction to Selenium Based Automation9c621068b13bf89a447f-3509c2ef67cbbed054ed3fe7b9d39310.r28.c… · Selenium WebDriver 13 • Page Object Pattern –A simple design pattern

The Challenge

| | 16

Thank You

Questions?


Recommended