Docsity

Implementing test automation with Selenium WebDriver, Study Guides, Projects, Research of Computer science

Partial preview of the text

Download Implementing test automation with Selenium WebDriver and more Study Guides, Projects, Research Computer science in PDF only on Docsity!

Implementing test automation

with Selenium WebDriver

Case study: MeetingPackage.com

LAHTI UNIVERSITY OF APPLIED

SCIENCES

Degree programme in Business Information Technology Bachelor’s Thesis Autumn 2018 Quan Dao Minh

Lahti University of Applied Sciences Degree Programme in Business Information Technology

Dao, Quan: Title: Implementing test automation with Selenium WebDriver

Case study: MeetingPackage.com

Bachelor’s Thesis in Business 61 pages, 3 pages of appendices Information Technology

Autumn 2018

ABSTRACT

The objective of this research is to identify the impact of automation testing in terms of time efficiency in software development, particularly, Agile software development with Scrum methodology. To achieve that, the thesis employs the Research Design methodology with an abductive approach. In addition, data collection in this thesis is conducted by observing the artefact’s behavior and results. Lastly, the thesis introduces comparison scenarios with descriptive data analysis method to assess the impact of the artefact to the case company.

In detail, the thesis discusses the current issue of the case company, then, presents the relevant theoretical framework to back up the reasonings of the selected solution. Later, the thesis introduces the implementation of the artefact Selenium Framework using Java programming language. The implementation includes planning, gathering system requirements, developing and collecting results, followed by observing data and analyzing the test results. After data evaluation, the thesis concludes about the artefact’s performance in reducing time consumption for the testing effort. Finally, the finding confirms the artefact’s effectiveness to the case company with statistical evidence.

Additionally, the research provides an implementation guideline for future reference with the topic of Selenium Framework. However, any usage must take into consideration the research’s limitations and validity prior to any adaptation.

Keywords: Agile Software Development Methodology, Scrum, Selenium,

Java, Maven, Git, POM.

LIST OF ABBREVIATIONS

API – Application Programming Interface

CSS – Cascading Style Sheets

DOM – Document Object Model

GUI – Graphical User Interface

HTML – Hyper Text Markup Language

HTTP – Hypertext Transfer Protocol

IDE – Integrated Development Environment

IE – Internet Explorer

POM – Page Object Model

QA – Quality Assurance

VCS – Version Control System

SaaS – Software as a Service

SWOT – Strengths, Weaknesses, Opportunities, Threats

UAT – User Acceptance Test

UI – User Interface

XML – Extensive Markup Language

XPATH – XML Path Language

FIGURE 24 MEETINGPACKAGE.COM DASHBOARD PAGE

  • 1 INTRODUCTION
    • 1.1AAAAAResearch Background
    • 1.2AAAAAResearch Objectives and Questions
  • 2 RESEARCH DESIGN
    • 2.1AAAAAResearch Approach
    • 2.2AAAAAResearch Method
    • 2.3AAAAAData Collection and Data Analysis
    • 2.4AAAAAThesis Structure
  • 3 THEORETICAL FRAMEWORK
    • 3.1AAAAATesting in Agile Software Development
    • 3.1.1aaa Agile Software Development Overview
    • 3.1.2AAA Scrum Methodology Overview
    • 3.2AAAAASoftware Testing Fundamentals
    • 3.3AAAAAAutomated Testing
    • 3.3.1AAA Definition of Automation Testing
    • 3.3.2AAA When to perform Automation Testing
    • 3.4AAAAASelenium WebDriver
    • 3.4.1AAA Selenium Overview
    • 3.4.2AAA Selenium WebDriver Behavior
    • 3.4.3AAA UI Locator Overview
    • 3.4.4AAA Common Methods in Selenium
    • 3.4.5AAA Selenium Installation System Requirements
    • 3.4.6AAA POM (Page Object Model) Overview
    • 3.5AAAAAGit and GitHub
    • 3.5.1AAA Git Overview
    • 3.5.2AAA GitHub
    • 3.6AAAAAJava
    • 3.6.1AAA Java as a Programming Language
    • 3.6.2AAA Maven Overview
    • 4.1AAAAAIntroduction
    • 4.1.1AAA Company Information
    • 4.1.2AAA Analysis of Preceding Test Process
    • 4.1.3AAA SWOT Analysis
    • 4.1.4AAA Artefact and Tool Selection Reasoning
    • 4.2AAAAAArtefact Development
    • 4.2.1AAA Plan and Tools
    • 4.2.2AAA Test Suite Architecture
    • 4.2.3AAA Implementation of Test Suite
    • 4.3AAAAATest Suite Execution
    • 4.4AAAAAResults and Test Reports
  • 5 ANALYSIS OF THE RESULTS
    • 5.1AAAAATime Consumption before the Artefact
    • 5.2AAAAATime Consumption after the Artefact
    • 5.3AAAAAComparison and Conclusion
  • 6 CONCLUSION
    • 6.1AAAAAAnswering the Research Question
    • 6.2AAAAALimitations
    • 6.3AAAAAReliability and Validity
    • 6.4AAAAA Suggestions for Further Study
  • 7 SUMMARY
  • LIST OF REFERENCES
  • APPENDICES
    • (MEETINGPACKAGE.COM 2018)
  • FIGURE 25 REQUIRED PACKAGES
  • FIGURE 26 SELENIUM LOGIN PAGE
    • (MEETINGPACKAGE.COM 2018 ) FIGURE 27 MEETINGPACKAGE.COM LOGIN PAGE
  • FIGURE 28 SELENIUM LOGIN PAGE
  • FIGURE 29 SELENIUM LOGIN TEST
  • FIGURE 30 SELENIUM LOGIN TEST
  • FIGURE 31 SELENIUM LOGIN TEST
  • FIGURE 32 SELENIUM LOGIN TEST
  • FIGURE 33 SELENIUM BROWSER INSTANCE
  • FIGURE 34 SELENIUM TEST SUITE
  • FIGURE 35 TERMINAL INTERFACE
  • FIGURE 36 SELENIUM TEST SUITE
  • FIGURE 37 TEST REPORT
  • FIGURE 38 TEST REPORT
  • FIGURE 39 JUNIT
  • FIGURE 40 TEST REPORT

