Creating a Large Scale Selenium Automation ... - QA Southwest

possehastyΜηχανική

5 Νοε 2013 (πριν από 3 χρόνια και 7 μήνες)

117 εμφανίσεις

Creating a Large Scale Selenium Automation
Environment




Welcome

Creating a Large Scale Selenium Automation
Environment

Tom Gilmore

Open Source Consultant

info@creativeopensource.com

Creating a Large Scale Selenium Automation
Environment

Agenda



Differences between Selenium Products



Differences between Open Source products like Selenium and



Commercial Tools



Understanding the Merger of the Open Source and Agile Communities



Dispelling False Information about Selenium



Overview of the pieces that make up a large scale
Selenium


environment



Explaining
the Page Object
Methodology



Elements
of a large scale Selenium Environment


Resource Bundle
,



Config

File
, BaseSelenium, Page Parent, Page Objects, Test Suites
and



Tests


Creating a Large Scale Selenium Automation
Environment

Agenda



Why
the Page Object

Methodology Works
best in an Agile



Environment



Determining
how and what to

A
utomate



Doing
an

Assessment
of your

Team
and why its

I
mportant



Tips
and

Tricks
to

Creating Robust
Selenium

Test
C
ases



Integrating
Selenium with Sikuli, JDBC and
Puppeteer



Running
Selenium in a CI

Environment
with Maven and
Jenkins



Selenium Demo

Creating a Large Scale Selenium Automation
Environment

Differences between Selenium Products



Selenium IDE


a Firefox extension with record / playback
functionality



Selenium Core


The main Component of Selenium



Selenium RC


a scripting layer over Selenium Core


WebDriver


Selenium
-
WebDriver



Creating a Large Scale Selenium Automation
Environment

Differences between Open Source products like
Selenium and Commercial Tools



QTP is not cross platform



QTP costs a lot of money



QTP needs VBScript, Selenium has lots of language
bindings



QTP can control other types of applications other then
web


Creating a Large Scale Selenium Automation
Environment

Understanding the Merger of the Open Source and
Agile Communities



The move to Agile has seen the rise of the term, test
-
infected developers



Test
-
Driven and Behavior
-
Driven Agile processes required
different tool sets



Most Open Source practitioners are also Agile
Practitioners



Need to improve Agile processes


Creating a Large Scale Selenium Automation
Environment

Dispelling False Information about Selenium








You have to be a programmer to use Selenium


False!!!

Creating a Large Scale Selenium Automation
Environment





Test.config

Resource
Bundle/IMGS

BaseSelenium

PageParent

Maven/STS

Page Objects

Test Suites

Test Cases

Creating a Large Scale Selenium Automation
Environment

Explaining the Page Object Methodology



Within your web app's UI there are areas that your tests interact
with
. A
Page Object simply models these as objects within the test
code. This reduces the amount of duplicated code and means that if
the UI changes, the fix need only be applied in one
place.



PageObjects can
be thought of as facing in two directions
simultaneously. Facing towards the developer of a test, they
represent the services offered by a particular page. Facing away
from the developer, they should be the only thing that has a deep
knowledge of the structure of the HTML of a page


Creating a Large Scale Selenium Automation
Environment

Explaining the Page Object Methodology



PageObject should return
other PageObjects



Simply put we are abstracting the code to the PageObject and
away from the tests



PageObject’s work well in a Behavior
-
Driven or Test
-
Driven
environment

Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




BaseSelenium


Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




Test.config


Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




Resource Bundle


Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




PageParent


Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




PageObjects


Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




Tests


Creating a Large Scale Selenium Automation
Environment

Elements of a large scale Selenium Environment


Resource Bundle, Config File, BaseSelenium, Page
Parent, Page Objects, Test Suites and Tests




Test Suites


Creating a Large Scale Selenium Automation
Environment

Why the Page Object Methodology Works best in
an Agile Environment



Behavior
-
Driven Development uses an Outside
-
in approach


create mockups or wireframes of the UI first



With PageObjects you can create the Pages and Test cases at the
beginning of a sprint even before you get any code



Record and Playback Automation tools CAN NOT do this




Creating a Large Scale Selenium Automation
Environment

Determining how and what to Automate



Map out your application


create your PageObjects



Automate Acceptance Criteria



Automate Defects


80/20 rule



Smoke Test


basic pass through of the application



Assert Phases


Requires stabilized data



All Repetitive Tests


EULA’s, About Pages, Help Pages, etc.



Code Coverage




Creating a Large Scale Selenium Automation
Environment

Doing an Assessment of your Team and why its
Important



Determine who will be doing automation



Assess the skill level of the individuals who will be doing
automation



Consult with development and configuration management to
determine their tools sets



Creating a Large Scale Selenium Automation
Environment

Tips and Tricks to Creating Robust Selenium Test
Cases



Encapsulate your tests


JUnit doesn’t always run tests in order



Don’t write dependant tests



Bug your developers to use Id’s and Names on elements



Use the Resource Bundle to do Data Driven testing



Do not hard code data in your methods



Use Implicit waits, not explicit waits



Add debugging to your selenium architecture

Creating a Large Scale Selenium Automation
Environment

Integrating Selenium with Sikuli, JDBC and
Puppeteer



Sikuli


used for anything that can’t be handled by WebDriver



JDBC


Used in Selenium tests to do backend validation and
incrementing data



Puppeteer


Used by UI developers to do Javascript Unit testing,
driven by WebDriver

Creating a Large Scale Selenium Automation
Environment

Running Selenium in a CI Environment with Maven
and Jenkins

Nexus

Jenkins

Maven

SVN

IE VM

Chrome

Firefox

Creating a Large Scale Selenium Automation
Environment

Selenium Demo

Creating a Large Scale Selenium Automation
Environment

Creating a Large Scale Selenium Automation
Environment

Phoenix Area Selenium Users Group




Free to join


simply go to meetup.com



Monthly meeting
covering all things Open Source

Creating a Large Scale Selenium Automation
Environment




Questions?