[srijan wednesday webinars] choosing the right testing framework

25
Choosing the Right Testing Framework Ritesh Gurung @leeotzu

Upload: srijan-technologies

Post on 12-Aug-2015

108 views

Category:

Software


0 download

TRANSCRIPT

Choosing the Right Testing Framework

Ritesh Gurung @leeotzu

An error does not become truth by reason of multiplied propagation, nor does the truth become error because nobody will see it.

@srijan #SrijanWW

@srijan #SrijanWW

This webinar is not about :)

DISCLAIMER

@srijan #SrijanWW

How to setup testing framework.How to write features.

DISCLAIMER

@srijan #SrijanWW

Thoughts expressed and conclusion at the end, are purely based on my

personal experience.

DISCLAIMER

Agenda

● Introduction to testing Framework. ● Concepts of automated testing.● Comparing Selenium, Casperjs and

Behat.● Demo examples.● Summary.● QA

@srijan #SrijanWW

Testing frameworklUnderstanding the anatomy of skeleton

@srijan #SrijanWW

Definition

Object oriented approach to test programming needs based

on scenarios.

Testing Framework@srijan #SrijanWW

Definition

An object is responsible for single test.

Testing Framework@srijan #SrijanWW

Definition

Follows DRY principle.

Testing Framework@srijan #SrijanWW

Definition

Open for extension, but closed for modifications.

Testing Framework@srijan #SrijanWW

Definition

Defining the format, which expresses expectations.

Testing Framework@srijan #SrijanWW

Definition

Reporting the result

Testing Framework@srijan #SrijanWW

Comparing the Framework@srijan #SrijanWW

Link : http://www.seleniumhq.org/

Selenium automates browsers. That's it!

What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that.

You can also● Create robust, browser-based regression automation suites

and tests● Scale and distribute scripts across many environments

Selenium Webdriver@srijan #SrijanWW

Pros

1. It allows to automate most browser.

2. It can be integrated with BDD tools like Cucumber.

3. Large community support.

4. Runs tests in parallel across multiple machine.

Cons

1. Maintenance cost is very high.

2. It takes a while to figure out how to write a code which runs across different browser.

3. Lack of quickstart documentation for a beginer.

Selenium Webdriver@srijan #SrijanWW

Recommendation of use

1. Large team who want to test across cross-platform and cross-browser.

Selenium Webdriver@srijan #SrijanWW

Link : http://casperjs.org/

CasperJS is an open source navigation scripting & testing utility written in Javascript for the PhantomJS WebKit headless browser and SlimerJS (Gecko). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks

You can also● It helps to define and test flow.● Capturing Screenshots.● Writing functional test suites, saving results as JUnit XML

Casperjs@srijan #SrijanWW

Pros

1. Focus is on testing functionality and flow.

2. Good API documentation.

3. Quick to start.4. Light-weight and easy

to setup.

Cons

1. Debugging is difficult.

Casperjs@srijan #SrijanWW

Recommendation of use

1. Small team who wants to writes test quickly.2. Where functionality is the main focus instead of cross-

browser compatibility.

Casperjs@srijan #SrijanWW

Link : http://behat.org/

Behat is an open source behavior-driven development framework for PHP 5.3 and 5.4.

The idea is to start by writing human-readable sentences that describe a feature of your application and how it should work, and only then implement this behavior in software.

Behat@srijan #SrijanWW

Pros

1. Automate conversations you have with your stakeholders.

2. Acceptance tests.3. Good integration with

Selenium.4. Blackbox testing.5. Business users can

define the scenarios.

Cons

1. Badly written acceptance criteria will stack unnecessary code.

2. Poorly structured automated test scenario adds to execution time.

Behat@srijan #SrijanWW

Recommendation of use

If your product managers or non-developers read and run your tests, this is probably a good choice

Behat@srijan #SrijanWW

There are numerous frameworks available for automated testing, they key thing to consider are

● Your team size● Cross-browser testing needs● Comfort with various programming

languages.

Conclusion@srijan #SrijanWW

Ritesh Gurung@leeotzu

Thank You!

Take this conversation online by tweeting using the hashtag #SrijanWW