LIST OF TABLES

TABLE 1 DATA EVALUATION METHODS (HERVER 2004) 7

TABLE 2 COMMON METHODS AND COMMANDS IN SELENIUM

(SELENIUM 2018) 21

TABLE 3 COMPARISONS BETWEEN SHORTLISTED FRAMEWORKS 34

TABLE 4 SYSTEM REQUIREMENTS TO RUN THE TEST SUITE 36

TABLE 5 FORMULA AND CALCULATIONS 52

Furthermore, for the purpose of fast constant growth, changes are

required to be made daily or weekly. Therefore, it is imperative to ensure

there is no development regression or down-time in the live product. As a

result, the development team faces an obstacle: how to maintain a well-

functioning web application with constant changes and releases in a short

period of time?

To achieve this, quality assurance plays a huge role in the development

cycle. By ensuring a fast, reliable and efficient QA process, the

development team can speed up the feature shipment time. Traditionally,

manual testing is accounted for a great part of the QA process. However, it

is noticeable that automation testing is slowly replacing manual testing,

due to its ability of cross-browser testing with deep penetration based on

the predefined test suite. Compared to manual testing where the cost of

time, money and effort remain a tremendous burden, automation testing

appears to be a better solution for regression and time efficiency. (Nguyen,

Hackett & Whitlock 2006, 28.)

1.2 Research Objectives and Questions

Automation testing involves manipulating the machine to perform certain

tasks written by developers in a programming language. However, it is

time efficient for developers to utilize certain testing framework without the

need of developing all the modules, classes and methods from scratch.

For example, Selenium Framework is a powerful tool to automate different

browsers using web drivers in order to test web functionalities or mimic

users’ behaviors (Selenium 2018). This thesis demonstrates why and how

Selenium Framework is applied in web development QA by finding the

answer to the following question:

  • Research Question: How does Selenium Framework reduce time consumption in Quality Assurance at MeetingPackage.com?

The objective of this research is to measure the time efficiency Selenium

Framework provides when being implemented in the test suite. Later on, the

data is compared to the QA time consumption before the test suite in the

case company. Finally, the research concludes about the benefit of using

Selenium Framework for test automation based on the statistical result.

Furthermore, the thesis aims to provide a complete guideline about

Selenium Framework implementation with the selected programming

language (Java) for automation testing of web application.

identify the true reason behind the problem with an open-minded to new

hypotheses or ideas (Shuttleworth 2008). With all that factors taken into

consideration, the thesis employs an abductive research approach.

2.2 Research Method

The thesis author chooses Design Science to be the thesis research

method due to the following reasons. First of all, it is a research method

that involves a problem-solving approach, posing the need for change

toward a better future (Barab & Squire 2014.). Secondly, Design Science

consists of a research practice to create an artefact to resolve the declared

issue, analyzing the result and demonstrate the finding to the audience

(Peffers, Tuunanen, Rothenberger & Chatterjee 2008, 6). As Figure 3

below shows, the process starts with an awareness of the problem, then

the researcher comes up with a suggestion to develop the artefact. After

that, a thorough evaluation is conducted to bring up a conclusion of the

results.

Figure 3 Reasoning in the Design Cycle (Vaishnavi & Kuechler 2012)

Practically, this thesis follows closely these six steps in Design Science

method (Geerts 2011):

  • Problem identification and motivation: the main question is to recognize and identify the problem, its relevance, and the current situation (Geerts 2011).
  • Define the solution goal: finding the answer for “How to solve the problem” by suggesting a specific objective to achieve. This requires the knowledge of the feasibility and the possibility of the solution as well as the theories and method behind that (Geerts 2011).
  • Design and development: build the artefact that resolves the aforementioned issue. The researcher needs to combine the required knowledge to create the artefact (Geerts 2011).
  • Demonstration: a proof of how the artefact works and solve the problem needs to be generated in this phase (Geerts 2011).
  • Evaluation: based on the demonstration, the researcher observes and measures its performance by comparing the actual results with the set objectives (Geerts 2011).
  • Communication: researcher must present a detailed conclusion of the effectiveness of the artefact, its scope, and limitation (Geerts 2011).

