Selenium Camp 2012

26
Anatoly Zhukov [email protected] Yan Alexeenko [email protected] Designing Automation Framework for Web Applications Testing through TDD

description

Designing Automation Framework for Web Applications Testing through TDD

Transcript of Selenium Camp 2012

Page 1: Selenium Camp 2012

• Anatoly Zhukov [email protected]

• Yan Alexeenko [email protected]

Designing Automation Framework for Web Applications

Testing through TDD

Page 2: Selenium Camp 2012

About Us

2

Yan Alexeenko - Senior QA Engineer• 4+ years of experience• Expert in desktop/web manual/automation testing• Expert in performance testing• Expert in testing of signal processing algorithms • Test framework developer

Anatoly Zhukov - Senior QA Engineer.• 3+ years of experience• Expert in desktop/web manual/automation testing• Expert in performance testing• Test framework developer• Active participation in software-testing.ru community

Page 3: Selenium Camp 2012

About GGA Software Services

3

200-Person Software Engineering Team:• Business Analysis• System Design• Software Engineering• Software Testing• Documentation• Training• Project Management• Quality Assurance

GGA’s high-throughput screening application won a global innovation award at a leading pharmaceutical company.

Data

SupportScience

Software

Quality Assured• Independent team for testing

and quality assurance• 70 professionally trained quality

engineers• Domain experts in scientific

disciplines and software/IT technical skills• QA services available to assist

client’s internal development teams

Page 4: Selenium Camp 2012

Presentation Plan

4

Objectives

Development Problems

Problems Resolving

Techniques & Technologies

Object Patterns

Reporting

Results

Page 5: Selenium Camp 2012

Our Objectives

Flexible

Convenient

Scale

Functional

Fast

5

Page 6: Selenium Camp 2012

6

Development Scheme

Customer

I want to…

Developer

Manager

My vision

of it is…I believe he wants…

Page 7: Selenium Camp 2012

Development Problems

7

Page 8: Selenium Camp 2012

What’s doing?

Customer

8

Page 9: Selenium Camp 2012

In our case

9

I know what I want…

I know how to do it…

Page 10: Selenium Camp 2012

TDD

Build manager

Continuous Integration

Simple Object Pattern

Simple Result Analysis

10

We want…

Page 11: Selenium Camp 2012

Java

Selenium 2 (aka WebDriver)

TestNG

AutoIT

11

We use…

Page 12: Selenium Camp 2012

Test Driven Development

12

The mantra of Test-Driven Development (TDD) is “red, green, refactor”

Make the code work

Eliminate redundancy

Write a test that fails

Write a test script code that can’t be compiled

Page 13: Selenium Camp 2012

Maven

Maven is a software project management and

comprehension tool

Maven is a site and documentation tool

Maven extends Ant to let you download dependencies

Maven is a set of reusable Ant scripts

What is wrong with Maven? – Access to repository.

13

Page 14: Selenium Camp 2012

Object Description

14

Panel – div that contains simple controls

Controls – Links, Buttons, Inputs, etc.

Page 15: Selenium Camp 2012

Object Description

15

<div id=“subpanel1_3” class=“…” style=“…”>

<input id=“pageNumberInput” … >

Page 16: Selenium Camp 2012

Code of Test

16

Panel.get().action().control

.controlAction().[action()/control]…;

Singleton

Return Panel instance

Page 17: Selenium Camp 2012

Example

17

ControlPane.get().open().page.click().fullScreen.click().close();

public class ControlPane extends BasePanel<ControlPane>…

public final Button<ControlPane> page = new Button<ControlPane>("Name", "Locator", this);

Generic

Page 18: Selenium Camp 2012

Using Standard Maven Layout &

ResourceBundle

18

Properties for Panels & Controls

ControlName = [id/xpath/css]=[locator]

Properties like

Page 19: Selenium Camp 2012

Reporting

Simple & Dynamic Creation

Style Customization

Easy for Use

• Visualization (Levels, Links to source code, Screenshots,

Asserts and Exceptions)

• Traceability

HTML 19

Page 20: Selenium Camp 2012

Reporting Process

20

HTMLCSSJS

jquery.load()

Message 1

Log File

Message 2

Message 3

Page 21: Selenium Camp 2012

Jenkins Tasks

21

Maven Goals & Options

-Dtestng_xml=[Config File].xml clean test

clean compile -DskipTests javadoc:aggregate

Page 22: Selenium Camp 2012

Reporting Example

22

business level

component level

technical level

asserts

Page 23: Selenium Camp 2012

Java Docs

23

Page 24: Selenium Camp 2012

Convenient test writing framework

Flexible and extendable system

Simple and clear reports

Continuous Integration

Documented source code

Satisfied customer

24

Results

Page 25: Selenium Camp 2012

Code Lifecycle

Test Script

ComponentsBase Functionality for testing

? ?

?

Controls

Selenium Web Driver

Reporter API

Unit testing Web Services

UI testing

25

Page 26: Selenium Camp 2012

26

Questions?