Introduction to Test Automation

Pekka Klärck
Pekka KlärckAgile tester, consultant, and lead developer of Robot Framework em Eliga
An introduction to

                   Test Automation




© Copyright Pekka Klärck <peke@eliga.fi>
Creative Commons Attribution 3.0 License
Scope
●   Dynamic vs. static
●   Functional vs. non-functional
●   Acceptance vs. unit (vs. module vs. integration)
●   Frameworks vs. drivers
●   Running tests vs. generating tests
●   Full scale automation vs. helping manual
    testing
●   Test execution vs. test management
Different scripting approaches
●   Record and playback
●   Linear scripting
●   Modular scripting
●   Data-driven testing
●   Keyword-driven testing
Record and playback
●   Capture interaction with system and replay it
●   Popular approach among commercial tools
Record and playback: Example




Selenium IDE
Record and playback: Benefits
●   Very easy and fast to create initially
●   No programming skills needed
Record and playback: Problems
●   Does not test anything unless checkpoints added
●   Very fragile
    ●   Often single change in UI can break all tests
●   Hard to maintain
    ●   Plenty of separate test scripts
    ●   No modularity or reuse
●   System must be ready before automation can start
    ●   Does not support acceptance test driven development (ATDD)
Record and playback: Summary
●   Seldom a good approach in general
●   Never a good basis for large scale automation
Linear scripting
●   Non-structured scripts interact directly with the
    system under test (SUT)
●   Can use any programming language
●   Also produced by capture and replay tools
Linear scripting: Example




Selenium RC Python API
Linear scripting: Benefits
●   Fast to create initially
●   Flexible
●   Can use common scripting languages
    ●   No license costs
Linear scripting: Problems
●   Creating tests requires programming skills
●   Very fragile
    ●   One change in the system may break all scripts
●   Hard to maintain
    ●   Plenty of test scripts
    ●   No modularity or reuse
Linear scripting: Summary
●   Adequate for simple tasks
●   Never a good basis for large scale automation
Modular scripting
●   Driver scripts “drive” test execution
●   Interaction with the SUT done by functions in a
    test library
Modular scripting: Example
                 ← Test library

                 ↓ Driver script
Modular scripting: Benefits
●   Reuse of code
    ●   Creating new tests gets faster
●   Maintainability
    ●   Changes require fixes in smaller areas
●   Driver scripts are simple
    ●   Even novice programmers can understand and edit
    ●   Creating new ones is not hard either
Modular scripting: Problems
●   Building test library requires initial effort
    ●   Takes time
    ●   Requires programming skills
●   Test data embedded into scripts
    ●   Requires some understanding of programming
●   New tests require new driver scripts
Modular scripting: Summary
●   Good for simple tasks
●   Works also in larger usage if everyone who
    needs to understand tests can program
●   Not good for non-programmers
Data-driven testing
●   Test data taken out of test scripts
    ●   Customarily presented in tabular format
●   One driver script can execute multiple similar tests
●   New driver script still needed for different kinds of tests
Data-driven testing: Example
Data-driven testing: Benefits
●   Test libraries provide modularity
    ●   Same benefits as with modular scripting
●   Creating and editing existing tests is very easy
    ●   No programming skills needed
●   Maintenance responsibilities can be divided
    ●   Testers are responsible for the test data
    ●   Programmers are responsible for automation code
Data-driven testing: Problems
●   Test cases are similar
    ●   For example '1 + 2 = 3' and '1 * 2 = 2'
●   New kinds of tests need new driver script
    ●   For example '1 * 2 + 3 = 6'
    ●   Creating driver scripts requires programming skills
●   Initial effort creating parsers and other reusable
    components can be big
Data-driven testing: Summary
●   Good solution even for larger scale use
●   New kinds of tests requiring programming is a
    minus
●   May be an overkill for simple needs
Keyword-driven testing
●   Not only test data but also directives (keywords)
    telling how to use the data taken out of the test
    scripts
●   Keywords and the test data associated with them
    drive test execution