2.3 Data Collection and Data Analysis

Data collection plays an important role in any research. As imperative as

selecting the research design and approach, the choice of particular data

collection methods determines the result of the research. In fact, in order

to have a convincing data collection, the researcher needs to identify the

proper objective. Once it is defined, the format of the data collection and

the way the data is handled is determined.

According to Hevner (2004), there are five different methods to evaluate

the data in Design Science (Table 1). For the purpose of this thesis, an

observational method to collect data and descriptive method with

The five main sections are the following: introduction, theoretical

framework, artefact implementation, analysis, and conclusion. The

following summarizes the content of each of the five sections:

Introduction: This section aims to deliver a brief understanding of the

thesis, its objective and research methods used in research. The research

question and data collection methods are also introduced in this section.

Theory: This section provides all the necessary theoretical framework for

the thesis. The key concepts which are defined include Agile software

development methods, testing principles, automation testing with Selenium

WebDriver, Git and GitHub, Java and Maven.

Artefact implementation: the third part of the thesis is the development of

the artefact. In this section, the thesis author demonstrates with examples

how he developed and maintained the artefact.

Analysis of the test results: in this part, the author gathers the data and

calculates the cost and benefit of the artefact to find out whether or not the

artefact provides any benefits to the case company.

Conclusion: The last section presents the comparison of data before and

after the artefact together with the author’s conclusion of the artefact’s

performance. Lastly, the disadvantages and limitations of the artefact are

also pinpointed.

3 THEORETICAL FRAMEWORK

3.1 Testing in Agile software development

3.1.1 Agile Software Development Overview

The most well-known and traditional method when developing a software

is the waterfall methodology – a collection of separate phases, each phase

follows each other from the planning to the deployment. (Ransome &

Misra 2014 , 50). However, it becomes clear that this method faces an

issue – there is no room for errors whether they are big or small.

Figure 5 Waterfall VS Agile (Lotz 2013)

Figure 5 above shows the reality of waterfall methodology. With a

circumstance that every stage starts after the previous one finished, the

development effort becomes tremendous with hidden failures and even

poses a failed status (Lotz 2013). For example, even when the product

3.1.2 Scrum Methodology Overview

Scrum is a guideline or a development framework to which development

team follows in Agile projects. With Scrum, time-to-market is shortened

with high customer satisfaction due to the fact that bugs or errors are

continuously identified before the big deployment, which means the quality

of the product increases. In short, Scrum serves as an Agile framework to

raise the team collaboration, enhance the control of the project and

constant product deliver every two or four weeks. (Ashmore & Runyan

2014, 5 3 .). In reality, there are three factors required in a Scrum

methodology (Resnick & Bjork 2011):

  • Product Owner or IT Business Analyst: they are the bridge between the development team and the customers. Their role in the team is to understand the business requirements and convey that into development requirements. They ensure the developers fully acknowledge and follow the right path of product development. To the customers, they are required to inform any changes happened.
  • Scrum master: Taking charge of the team communication, planning and actions. For a small team, the project manager is the Scrum master, but in a big corporation, lead developers or a separate Scrum master are assigned to be.
  • Development team: a cross-functional team in which every member can be responsible for different tasks (developing, testing, deploying, etc.). They work on the product backlog and deliver the potentially shippable increment at the end of the sprint.

Figure 6 The Scrum Lifecycle (Boer 2017)

As can be seen from Figure 6 , a sprint includes five actions:

  • Sprint planning: scrum master and the team discuss and move the product backlog items into the sprint backlog based on each item priority and team’s capabilities. For each item in sprint backlog, the team divides into smaller tasks and assign to each team members (Boer 2017).
  • Sprint Execution and Daily Scrum: the sprint execution starts right after the backlog is defined. Daily scrum is a practice of which team members and scrum master report their progress, their plan, and blockers daily to each other (Boer 2017).
  • Sprint Review and Sprint Retrospective: after each sprint, the team demos the increment (the product of the sprint) as well as assess on remaining tasks, room for improvement (Boer 2017).

Quality Assurance in Scrum or in Agile, in general, is not a particular

phase (Larman 2004, 113). The testing effort starts from the very

beginning of the development, in fact, in each sprint there is always a

testing task. Thanks to this, as the project expands and gets complicated,

the team can confidently develop knowing that bugs and errors of the

product are under control (Larman 2004, 113). With automation testing,

the testing effort may seem to be quite large at first (building the test suite)

but it benefits later on against regression.

3.2 Software Testing Fundamentals

The aim of testing is to find defects or errors in the product under certain

condition and environment (Myers 1979). In software testing, there is an

array of fundamental principles to follow. These principles account for the

make-or-break of any development, especially in Agile software

development practice. However, prior to the planning, the company needs

to identify the test policy (regulations for testing) and the test strategy

(overall testing approach). These rules and regulations are the backbones

of the project testing. (Graham, Veenendaal, Evans & Black 2014.)