Automation Testing: Implementation Methods and Scripting Automation Testing: Implementation Methods

  • View
    0

  • Download
    0

Embed Size (px)

Text of Automation Testing: Implementation Methods and Scripting Automation Testing: Implementation Methods

  • Automation Testing:

    Implementation Methods and Scripting

    Mari Pasanen

    Bachelor’s Thesis

    Degree Programme in

    Business Information

    Technology

    2017

  • Abstract

    21.11.2017

    Author Mari Pasanen

    Degree programme Business Information Technology

    Report/thesis title Automation Testing: Implementation Methods and Scripting

    Number of pages and appendix pages 53 + 3

    This thesis presents the basic concepts of automation testing and testing in general. The

    idea was to learn about automation testing for myself in case of possible future endeav-

    ours, but also to provide an easily accessible tutorial for those who might benefit from the

    knowledge as well but feel a bit overwhelmed about where to begin.

    The thesis comprises of presenting automation testing concepts with SDLC and V-Model,

    different types of testing methods, introduction to both test management and test automa-

    tion tools, basics of the testing process in general, possible risks, a case study to demon-

    strate an automated login case in action, and finally the final conclusions regarding the pro-

    cess of learning from the topic.

    The case study was written in the form of a beginner tutorial, which gives step by step in-

    structions on how to configure and build an environment to conduct a simplified case for a

    login process for a travel web site. The utilized programming language and environment

    was Java with Eclipse Oxygen, the tool selected was Selenium WebDriver and the assist-

    ing framework was selected as Cucumber. The overall final result was a working demo,

    which was documented for easy replication in case of need for learning.

    Keywords Test Automation, Beginner tutorial, Testing process, Cucumber, Selenium Webdriver, Java

  • Table of contents

    1 Introduction ................................................................................................................... 1

    2 Automation testing concepts ......................................................................................... 3

    2.1 What is automation testing? .................................................................................. 3

    2.2 Why implement automation testing? ..................................................................... 3

    2.3 SDLC (Software Development Life Cycle) ............................................................. 4

    2.3.1 V-Model ..................................................................................................... 6

    2.4 Test Driven Development (TDD) ........................................................................... 8

    2.5 Behaviour Driven Development (BDD) .................................................................. 9

    2.6 From manual tests to automation ........................................................................ 11

    3 Types of testing methods ............................................................................................ 12

    3.1 Regression testing .............................................................................................. 12

    3.2 Performance testing ............................................................................................ 12

    3.3 Unit testing .......................................................................................................... 13

    3.4 Integration testing ............................................................................................... 14

    3.5 System testing .................................................................................................... 15

    3.6 Exploratory testing .............................................................................................. 15

    3.7 Smoke testing ..................................................................................................... 16

    3.8 Security testing ................................................................................................... 16

    3.9 User Acceptance Testing (UAT) .......................................................................... 17

    4 Tools and Frameworks ................................................................................................ 18

    4.1 Test management tools ....................................................................................... 18

    4.1.1 Zephyr for Jira .......................................................................................... 18

    4.1.2 HP ALM ................................................................................................... 19

    4.1.3 Open-source management tools .............................................................. 19

    4.1.4 Excel-based Test Management ................................................................ 20

    4.2 Examples of automation testing tools and frameworks ........................................ 20

    4.2.1 Selenium WebDriver ................................................................................ 20

    4.2.2 Cucumber ................................................................................................ 21

    4.2.3 JBehave ................................................................................................... 22

    4.2.4 Universal Functional Tester by HP ........................................................... 22

    4.2.5 Robot Framework..................................................................................... 22

    4.2.6 JMeter ...................................................................................................... 23

    4.2.7 JUnit......................................................................................................... 24

    4.2.8 Jenkins ..................................................................................................... 24

    5 Testing process ........................................................................................................... 25

    5.1 Test Planning ...................................................................................................... 25

    5.1.1 Master Test Plan (MTP) ........................................................................... 25

  • 5.1.2 Requirements ........................................................................................... 25

    5.1.3 Test Cases ............................................................................................... 26

    5.1.4 Test Execution ......................................................................................... 28

    5.1.5 Defect Management ................................................................................. 28

    5.2 The importance of the planning and preparation of test tools .............................. 29

    5.3 Implementation of languages from automation testing perspective ..................... 29

    5.3.1 Gherkin .................................................................................................... 30

    5.4 Deliverables and understanding the results ......................................................... 31

    6 Risks of automation testing ......................................................................................... 34

    7 Case study .................................................................................................................. 36

    7.1 Installing tools and frameworks ........................................................................... 37

    7.1.1 Installing Java, Eclipse and the Cucumber plugin..................................... 37

    7.1.2 Downloading Cucumber and Selenium WebDriver ................................... 38

    7.2 Configuration of selected tools and frameworks .................................................. 39

    7.3 Creating and running the automated test on the Mercury Tours web site ............ 41

    7.3.1 Creating a Selenium Java Test ................................................................ 41

    7.3.2 Creating a Cucumber Feature file ............................................................ 44

    8 Conclusion .................................................................................................................. 52

    References ...................................................................................................................... 54

    Appendices ...................................................................................................................... 63

    Appendix 1. Central Keywords List .............................................................................. 63

  • 1

    1 Introduction

    Testing comprises of multiple techniques and phases to be implemented in software and

    system testing in the lifecycle of development and maintenance. Manual testing through

    test runs with pre-defined test cases on necessary functions is the most normative way of

    understanding testing, but with huge systems and long development lifecycles comes the

    problem of repetition, the sheer amount of implementable test runs, and the required cov-

    erage through test cases.

    Automation testing is a form of testing that enables repetitive method for running test

    cases and reducing manual work, and