Keyword-driven testing: Example




Robot Framework syntax from SeleniumLibrary demo:
http://bit.ly/rf-web-test-demo
Keyword-driven testing: Benefits
●   All same benefits as with data-driven testing
    ●   Non-programmers can create and edit tests
    ●   Separation of test data and code
●   Tests can be constructed freely from keywords
    ●   Non-programmers can create also new kinds of tests
    ●   With suitable keywords also data-driven tests possible
●   All tests can be executed by one framework
    ●   No need to create and maintain separate driver scripts
Keyword-driven testing: Problems
●   Initial effort can be really big
    ●   But there are open source solutions available!
Keyword-driven testing: Summary
●   Very good solution for large scale use
●   Use existing solutions if you can
●   May be an overkill for simple needs
Interacting with the SUT
●   Testability
●   Testing through GUI
●   Testing below GUI
●   Other interfaces
Testability
●   The hardest part of automation is interacting
    with the system under test
    ●   Especially hard with GUIs
    ●   Programming APIs are easiest
●   Important to make the system easy to test
●   Some common guidelines
    ●   Add identifiers to GUI widgets
    ●   Textual outputs should be easy to parse
    ●   Consider providing automation interfaces
Testing through GUI
●   Same interface as normal users use
●   Can be technically challenging or impossible
    ●   Not all GUI technologies have good tools available
●   Often fragile tests
●   Often relative slow to execute
●   Good approach to use when feasible
Testing below GUI
●   Automating through business layer often easy
●   Tests typically run very fast
●   But you still need to test the GUI
    ●   Test the GUI is wired correctly to the business logic
    ●   GUIs always have some functionality of their own
●   Pragmatic hybrid solution:
    ●   Test overall functionality below the GUI
    ●   Some end-to-end tests through the GUI—not
        necessarily even automated
Other interfaces
●   Not all systems have a GUI
●   Many systems have multiple interfaces
    ●   Programming APIs, databases, server interfaces,
        command line, …
    ●   Automation framework which can utilize different
        drivers works well in these situations
●   Non-GUI interfaces generally easy to automate
    ●   Most of them targeted for machines
    ●   Test library is just another client
When to automate and by whom?
●   After development by separate team
●   During development collaboratively
Automation after development
●   Often by different team
    ●   In worst case on a different floor, building, or continent
    ●   Communication problems
●   Typical in waterfall-ish projects
●   Slow feedback loop
●   Testability problems can be show stoppers
    ●   Often hard to get testability hooks added afterwards
    ●   May need to resort to complicated and fragile solutions
Collaborative automation
●   Automation considered an integral part of
    development
    ●   Collaboration between testers and programmers
●   Typical in Agile projects
    ●   In acceptance test driven development (ATDD)
        automation started before implementation
●   Testability normally not a problem
    ●   Programmers can create testability hooks
    ●   Testability and available tooling can be taken into
        account even with technology decisions
Supporting practices
●   Version control
●   Continuous integration
Version control
●   Test data and code should be stored the same
    way as production code
●   Recommended to store tests with the
    production code
    ●   Easy to get an old version of the software with
        related tests
●   Lot of great open source alternatives available
    ●   Subversion, Git, Mercurial, …
    ●   No excuse not to use
Continuous integration
●   Key to full scale automation
●   Tests are run automatically when
    ●   New tests are added
    ●   Code is changed
●   Can also have scheduled test runs
    ●   Useful if running all tests takes time
●   Great open source solutions available
    ●   Jenkins/Hudson, Cruise Control, BuildBot, …
    ●   Custom scripts and cron jobs can be retired
Available tools
●   Commercial
●   Open source
●   Freeware
Commercial tools
●   Good ones tend to be expensive
    ●   But not all expensive are good
    ●   Even cheap licenses can prevent full team collaboration
●   Often hard to integrate with
    ●   Other automation tools (especially from other vendors)
    ●   Version control and continuous integration
●   Hard or impossible to customize
●   Risk of product or company discontinuation
Open source tools
●   Large variety
    ●   Some are great—others not so
