Professional Documents
Culture Documents
E-Commerce Testing Framework: April 2019
E-Commerce Testing Framework: April 2019
E-Commerce Testing Framework: April 2019
net/publication/334389714
CITATIONS READS
0 161
1 author:
Denislav Lefterov
Plovdiv University "Paisii Hilendarski"
11 PUBLICATIONS 0 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Denislav Lefterov on 11 July 2019.
Abstract
This article presents the development of an automation-based testing framework, which
supports and helps to implement easily new tests related to Web platforms analogous to E-
commerce applications. With the advantages of Page Object Pattern and the using of the following
technologies: Java programing language, JUnit and TestNG extended libraries. The created scripts
represent automated acceptance, functional and non-functional tests in which the Page Object
pattern is used to separate the tests into individual fragments and subsequently to call them in a
different order according to the test requirements and business logic. Tests can be numerous, but
the elements visualized in a given functionality are similar in order to reuse the key iterations,
software testers need to separate the programming logic of individual modules. This is further
described in the following article.
Introduction
In the past few decades, software testing has evolved in terms of both the tools used to
perform different activities and the mindset of the people using those tools. There used to be only a
handful of tools used in software testing, but now having a plethora of tools to choose, from
proprietary to open source. The work of the practical development is done in the following plan:
validating an exemplary website oriented to E-commerce environment and analyzes the way
continuous software testing could involve. The system incorporates a plurality of graphical
components that can provide information on whether automated tests meet the requirements and
easily new tests can be developed from the previous test logic. An automation testing framework is
described in the following way: hierarchical directory that encapsulates shared resources, such as a
dynamic shared library, helpers, conditional strings, stored files, header data, and reference
documentation in a single grouped package [6]. Framework is a wrapper around complex internal
architecture which makes end user interacts with the system easily. Test Automation Framework is
an application-independent solution that deals with all possible actions and verifications that can
be performed on a single object. Therefore, the code for the same object can be used and reused
across different applications – this is further described in the Diagram 1 [4].
26
Diagram 1
27
Each one of given above should be separately developed as a test scenarios module
oriented. The Diagram 2 shows the exact structure of E-Commerce framework.
Diagram 2
This is a designed test automation framework based on Selenium Web Driver and TestNG
and extended for current purpose. It can be used on all Web applications related to E-Commerce
structure. The framework designed in this paper includes the following components listed below:
● Object Pattern Repository;
● Logger;
● Test Step;
● Data Provider;
● Asserter;
● Reporting Mechanism.
Diagram 3
Logger
When a test is run there is always a chance that this approach could fail. In this case I have
extended the main solution of exception handling and define a custom one. In this way, is ensured
the approach in case of a potential failure that will have the necessary information as well as the
exact location of the failure. There are many types of loggers. Here are some of them:
Console Logger – writes log only in the console terminal
TestNG Logger – adds info to TestNG log and description was stored of the
failure
Log4J Logger – writes log in log4J log (can be configured log4J basically)
Step utensil
This file comprises the common functionality of Web application like login, logout, choose
example product, buying product, using payment methods, completing order. In test suite QA
specialist needs to login to Web platform to test internal functionality of application, choose
different type of products then complete the order purchase using a payment method and after that
log out after completion of the whole process. To avoid this kind of repetition, there were these
main functionalities added. Each action is indicated and implemented in the step path.
A new function is developed, which will take the screenshot for failure test cases. Using
this function tester can easily capture the exact screen when the error occurs. This will also help
the developer to analyze their failure. After the execution of all test suites, screenshots for failure
test cases are stored in directory according to date wise folder [7].
Data Provider
In most of the Web applications, end user needs to enter given information for e.g. Mail
login requires credentials to login. Such kinds of inputs are stored in data provider stub. Instead of
entering same information in the application, tester may access dynamic functions from this data
provided information.
Asserter
Assertions are used to validate the message received by a Test Step during execution,
usually by comparing parts of the message (or the entire message) to some expected value. Any
number of assertions can be added to a sampler test step, each validating some different aspect or
content of the response. After a sampler test step executes, all its assertions are applied to the
received response and if any of them fail the test step is marked as failed in the test case view and
a corresponding FAILED entry is shown in the test execution log [8].
Implementation of IAsserrter interface in the current framework:
exception – for throwing different kind of exceptions
silent – for avoid adding throws Exception in methods but you can throw
it (e.g. using assertTrueIs(false)) or hide and just add message in logger
areEqualing – for comparing different object values
contains – check is actual containing expected string
matches – check is actual string matches to regExpressions
Table 1
Diagram 4
Conclusion
In this paper I have proposed new automation testing framework approach to test E-
Commerce based Web applications configured and extended on Selenium Web Driver. The
proposed automation framework reduces the required time to write test cases and increases pass
percentage rate of them by covering all the main steps in applications of this nature. It also reduces
vulnerable workload of testers. By using this framework specialists can implement the framework
over any application oriented to E-commerce by configuring the main methods by their needs.
They can generate customized test reports and also analyze the failures using screenshots of failed
test cases and manage to trace the issue precisely. QA specialists can maintain all the data from
centralized stored place. This framework is very useful for dynamically changing Web
applications, which implements new features very often. Automation test scripts are easy to handle
31
and are understandable. In this way automation framework helps the organizations to test E-
Commerce Web applications efficiently.
References
1.Selenium all Core Documentation [Online]. https://www.seleniumhq.org (Accessed on 24
September 2018).
2.TestNG Documentation [Online]. https://www.testng.org (Accessed on 25 September
2018).
3.Z. Wanadan, J. Ninkang, Z. Xubo. Design And Implementation Of A Web Application
Automation Testing Framework; Ninth International Conference On Hybrid Intelligent Systems,
2009.
4. Rigzin Angmo,Monika Sharma. Selenium Tool:A Web based Automation testing
Framework. International Journal of Emerging Technologies in Computational and Applied
Science 2014.
5.Sherry Singla, Harpreet Kaur. Selenium Keyword Driven Automation testing Framework,
International Journal of Advance Research in Computer Science and software Engineering,
VOL.4,Issue 6, 2014.
6.AndrzaM, Giesel A. etl. Extension of Selenium RC Tool to Perform Automated Testing
with Databases in Web Applications; Automation of Software Test (AST), 2013 8th International
Workshop, 2013.125–131.
7.Analysis and Design of Selenium Web Driver Automation Testing Framework, S.
Gojare, R. Joshi, D. Gaigaware, Procedia Computer Science 50 (2015) 341 – 346, doi: 10.1016/j.
procs. 2015.04.038.
8.SoapUI – Documentation [Online] Getting started with Assertions.
https://www.soapui.org (Accessed on 10 October 2018).
For contacts:
UNIVERSITY OF PLOVDIV PAISII HILENDARSKI, 24 TZAR ASEN, 4000 PLOVDIV
Denislav Lefterov, PhD student, Faculty of Mathematics and Informatics
E-mail: denislav.lefterov@uni-plovdiv.bg
32