Automated tests:
How to increase his power
@dani_qa
2
Summary
Manual tests Selenium IDE Selenium
Webdriver
SWD+Gherkin SWD+Behave+POM Behave utilities
3
Manual tests
Advantages
▸Less time
▸Human intuition
▸Coverage
▸Learn
▸Changes
Disadvantages
▸GUI testing
▸Regression
▸Performance
▸Human mistakes
▸Compare data
4
What is
this?
5
Selenium IDE
Advantages
▸Easy
▸Flexible
▸Convert
▸Devel knowledge
▸Changes
Disadvantages
▸Firefox
▸Not ‘for’, not ‘if’
▸Manage errors
▸External files
▸Not DB
▸Mobiles
6
What is
this?
7
Selenium
Webdriver
Advantages
▸Open source
▸Flexibility
▸Plugins/Libraries
▸Grid
▸CI (Jenkins)
Disadvantages
▸Asset knowledge
▸Time
▸Web apps
▸Compatibility
▸Documentation
What is
Gherkin?
8
Gherkin serves two purposes:
- Documentation
- Automated tests
9
Are we
vegetarians?
10
How it works?
Feature: showing off behave
Scenario: run a simple test
Given we have behave installed
When we press button
Then behave will test it for us!
from behave import *
@given('we have behave
installed')
def step_impl(context):
pass
@when('we click button')
def step_impl(context, element):
click_button()
@then('behave will test it for us!')
def step_impl(context):
assert context.failed is False
11
SWD + Behave
Advantages
▸Human language
▸A.C.
▸Visibility
▸Documentation
Disadvantages
▸Time
▸Education
▸Business knowledge
▸Maintenance
12
How it works?
Feature: showing off behave
Scenario: run a simple test
Given we have behave installed
When we press “test” button
Then behave will test it for us!
from behave import *
@given('we have behave
installed')
def step_impl(context):
pass
@when('we click “element”
button')
def step_impl(context, element):
context.click_button(element)
@then('behave will test it for us!')
def step_impl(context):
assert context.failed is False
Class MenuPage(BasePage):
def click_button(element):
driver.findElement(By.cssSelector(
element))
13
SWD + Behave
+ PageObject
Advantages
▸Low maintenance
▸Object repository
▸Friendly
▸Low redundancy
▸Scalable
Disadvantages
▸Initial effort
▸Visibility
Outlines
▸Redundancy
▸Data set
14
Behave utilities
Background
▸Preconditions
▸Redundancy
▸Bulk data
Tags
▸Parallelization
▸Prioritization
▸Debug
“First do it, then
do it right, then do
it better.”
15
16
Show me
the code
“If you automate
chaos, all you get
is faster chaos.”
17
18
Avoid this
19
What is next
level?
Happy path scenarios?
Regression tests?
Time execution?
Priorities?
https://www.meetup.com/es/malaga-python/ https://www.meetup.com/es/agile-malaga/
Buddies Meetups
Any question?

Automated test: How to increase his power