●   Normally easy to integrate with other tools
●   Free, as in beer, is good
    ●   Everyone can use freely
●   Free, as in speech, is good
    ●   Can be customize freely
    ●   Can never really die
Freeware tools
●   Getting rare nowadays
    ●   Most free tools are also open source
●   No license costs
●   Tend to be easier to integrate with other tools
    than commercial
●   Hard or impossible to customize
●   Risk of discontinuation
Generic skills to learn
●   Scripting languages
    ●   Python, Ruby, Perl, Javascript, ...
●   Regular expressions
    ●   A must when parsing textual outputs
●   XPath and CSS selectors
    ●   A must when doing web testing
●   SQL
    ●   A must with databases
●   Using version control
Is manual testing still needed?
●   YES!!
●   Avoid scripted manual testing
    ●   Automate it instead
●   Concentrate on exploratory testing
    ●   Machines are great for running regression tests
    ●   Humans are great for finding new defects
Questions?
                             Thanks!



© Copyright Pekka Klärck <peke@eliga.fi>
Creative Commons Attribution 3.0 License
1 de 46

Recomendados

Test automation por
Test automationTest automation
Test automationXavier Yin
1.4K visualizações24 slides
Selenium test automation por
Selenium test automationSelenium test automation
Selenium test automationSrikanth Vuriti
2.1K visualizações20 slides
Introduction to Software Test Automation por
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test AutomationAmr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
15.6K visualizações113 slides
Introduction to selenium por
Introduction to seleniumIntroduction to selenium
Introduction to seleniumArchana Krushnan
7.1K visualizações21 slides
Test Automation - Keytorc Approach por
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Keytorc Software Testing Services
2.8K visualizações22 slides
Robot Framework Introduction por
Robot Framework IntroductionRobot Framework Introduction
Robot Framework IntroductionPekka Klärck
226.5K visualizações16 slides

Mais conteúdo relacionado

Mais procurados

Automation With A Tool Demo por
Automation With A Tool DemoAutomation With A Tool Demo
Automation With A Tool DemoNivetha Padmanaban
4.5K visualizações11 slides
Automation Testing por
Automation TestingAutomation Testing
Automation TestingSun Technlogies
1.7K visualizações8 slides
Introduction to Selenium Web Driver por
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web DriverReturn on Intelligence
48.8K visualizações30 slides
Test Automation por
Test AutomationTest Automation
Test Automationnikos batsios
4.2K visualizações23 slides
Test Automation Framework Development Introduction por
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka Yashantha
1.2K visualizações27 slides
Introduction to Automation Testing por
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation TestingArchana Krushnan
1K visualizações15 slides

Mais procurados(20)

Automation With A Tool Demo por Nivetha Padmanaban
Automation With A Tool DemoAutomation With A Tool Demo
Automation With A Tool Demo
Nivetha Padmanaban4.5K visualizações
Automation Testing por Sun Technlogies
Automation TestingAutomation Testing
Automation Testing
Sun Technlogies1.7K visualizações
Introduction to Selenium Web Driver por Return on Intelligence
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
Return on Intelligence48.8K visualizações
Test Automation por nikos batsios
Test AutomationTest Automation
Test Automation
nikos batsios4.2K visualizações
Test Automation Framework Development Introduction por Ganuka Yashantha
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
Ganuka Yashantha1.2K visualizações
Introduction to Automation Testing por Archana Krushnan
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
Archana Krushnan1K visualizações
Test Automation and Selenium por Karapet Sarkisyan
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
Karapet Sarkisyan2.4K visualizações
Test Automation Tool comparison – HP UFT/QTP vs. Selenium por Aspire Systems
Test Automation Tool comparison –  HP UFT/QTP vs. SeleniumTest Automation Tool comparison –  HP UFT/QTP vs. Selenium
Test Automation Tool comparison – HP UFT/QTP vs. Selenium
Aspire Systems4.6K visualizações
Test Automation Framework Design | www.idexcel.com por Idexcel Technologies
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.com
Idexcel Technologies11.8K visualizações
Test Automation por rockoder
Test AutomationTest Automation
Test Automation
rockoder9.5K visualizações
Developing a test automation strategy by Brian Bayer por QA or the Highway
Developing a test automation strategy by Brian BayerDeveloping a test automation strategy by Brian Bayer
Developing a test automation strategy by Brian Bayer
QA or the Highway1.2K visualizações
Selenium with Cucumber por Knoldus Inc.
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
Knoldus Inc.518 visualizações
Automated Testing with Agile por Ken McCorkell
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
Ken McCorkell5.8K visualizações
Introduction to Automation Testing por Archana Krushnan
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
Archana Krushnan8.6K visualizações
Automation Framework Presentation por Ben Ngo
Automation Framework PresentationAutomation Framework Presentation
Automation Framework Presentation
Ben Ngo367 visualizações
6 Ways to Measure the ROI of Automated Testing por SmartBear
6 Ways to Measure the ROI of Automated Testing6 Ways to Measure the ROI of Automated Testing
6 Ways to Measure the ROI of Automated Testing
SmartBear3.9K visualizações
Selenium ppt por Aneesh Rangarajan
Selenium pptSelenium ppt
Selenium ppt
Aneesh Rangarajan2.4K visualizações
Test Automation Best Practices (with SOA test approach) por Leonard Fingerman
Test Automation Best Practices (with SOA test approach)Test Automation Best Practices (with SOA test approach)
Test Automation Best Practices (with SOA test approach)
Leonard Fingerman21.1K visualizações
Test automation workshop slideset por Towo Toivola
Test automation workshop slidesetTest automation workshop slideset
Test automation workshop slideset
Towo Toivola387 visualizações
Présentation de Robot framework por gilleslenfant
Présentation de Robot frameworkPrésentation de Robot framework
Présentation de Robot framework
gilleslenfant4.8K visualizações

Destaque

Selenium ppt por
Selenium pptSelenium ppt
Selenium pptAnirudh Raja
8.1K visualizações18 slides
Automated Testing por
Automated TestingAutomated Testing
Automated TestingJohn Paulett
14.8K visualizações44 slides
Test automation process por
Test automation processTest automation process
Test automation processBharathi Krishnamurthi
25.9K visualizações28 slides
Introduction to Gauge por
Introduction to GaugeIntroduction to Gauge
Introduction to Gaugevodqancr
1.3K visualizações15 slides
Create the Future - Innovations in Testing por
Create the Future - Innovations in TestingCreate the Future - Innovations in Testing
Create the Future - Innovations in TestingAnand Bagmar
1.5K visualizações62 slides
Automation testing introduction for FujiNet por
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNetHai Tran Son
1.3K visualizações23 slides

Destaque(19)

Selenium ppt por Anirudh Raja
Selenium pptSelenium ppt
Selenium ppt
Anirudh Raja8.1K visualizações
Automated Testing por John Paulett
Automated TestingAutomated Testing
Automated Testing
John Paulett14.8K visualizações
Introduction to Gauge por vodqancr
Introduction to GaugeIntroduction to Gauge
Introduction to Gauge
vodqancr1.3K visualizações
Create the Future - Innovations in Testing por Anand Bagmar
Create the Future - Innovations in TestingCreate the Future - Innovations in Testing
Create the Future - Innovations in Testing
Anand Bagmar1.5K visualizações
Automation testing introduction for FujiNet por Hai Tran Son
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
Hai Tran Son1.3K visualizações
Automation Frame works Instruction Sheet por vodQA
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
vodQA635 visualizações
Automated Testing vs Manual Testing por Directi Group
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
Directi Group33.4K visualizações
ICT for Automotive Industry por Interlatin
ICT for Automotive IndustryICT for Automotive Industry
ICT for Automotive Industry
Interlatin5.1K visualizações
Learning's from mobile testing por Vikrant Chauhan
Learning's from mobile testingLearning's from mobile testing
Learning's from mobile testing
Vikrant Chauhan1.4K visualizações
13 Test Automation Practices You Should be Afraid Of por Joe Colantonio
13 Test Automation Practices You Should be Afraid Of13 Test Automation Practices You Should be Afraid Of
13 Test Automation Practices You Should be Afraid Of
Joe Colantonio3.5K visualizações
Arjuna - Reinventing the Test Automation Wheels por Rahul Verma
Arjuna - Reinventing the Test Automation WheelsArjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation Wheels
Rahul Verma2.6K visualizações
Tw specifications for-testing1 por ThoughtWorks Studios
Tw specifications for-testing1Tw specifications for-testing1
Tw specifications for-testing1
ThoughtWorks Studios1.2K visualizações
Specifications test automation pyramid public por Sathyan Sethumadhavan
Specifications test automation pyramid   publicSpecifications test automation pyramid   public
Specifications test automation pyramid public
Sathyan Sethumadhavan3.1K visualizações
Say NO To (More) Selenium Tests por Anand Bagmar
Say NO To (More) Selenium TestsSay NO To (More) Selenium Tests
Say NO To (More) Selenium Tests
Anand Bagmar4.8K visualizações
Need for automation testing por 99tests
Need for automation testingNeed for automation testing
Need for automation testing
99tests947 visualizações
Test Automation - Principles and Practices por Anand Bagmar
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
Anand Bagmar82.6K visualizações

Similar a Introduction to Test Automation

High Performance Software Engineering Teams por
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering TeamsLars Thorup
6.1K visualizações19 slides
Unit testing (eng) por
Unit testing (eng)Unit testing (eng)
Unit testing (eng)Anatoliy Okhotnikov
1.3K visualizações35 slides
Practical Software Testing Tools por
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing ToolsDr Ganesh Iyer
2K visualizações83 slides
Test automation - Building effective solutions por
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutionsArtem Nagornyi
1.9K visualizações23 slides
Open Source Jumpstart Tooling Up Intro por
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroSkills Matter
546 visualizações34 slides
Test Driven Development with PHP por
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHPRogério Vicente
2K visualizações16 slides

Similar a Introduction to Test Automation(20)

High Performance Software Engineering Teams por Lars Thorup
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
Lars Thorup6.1K visualizações
Unit testing (eng) por Anatoliy Okhotnikov
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
Anatoliy Okhotnikov1.3K visualizações
Practical Software Testing Tools por Dr Ganesh Iyer
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
Dr Ganesh Iyer2K visualizações
Test automation - Building effective solutions por Artem Nagornyi
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutions
Artem Nagornyi1.9K visualizações
Open Source Jumpstart Tooling Up Intro por Skills Matter
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up Intro
Skills Matter546 visualizações
Test Driven Development with PHP por Rogério Vicente
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
Rogério Vicente2K visualizações
Technical Practices for Agile Engineering - PNSQC 2019 por Moss Drake
Technical Practices for Agile Engineering - PNSQC 2019Technical Practices for Agile Engineering - PNSQC 2019
Technical Practices for Agile Engineering - PNSQC 2019
Moss Drake94 visualizações
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment por WSO2
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO21.5K visualizações
Writing Tests with the Unity Test Framework por Peter Kofler
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
Peter Kofler243 visualizações
Mobile Automation Basic Concepts / Demo por TestingCR
Mobile Automation Basic Concepts / DemoMobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / Demo
TestingCR166 visualizações
Performance Test Automation With Gatling por Knoldus Inc.
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
Knoldus Inc.1.8K visualizações
Gatling por Gaurav Shukla
Gatling Gatling
Gatling
Gaurav Shukla5.3K visualizações
Liferay portals in real projects por IBACZ
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
IBACZ5.8K visualizações
Cynthia Wu: Satisfaction Not Guaranteed por Anna Royzman
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not Guaranteed
Anna Royzman138 visualizações
The Professional Programmer por Dave Cross
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
Dave Cross481 visualizações
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo... por MobileMonday Estonia
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
MobileMonday Estonia2.1K visualizações
Building Sustainable Software: An Introduction to Software Engineering por Muhammad Shehata
Building Sustainable Software: An Introduction to Software EngineeringBuilding Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software Engineering
Muhammad Shehata144 visualizações
Quality Assurance: An Overview por Anant Corporation
Quality Assurance: An OverviewQuality Assurance: An Overview
Quality Assurance: An Overview
Anant Corporation236 visualizações

Último

Microsoft Power Platform.pptx por
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
53 visualizações38 slides
Mini-Track: Challenges to Network Automation Adoption por
Mini-Track: Challenges to Network Automation AdoptionMini-Track: Challenges to Network Automation Adoption
Mini-Track: Challenges to Network Automation AdoptionNetwork Automation Forum
12 visualizações27 slides
HTTP headers that make your website go faster - devs.gent November 2023 por
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
22 visualizações151 slides
PRODUCT PRESENTATION.pptx por
PRODUCT PRESENTATION.pptxPRODUCT PRESENTATION.pptx
PRODUCT PRESENTATION.pptxangelicacueva6
14 visualizações1 slide
Uni Systems for Power Platform.pptx por
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
56 visualizações21 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... por
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
18 visualizações49 slides

Último(20)

Microsoft Power Platform.pptx por Uni Systems S.M.S.A.
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.53 visualizações
Mini-Track: Challenges to Network Automation Adoption por Network Automation Forum
Mini-Track: Challenges to Network Automation AdoptionMini-Track: Challenges to Network Automation Adoption
Mini-Track: Challenges to Network Automation Adoption
Network Automation Forum12 visualizações
HTTP headers that make your website go faster - devs.gent November 2023 por Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 visualizações
PRODUCT PRESENTATION.pptx por angelicacueva6
PRODUCT PRESENTATION.pptxPRODUCT PRESENTATION.pptx
PRODUCT PRESENTATION.pptx
angelicacueva614 visualizações
Uni Systems for Power Platform.pptx por Uni Systems S.M.S.A.
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptx
Uni Systems S.M.S.A.56 visualizações
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... por Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Jasper Oosterveld18 visualizações
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors por sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 visualizações
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... por Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 visualizações
Democratising digital commerce in India-Report por Kapil Khandelwal (KK)
Democratising digital commerce in India-ReportDemocratising digital commerce in India-Report
Democratising digital commerce in India-Report
Kapil Khandelwal (KK)15 visualizações
Network Source of Truth and Infrastructure as Code revisited por Network Automation Forum
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisited
Network Automation Forum26 visualizações
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive por Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Network Automation Forum31 visualizações
Business Analyst Series 2023 - Week 3 Session 5 por DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10248 visualizações
Case Study Copenhagen Energy and Business Central.pdf por Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 visualizações
Attacking IoT Devices from a Web Perspective - Linux Day por Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri16 visualizações
Evolving the Network Automation Journey from Python to Platforms por Network Automation Forum
Evolving the Network Automation Journey from Python to PlatformsEvolving the Network Automation Journey from Python to Platforms
Evolving the Network Automation Journey from Python to Platforms
Network Automation Forum13 visualizações
PharoJS - Zürich Smalltalk Group Meetup November 2023 por Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi127 visualizações
Ransomware is Knocking your Door_Final.pdf por Security Bootcamp
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdf
Security Bootcamp55 visualizações
Five Things You SHOULD Know About Postman por Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 visualizações
Data Integrity for Banking and Financial Services por Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 visualizações

Introduction to Test Automation

  • 1. An introduction to Test Automation © Copyright Pekka Klärck <peke@eliga.fi> Creative Commons Attribution 3.0 License
  • 2. Scope ● Dynamic vs. static ● Functional vs. non-functional ● Acceptance vs. unit (vs. module vs. integration) ● Frameworks vs. drivers ● Running tests vs. generating tests ● Full scale automation vs. helping manual testing ● Test execution vs. test management
  • 3. Different scripting approaches ● Record and playback ● Linear scripting ● Modular scripting ● Data-driven testing ● Keyword-driven testing
  • 4. Record and playback ● Capture interaction with system and replay it ● Popular approach among commercial tools
  • 5. Record and playback: Example Selenium IDE
  • 6. Record and playback: Benefits ● Very easy and fast to create initially ● No programming skills needed
  • 7. Record and playback: Problems ● Does not test anything unless checkpoints added ● Very fragile ● Often single change in UI can break all tests ● Hard to maintain ● Plenty of separate test scripts ● No modularity or reuse ● System must be ready before automation can start ● Does not support acceptance test driven development (ATDD)
  • 8. Record and playback: Summary ● Seldom a good approach in general ● Never a good basis for large scale automation
  • 9. Linear scripting ● Non-structured scripts interact directly with the system under test (SUT) ● Can use any programming language ● Also produced by capture and replay tools
  • 11. Linear scripting: Benefits ● Fast to create initially ● Flexible ● Can use common scripting languages ● No license costs
  • 12. Linear scripting: Problems ● Creating tests requires programming skills ● Very fragile ● One change in the system may break all scripts ● Hard to maintain ● Plenty of test scripts ● No modularity or reuse
  • 13. Linear scripting: Summary ● Adequate for simple tasks ● Never a good basis for large scale automation
  • 14. Modular scripting ● Driver scripts “drive” test execution ● Interaction with the SUT done by functions in a test library
  • 15. Modular scripting: Example ← Test library ↓ Driver script
  • 16. Modular scripting: Benefits ● Reuse of code ● Creating new tests gets faster ● Maintainability ● Changes require fixes in smaller areas ● Driver scripts are simple ● Even novice programmers can understand and edit ● Creating new ones is not hard either
  • 17. Modular scripting: Problems ● Building test library requires initial effort ● Takes time ● Requires programming skills ● Test data embedded into scripts ● Requires some understanding of programming ● New tests require new driver scripts
  • 18. Modular scripting: Summary ● Good for simple tasks ● Works also in larger usage if everyone who needs to understand tests can program ● Not good for non-programmers
  • 19. Data-driven testing ● Test data taken out of test scripts ● Customarily presented in tabular format ● One driver script can execute multiple similar tests ● New driver script still needed for different kinds of tests
  • 21. Data-driven testing: Benefits ● Test libraries provide modularity ● Same benefits as with modular scripting ● Creating and editing existing tests is very easy ● No programming skills needed ● Maintenance responsibilities can be divided ● Testers are responsible for the test data ● Programmers are responsible for automation code
  • 22. Data-driven testing: Problems ● Test cases are similar ● For example '1 + 2 = 3' and '1 * 2 = 2' ● New kinds of tests need new driver script ● For example '1 * 2 + 3 = 6' ● Creating driver scripts requires programming skills ● Initial effort creating parsers and other reusable components can be big
  • 23. Data-driven testing: Summary ● Good solution even for larger scale use ● New kinds of tests requiring programming is a minus ● May be an overkill for simple needs
  • 24. Keyword-driven testing ● Not only test data but also directives (keywords) telling how to use the data taken out of the test scripts ● Keywords and the test data associated with them drive test execution
  • 25. Keyword-driven testing: Example Robot Framework syntax from SeleniumLibrary demo: http://bit.ly/rf-web-test-demo
  • 26. Keyword-driven testing: Benefits ● All same benefits as with data-driven testing ● Non-programmers can create and edit tests ● Separation of test data and code ● Tests can be constructed freely from keywords ● Non-programmers can create also new kinds of tests ● With suitable keywords also data-driven tests possible ● All tests can be executed by one framework ● No need to create and maintain separate driver scripts
  • 27. Keyword-driven testing: Problems ● Initial effort can be really big ● But there are open source solutions available!
  • 28. Keyword-driven testing: Summary ● Very good solution for large scale use ● Use existing solutions if you can ● May be an overkill for simple needs
  • 29. Interacting with the SUT ● Testability ● Testing through GUI ● Testing below GUI ● Other interfaces
  • 30. Testability ● The hardest part of automation is interacting with the system under test ● Especially hard with GUIs ● Programming APIs are easiest ● Important to make the system easy to test ● Some common guidelines ● Add identifiers to GUI widgets ● Textual outputs should be easy to parse ● Consider providing automation interfaces
  • 31. Testing through GUI ● Same interface as normal users use ● Can be technically challenging or impossible ● Not all GUI technologies have good tools available ● Often fragile tests ● Often relative slow to execute ● Good approach to use when feasible
  • 32. Testing below GUI ● Automating through business layer often easy ● Tests typically run very fast ● But you still need to test the GUI ● Test the GUI is wired correctly to the business logic ● GUIs always have some functionality of their own ● Pragmatic hybrid solution: ● Test overall functionality below the GUI ● Some end-to-end tests through the GUI—not necessarily even automated
  • 33. Other interfaces ● Not all systems have a GUI ● Many systems have multiple interfaces ● Programming APIs, databases, server interfaces, command line, … ● Automation framework which can utilize different drivers works well in these situations ● Non-GUI interfaces generally easy to automate ● Most of them targeted for machines ● Test library is just another client
  • 34. When to automate and by whom? ● After development by separate team ● During development collaboratively
  • 35. Automation after development ● Often by different team ● In worst case on a different floor, building, or continent ● Communication problems ● Typical in waterfall-ish projects ● Slow feedback loop ● Testability problems can be show stoppers ● Often hard to get testability hooks added afterwards ● May need to resort to complicated and fragile solutions
  • 36. Collaborative automation ● Automation considered an integral part of development ● Collaboration between testers and programmers ● Typical in Agile projects ● In acceptance test driven development (ATDD) automation started before implementation ● Testability normally not a problem ● Programmers can create testability hooks ● Testability and available tooling can be taken into account even with technology decisions
  • 37. Supporting practices ● Version control ● Continuous integration
  • 38. Version control ● Test data and code should be stored the same way as production code ● Recommended to store tests with the production code ● Easy to get an old version of the software with related tests ● Lot of great open source alternatives available ● Subversion, Git, Mercurial, … ● No excuse not to use
  • 39. Continuous integration ● Key to full scale automation ● Tests are run automatically when ● New tests are added ● Code is changed ● Can also have scheduled test runs ● Useful if running all tests takes time ● Great open source solutions available ● Jenkins/Hudson, Cruise Control, BuildBot, … ● Custom scripts and cron jobs can be retired
  • 40. Available tools ● Commercial ● Open source ● Freeware
  • 41. Commercial tools ● Good ones tend to be expensive ● But not all expensive are good ● Even cheap licenses can prevent full team collaboration ● Often hard to integrate with ● Other automation tools (especially from other vendors) ● Version control and continuous integration ● Hard or impossible to customize ● Risk of product or company discontinuation
  • 42. Open source tools ● Large variety ● Some are great—others not so ● Normally easy to integrate with other tools ● Free, as in beer, is good ● Everyone can use freely ● Free, as in speech, is good ● Can be customize freely ● Can never really die
  • 43. Freeware tools ● Getting rare nowadays ● Most free tools are also open source ● No license costs ● Tend to be easier to integrate with other tools than commercial ● Hard or impossible to customize ● Risk of discontinuation
  • 44. Generic skills to learn ● Scripting languages ● Python, Ruby, Perl, Javascript, ... ● Regular expressions ● A must when parsing textual outputs ● XPath and CSS selectors ● A must when doing web testing ● SQL ● A must with databases ● Using version control
  • 45. Is manual testing still needed? ● YES!! ● Avoid scripted manual testing ● Automate it instead ● Concentrate on exploratory testing ● Machines are great for running regression tests ● Humans are great for finding new defects
  • 46. Questions? Thanks! © Copyright Pekka Klärck <peke@eliga.fi> Creative Commons Attribution 3.0 License