Professional Documents
Culture Documents
Shein.com website
Authors: Supervisor:
August 4, 2023
Declaration of Authorship
We, Rabia Kurkcu & Ayse Nur Yuksel declare that this thesis titled, “Development of a
Test Automation Framework and Testing Shein.com Website” and the work presented in it is our
own. We confirm that:
This work was done wholly or mainly while in candidature for a research degree at this
University.
Where any part of this thesis has been submitted for a degree or any other qualification at
this University or any other institution, this has been clearly stated.
Where We have quoted from the work of others, the source is always given. Except for
such quotations, this thesis is entirely our own work.
Where the thesis is based on work done by us. We have made clear exactly what was
done by others and what we have contributed by ourselves.
Date: 08/04/2023
NORTH AMERICAN UNIVERSITY
Abstract
Shein.com Website
The goal of this study is to comprehend, apply, and improve the idea of testing an e-
commerce website while also raising product quality, which is a crucial component of software
testing. It explains automation testing and uses it to demonstrate how it can be used to accurately
grasp user requirements. There are countless websites, each serving a different function and
class.
It is vital to outline the significance of software testing and inspect the different variations
of methods and techniques to make an effective testing process.
This research paper aims to cover these topics and generate a proper conclusion from the
specified source.
We would like to express our heartfelt gratitude, appreciation and thanks to the following
individuals.
To Dr. Abdulkerim Oncu for being our thesis adviser his guidance and encouragement to
finish the study was so valuable. Without his valuable comments and suggestions this work
would not have been possible.
To Dr. Ihsan Said who provided encouraging and constructive feedback and valuable
comments and suggestions when developing this study.
Also, we would like to thank all our teachers who shared their valuable insights when we
needed it. It was a blessing to have such supportive classmates. We are grateful for the
opportunity to improve our skills and knowledge in such a collaborated environment here at
North American University.
Declaration of Authorship..................................................................................................2
Abstract.............................................................................................................................3
Acknowledgement.............................................................................................................4
List of Figures....................................................................................................................8
Introduction.....................................................................................................................10
CHAPTER 1.......................................................................................................................11
Software Testing..............................................................................................................11
CHAPTER 2.......................................................................................................................16
CHAPTER 3.......................................................................................................................24
Requirement Analysis........................................................................................................................ 24
Test Planning..................................................................................................................................... 25
Test Execution.................................................................................................................................... 26
Test Closure....................................................................................................................................... 27
CHAPTER 4.......................................................................................................................29
Manual Testing................................................................................................................29
CHAPTER 5.......................................................................................................................33
Automation Testing.........................................................................................................33
5.1 Maven..................................................................................................................................33
5.2 TestNG..................................................................................................................................34
5.3 Selenium...............................................................................................................................34
5.6.2 POM.xml................................................................................................................................... 44
5.6.5 Dependencies............................................................................................................................ 46
5.6.6 Utilities...................................................................................................................................... 46
5.6.8 Reports...................................................................................................................................... 48
Conclusion.......................................................................................................................53
References.......................................................................................................................55
List of Figures
Figure 1 Waterfall Model....................................................................................................................16
Figure 6 STLC.......................................................................................................................................26
Software testing is the procedure that aims to examine a software program's functionality.
Before the software is deployed and released, the process verifies that there are no faults or gaps,
and that the application's result fulfills the desired expectations. Software testing reduces the
number of bugs in the software, raising its quality. As part of the testing process, test findings are
documented and presented to developers so they can make changes to the system to achieve the
desired outcomes. To ensure the quality of a software product, testing is a difficult procedure that
comes with difficulties.
There are a variety of different testing techniques that can be used in the testing process
to help testers achieve their goals, including functional testing, non-functional testing, unit
testing, system testing, acceptance testing, integration testing, etc. Different testing
methodologies concentrate on various objectives.
To find bugs or other problems with the software, manually testing the site called manual
testing. When testing an application, the tester assumes the position of an end user and examines
how well it adheres to the system's requirements. Manual testing's efficacy in the process of
ensuring the quality of software is, however, in doubt. It is important to talk about the positive
effects of automated testing libraries like Selenium because they can affect the software's quality
attribute.
CHAPTER 1
Software Testing
This chapter's goal is to examine the real value of testing in the creation of complex
software systems and to analyze various testing methods. This paper will contain a suggested
strategy for software quality assurance because it is recommended that every organization set up
a strong management system to handle the quality assurance of software.
The majority of those who work in the software development industry have endured or
participated in software testing in some capacity. What exactly is testing software, what counts
as testing, and what does not are all defined differently. Every organization should follow a
single, widely recognized definition of software testing. Software testing is the process of
ensuring that a program or software system performs as it is intended to, according to (Hetzel,
1984). In contrast, software testing is described by Myers (1979) as running a program or system
to spot flaws. Both reflect a component of software testing, but instead of considering all of
them, these definitions concentrate on a single objective. Hetzel's definition focuses on making
sure the system performs as planned, however a system may seem to be in use but still include
defects that will not please clients. Myers, however, concentrates on ensuring that the system is
bug-free without considering the functional requirements of the system; if one is bug-free but
does not meet the client's needs, the system has not been adequately validated. Verifying that the
right system is being constructed is the process of validation. While both are critical to
understanding testing, they are also rapidly coming to be seen as too limited and limiting to be
accepted as a definition of testing. It is not the best practice to simply validate the system
correctly because that will only partially satisfy clients. There are numerous other ways to
evaluate a system besides running it and making sure it functions. There are additional aspects
that should be considered while trying to produce rate and palatable definition of software
testing. What critically important software quality criteria do users observe first? Functionality,
system dependability, usability, effectiveness, maintainability, portability, interoperability,
understandability, and the product's visual appeal were shown to be the software quality factors
that have the most impact on users (Jagannath and Nigussu, 2018). Each of those elements might
thereafter be categorized as a respectable human software quality factor (HSQF). Fulfilling each
HSQF requirement would be advantageous because the firm will earn most of its revenue from
its consumers. Thus, a definition of software quality assurance (SQA) can be determined from
this. Software quality assurance is "A systemic, planned set of actions necessary to provide
adequate confidence that the software development process or the maintenance process of a
software system product conforms to established functional technical requirements of keeping
the schedule and operating within the budgetary constraints," according to (Galin, 2004). By
concentrating on achieving the system's functional requirements and developing a strategy to
address the product's overall quality, (Galin, 2004) incorporates the proposed definitions by
(Myers,1979) and (Hetzel,1984). According to the authors, this is a far more comprehensive way
of thinking about software testing, and it better captures its purpose. SQA should not stricted
with the programming phase. The enlarged definition must encompass both the development and
maintenance phases of software. So, to ensure that the product fulfills the HSQF and an
acceptable level of software quality, the authors would like to define software testing as the
procedure.
When a software team tries to create a functioning application, testing takes up at least
half of their time. The success rate of a product's release is increased via software testing, which
is not an easy task. The purpose of testing must be clearly understood to know what an
organization is attempting to accomplish when determining if its product is ready for release to
carry out testing on software products effectively. Testing should aim to prevent bugs, according
to (Beizer, 2003). The two appear to agree with each other's concept of software testing (Myers,
1979). Testing and test design, according to (Beizer, 2003), "should be able to identify symptoms
caused by bugs, but they do not prevent bugs." Testing should attempt to identify odd behaviors
in the way the system functions that are brought on by these problems rather than concentrating
on the faults themselves. Better test design than testing itself helps to prevent errors. A bug is a
mistake or flaw in a system's operation that affects the system's operation. Software testing is
essential to counteract human error, which will inevitably occur. Some errors are less costly than
others, but some are harmful and may lead to economic loss. However, there is a claim that
software testing should concentrate more attention on boosting the user's confidence that the
system will function properly in all conditions rather than only concentrating on detecting
defects in the system. The author thinks this is a more important objective to pursue during
software testing because customer confidence when using the product has a bigger impact on its
success than simply reducing the number of faults it contains. Due to this, the author thinks that
software testing's goal should be to verify the product meets the users' acceptance criteria while
lowering the number of problems in the software.
This section will detail the different testing techniques performed in assuring quality of a
software product.
According to Hetzel (1984), it makes little sense to functionally test a group of programs
until they interact effectively. Integration testing's goals are to verify the system's behavior after
modules have been integrated together rather than to worry about requirements. Prior to
combining and testing small system components, they are evaluated individually. To see that
system components, behave the same way when integrated with other components, this is done.
The top-down and bottom-up techniques for integration testing are both widely used. Low level
system modules should be tested first, then higher level modules, to ensure seamless integration.
Instead of evaluating top modules first before testing them with lower-level modules, the top-
down approach tests top modules last. An approach to integration testing is suggested by (Hetzel,
1984) as follows:
1. Choose a small collection of modules that each support a single piece of essential
functionality and are simple enough to test individually.
Functional testing is testing done to increase a product's conformity to the given user
criteria. The predicted output of a task while utilizing a software component is compared with
the actual output in a functional testing technique known as unit testing. Unit testing is carried
out at the absolute lowest level or most granular level, according to (Karuturi and Gowda, 2017).
Continuous testing and revision are done in this manner. Unit testing is a subset of white box
testing, one of the testing types represented in Figure 1 where the tester is fully aware of the
internal implementation specifics and code structure. Organizations frequently utilize Junit as a
framework for unit testing. Since Java is a well-known programming language and unit testing
framework, various software development environments can use Junit. There are additional unit
testing frameworks, though, including Nunit, TestNG, Embunit, etc.
Although software testing is quite effective in creating a software product that everyone
will accept, there are several difficulties and restrictions that exist. (Professionalqa.com, 2018)
asserts that none of the following results can be attained with software testing:
• Testing merely seeks to reduce errors as much as possible; yet, having software that is
completely bug-free is almost unachievable.
• Software testing cannot forecast or estimate how well a product will work in various
scenarios.
In today's generation, software development is one of the most potent, essential, and
necessary fields. Every organization, industry, small business, institute, etc. needs software to
operate their system and lessen the manual or conventional job that was once unsafe and prone to
blunders. The core principles of SDLC center on minimizing risk and failure while maximizing
product quality. The SDLC was developed specifically to make development work in a step-by-
step fashion. The software development life cycle (SDLC) outlines the framework with many
activities and tasks to be completed during the software development process.
The Software Development Life Cycle Model is a diagram that outlines the general process
of software development, with each phase outlining how it is carried out. There are numerous
sorts of models, including the agile model, the V-shaped model, the evolutionary prototyping
model, the spiral model, and the waterfall model.
To ensure a project's success, it may be necessary to select the appropriate SDLC model
based on the problems and needs of the project.
Every model has benefits and drawbacks. It depends on how our projects are going, and we
must use the model in accordance with the specifications.
Since the creation of the computer, software development procedures and processes have
changed over time. With this advancement, new software development techniques have emerged
from worldwide private and public software development activities.
These approaches differ, but they all aim to create software as affordably, effectively, and
efficiently as possible.
The Waterfall model is a linear and sequential approach to software development. It consists
of distinct phases such as requirements gathering, design, implementation, testing, deployment,
and maintenance. Each phase is completed before moving on to the next, and it is difficult to go
back to a previous phase once completed.
The Waterfall model in SDLC (Software Development Life Cycle) is the first model
introduced to represent the development of software in divergent phases.
The waterfall method prevents the process from returning to a previous phase and allowing
adjustments to it. Small projects typically adopt the waterfall approach since there is minimal
room for adjustments after a stage is complete. In a waterfall model, issues cannot be resolved
until the maintenance stage. Phases such as requirement analysis, system design,
implementation, testing, deployment, and maintenance are included in the waterfall model's
phases.
1. Requirement Analysis: Gathering and evaluating the project's requirements is the first
phase in the Waterfall methodology. This entails knowing the project's scope, locating the
stakeholders, and compiling data on the target audience.
2. System Design: The second stage is to design the software. This entails developing a
software architecture, determining the system's constituent parts, and specifying how these parts
communicate with one another.
3. Implementation: After the design is finished, the implementation phase starts. This entails
creating the software's code, putting its components together, and testing it.
4. Testing: The software is tested in the next stage. Unit, integration, system, and
acceptability testing are all included in this.
The waterfall model's flaw is fixed by the iterative model, which uses an iterative. Iterative
models acquire needs during each step, as opposed to waterfall models where they were only
needed once. The project is broken up into smaller parts so that the outcome can be applied in
the following stage. The client's feedback is gathered following each increment and used to
determine the next step to be planned and modified. Every phase produces the latest version of
the software, which is then created again until the entire system is ready.
The waterfall concept is expanded upon in the V-shaped model. The V-shaped model
illustrates the connections between each stage of development and its corresponding testing
stage. The phrase "verification and validation model" is another name for it. This is so because
there is a validation phase that goes along with every verification phase. Any software's primary
feature is to be evaluated for performance. It must undergo numerous tests. As a result, testing is
the focus of the V-shaped model. Validation guarantees that all the development was done
correctly, whereas verification concentrates on it. There is a lot of testing done in this process,
which is extremely dynamic. The 'tester's life cycle' is another name for these actions.
One of the most significant models for the Software Development Life Cycle (SDLC) that
combines the waterfall and iterative methods for risk management is the spiral model. Barry
Boehm initially mentioned the spiral model in his work from 1986. Every phase in this paradigm
begins with a design objective and concludes with the client reviewing the development. Large
projects that involve risk and cost with every change are used in this strategy. As indicated in the
below diagram, the spiral model contains four distinct phases, including planning, risk analysis,
engineering, and evaluation.
Figure 4 Spiral Model
Agile design approaches such Scrum and Kanban prioritize iterative and incremental
development. Sprints, which are short iterations of the development process that last 1-4 weeks,
are used. Agile places a strong emphasis on communication, adaptability, and cooperation. It
encourages ongoing client interaction and feedback throughout the development process.
Each Agile project typically has a customer representative on the team to create close contact
with the customer during development and to clearly grasp varied requirements. Stakeholders
and the customer representative examine and reevaluate the requirements at the conclusion of
each iteration.
Agile models rely less on extensive documentation and more on the deployment of functional
software. Transmission of incremental software updates regularly, spaced by a few weeks, to the
customer representative.
The importance of having effective team members and improving communications within
them is emphasized. It is understood that face-to-face communication, rather than formal
document exchange, can improve communication among development team members.
To enable the team members to genuinely engage in face-to-face contact and foster a
collaborative work atmosphere, it is advised that the development team be maintained small (5 to
9 people).
Pair programming is typically used in the agile development process. Two programmers
collaborate on a single workstation during pair programming. One person codes, while the other
person checks the code as it is entered. Every hour or so, the two programmers trade places.
The Software Development Life Cycle (SDLC) offers several advantages for organizations
and software development teams. Here are some key advantages of following an SDLC
approach:
Structured and Organized Process: The SDLC offers a structured and systematic approach
to software development, guaranteeing that all required actions are taken in a comprehensible
order. It facilitates project planning and organization from beginning to end, which lessens
confusion and increases efficiency.
Risk Management: The main goal of SDLC methodologies is to monitor and control risks
throughout the project. Potential problems can be resolved effectively through carrying out risk
assessments and mitigation plans at each level. It helps in reducing project challenges, holdups,
and cost overruns.
Scalability and Flexibility: SDLC models offer the capacity to scale and flexibility to
handle projects of many sizes and complexity levels. It does not matter if the project is a small
one with few resources or a massive corporate application—SDLC methodologies may be
customized and adjusted to meet the unique requirements of each.
Overall, SDLC methodologies bring discipline, structure, and efficiency to the software
development process. They offer a structure for successfully organizing, carrying out, and
delivering high-quality software solutions while lowering risks and boosting client satisfaction.
Software development life cycle is a methodical process that guarantees the quality and
accuracy of the software created. The structure enforced by this SDLC is purposefully created to
increase the likelihood that a software development effort will be successful. It comprises of a
thorough strategy that outlines how to organize, create, and maintain software. Every piece of
software starts out as a concept and progresses through various stages before being built and
released. Up until the day it is decommissioned or replaced, an application or system's software
development life cycle is still active and adding updates and new features. Over the years,
several software development techniques have developed.
A life cycle is the progression through several forms that a thing goes through. From
beginning to end, many distinct and concrete entities undergo many transformations. The
software is an entity when discussing the software testing life cycle. The process of carrying out
various operations while testing is known as the software testing life cycle.
The main goal of STLC is to guarantee the product's quality. Every application differs in
terms of performance, usefulness, and reliability. And STLC makes it easier to improve these
qualities and create a perfect final output.
Requirement Analysis
The specifications and requirements must be viewed, studied, and analyzed by your
important software testers. By providing certain requirements with input data, they can yield
results. These requirements can be put to the test. Both functional and non-functional
requirements are examined by testers. They must then choose testable requirements after that.
During this phase, tasks like requirement analysis brainstorming and test requirement
identification and prioritization are undertaken. They also involve identifying requirements for
both human and automated testing. Even if they are not mentioned directly, a few items require
testing. A phone number text field should not allow entered alphabets when a button is active
and should do some action when clicked.
These concepts should constantly be examined because they are widely used. However, the
goal of the requirement analysis stage is to get more precise information about the product. You
must understand the perfect state of the product. This phase also analyzes the viability of test
automation and produces a complete requirement report as deliverables.
By making sure that every testing effort is linked to a need that adds value for the client, you
can eliminate waste in this manner. Briefly stated:
Test Planning
The QA (Quality Assurance) team designs the test plan in the second stage after reviewing
all the relevant testing requirements. After comprehending the product domain, they define the
scope and goals. To develop a strategy, the team first evaluates the risks involved and establishes
timetables and testing settings.
After that, management completes the tools and assigns people to specific jobs and duties.
Also specified is a rough timetable for when testing for each module is to be finished. The test
plan, a document outlining the purpose and specifics of the testing activities for a given project,
is the most crucial output produced in this step. To summarize:
By determining which test cases are most frequent or have the greatest potential to affect the
product, you can order them in order of importance. The documentation stage then moves on to
the verification and validation of the stated requirements. Additionally, crucial procedures at this
stage include reviewing, updating, and approval of automation scripts and test cases.
Determining various test conditions, together with the input data and anticipated results, is
another step in this process. As a result, the actual test cases arranged in their test suites are the
key deliverables created during this phase. Briefly stated:
Find out more about the product and collect potential actions.
Establish test cases.
Prioritize the test cases.
For test cases, create automated scripts.
Test Execution
Once the team has completed all the earlier stages, the application is prepared for testing. The
testers carry out test cases in accordance with the test plan. Additionally, they recognize, detect,
and log the flaws, thereby reporting the faults. The team is also in charge of contrasting actual
results with those that were anticipated. If any bugs are discovered, they must be recorded so that
the development team can fix them.
Testing for regressions starts as soon as a bug is fixed by the development team. Regression
testing verifies that the program or application continues to function even after a modification
has been deployed.
It is also advised to utilize scripts or automated testing tools because the same tests must be
repeated after each patch and release. The test results, which should be confirmed and
communicated automatically, might be considered the major deliverables in this phase. To
summarize:
Test Closure
The test closing phase begins after test execution is complete and the finished product is
delivered. The QA team reviews the test results and has a team discussion about them. They also
consider project cost, test coverage, and product quality. Further analyses can be performed to
determine what went wrong if actual data differs from the estimates.
Getting together to discuss the results after testing is a crucial habit for testers. We can
address any problems encountered during testing or weaknesses in our approach here. Based on
what you learn from testing, you can focus on developing a better testing strategy. Testing is
routine if you use the DevOps or canary release methodology.
In addition, the team considers test data, target completion, and deadline observance. They
can assess the entire testing strategy and process after they have a complete understanding of
what transpired. To summarize:
Figure 6 STLC
CHAPTER 4
Manual Testing
Manual testing is a type of software testing in which a software tester generates and executes
test cases without the use of automated testing tools. Finding problems, bugs, and flaws in a
software program is the primary goal of manual testing. Before performing the automation
testing, any new software program needs to be manually tested. Manual Testing is crucial
because of the principle of software testing "100% Automation is not possible".
(Bartlett, 2016) defines manual testing as the practice of utilizing an application's features
and functionality exactly as an end user would to confirm the system's behavior. When testing
software, the tester runs tests using test cases that have already been created and records the
findings. The requirements document serves as the basis for the test cases. A black box testing
approach is manual testing. Understanding the requirements is advised to properly run manual
tests (Bartlett, 2016). An idea of what might be categorized as a software system defect can then
be created from an understanding of the requirements. According to the author, a software
system has a flaw if it does not meet the client's needs. As it can be done on any part of the
software system and it is simple to record test results and provide feedback, manual testing can
be a successful test methodology.
Before doing the manual test, a test case's expected result should be described as a method of
documentation. The likelihood of fulfilling the functional requirements increases with the
percentage of test cases that match the expected results. Respectable test cases, according to
(Bartlett, 2016), should be repeatable. This will enable different people to run the same test
without repeatedly asking questions. According to (Hetzel, 1984), it is not feasible to test every
potential scenario; instead, a selection of test cases should be made, and the planning and
attention given to that selection determines the difference between good and poor testing.
After the tests have been written, the platform for running the manual tests should be
decided. The steps outlined in each test case should be followed when executing the test case.
Each tester should use the same platform to produce reliable results. By keeping track of each
test's results, management can use them to choose when to release the software while also
determining the software's current quality. Effective bug reports should include a powerful title,
instructions on how to recreate the bug, the expected and actual findings, and any pertinent
attachments that can be used in the inquiry, according to (Bartlett, 2016).
Although manual testing allows for flexibility and human judgment, it can also be labor-
intensive, time-consuming, and prone to mistakes. However, it continues to be a crucial step in
the testing process, particularly for some tests, in the early phases of development, or when
automation is not practical or economical. To ensure effective and thorough test coverage,
automation testing methods can be used with manual testing.
Manual testing has certain drawbacks even if it is unquestionably a useful strategy for
handling test results documentation. It takes a lot of time and resources to achieve quality targets
with manual testing. Graphical user interface (GUI) object size difference and color
combinations are two crucial metrics, but they are difficult to uncover when doing manual
testing, according to (Professionalqa.com, 2018). The manual testing technique is seen to be
unsuitable for lengthy and large-scale projects. The reason for this is because it will take an
excessive amount of time to manually test each module of a big software system. Attempting to
compare massive amounts of data with manual testing would be both unreasonable and
impossible.
In contrast to manual testing, automation testing is simply a quicker method of testing. There
are studies that imply automation is a better alternative to manual testing, and the use of
automation in the context of software engineering is a well-developed research area.
• Initial Investment: An initial time, effort, and resource investment is needed to set up an
automation testing framework and create test scripts. For businesses with tight schedules or little
finances, this might be a problem. • Skill and Knowledge Requirements: Testers that are skilled
in scripting languages, test automation tools, and frameworks are needed for automation testing.
It might be difficult to locate qualified personnel and to offer the appropriate training,
particularly for firms that are new to automation testing.
• Test Case Selection: Not every test case can be automated. Thorough preparation and
analysis are needed to decide which test cases should be automated and which should be run
manually. There may still be times when manual intervention is necessary, for as in usability
testing or exploratory testing.
• Maintenance Work: To keep automated test scripts current with software upgrades,
constant maintenance is necessary. The automation suite maintenance may require more time
and resources as the program develops because scripts may need to be modified.
• Script Stability and Fragility: Automated test scripts may be vulnerable to modifications
made to the underlying technology or user interface of the program. Scripts may fail or give false
negatives because of minor UI tweaks or program updates, necessitating script revisions.
• Test Data Management: For automation testing, effective test data management is
essential. It can be difficult and time-consuming to create and manage test data sets that cover a
variety of scenarios, especially when working with massive amounts of data.
• Complex Testing Scenarios: Automating some testing scenarios, like those involving
complex workflows or multi-threaded operations, can be difficult. It could take more time and
effort to write test scripts to handle such cases.
• Limited Human Judgment: Unlike manual testing, automation testing lacks the human
judgment and intuition it offers. Testing professionals could overlook minute flaws or
unanticipated problems that exploratory or ad hoc testing can reveal.
• The Cost of Test Automation Tools: Test automation tools and licensing, particularly for
enterprise-level solutions, can be costly. Organizations may have difficulties when evaluating,
choosing, and procuring effective tools within their financial capabilities.
CHAPTER 5
Automation Testing
There are numerous automation testing software tools available in the market, each with its
own features and capabilities. Here are some popular automation testing tools:
1. Selenium
2. Appium
3. Test Complete
4. JUnit
5. Cucumber
6. Robot Framework
These are only a few examples of the software tools for automation testing that are offered on
the market. It is crucial to assess the precise requirements of your project, consider aspects like
cost, support, compatibility, and convenience of use, and select the tool that best suits your
requirements.
5.1 Maven
The Apache Group created the well-known open-source build tool Maven to build, publish,
and deploy several projects simultaneously for better project management. Developers can create
and document the lifecycle framework using the provided tool.
Projects created in C#, Scala, Ruby, etc. are built using Maven, a Java tool. This tool, which
is based on the Project Object Model (POM), has made it simpler for Java developers to create
reports, check builds, and test automated settings. Maven primarily aids in the download of
dependencies, which are libraries or JAR files, for Java-based applications. Due to the possibility
of various versions of individual packages, the tool aids in obtaining the appropriate JAR files
for each project.
5.2 TestNG
A well-known testing framework for Java-based applications is called TestNG (Test Next
Generation). It offers additional functions for test execution and test management and is intended
to overcome some shortcomings of the more traditional JUnit framework.
For testing Java applications, TestNG offers a wealth of functionality and a strong, adaptable
architecture. It encourages test reuse, efficient test execution, and code maintainability. All types
of tests, including unit, functional, end-to-end, integration, etc., are covered by TestNG.
5.3 Selenium
Selenium is a portable testing framework mostly used for web-based applications testing.
When Jason Huggins tested an internal application at Thought Works in 2004, he concluded
there was a better way to test than with manual testing. Because Selenium is free software, its
source code can be obtained and correctly updated. This utility works with Firefox, Chrome, and
Internet Explorer and may be used on a variety of operating systems, including Linux and
Windows. Numerous programming languages, including Java, Perl, C#, Ruby, Python, and
others, are supported by Selenium. Selenium can be used with other tools to make it easier to
use.
This approach initially seems difficult and slow in the short run, raising the overall quality of
the software project. However, the long-term benefits of improved code quality and
maintainability make it a valuable practice for many software development teams. Enough test
coverage provides as a precaution to prevent unintentionally changing the functionality.
Selenium Cheat Sheet is a reference guide for learning Selenium commands, navigators,
operations, locators etc.
5.6 Framework Design
The Page Object Model (POM) design pattern is widely used in test automation to improve
the maintainability and reusability of automated tests. It helps in the structuring of test code and
separating of it from the user interface within the underlying web application.
POM represents each web page or user interface as a separate class that encapsulates the
page's elements and interactions. This supports code modularity, enabling page objects to be
reused across various test cases and test suites. This reusability eliminates code duplication and
simplifies test maintenance. Any changes to the web application's user interface or element
locators can be handled by updating the relevant Page Object class. The changes will
automatically propagate to all test cases using that page object. This significantly reduces the
maintenance effort when the UI progresses or changes.
Figure 11 Page Class
5.6.2 POM.xml
Maven defines the project structure, dependencies, and configurations using a Project Object
Model (POM). The POM is an XML file with the extension pom.xml that acts as the project's
main configuration and administration file.
The project home directory is where you may find the XML file. Maven looks for the POM
in the current directory when you run a task.
TestNG test suite XML files are configuration files used to define the test suites and their
configurations for executing tests in TestNG. These XML files help organize and manage the
execution of test cases, allowing testers to group related tests, specify test parameters, and
control the test execution flow. XML files provide a flexible and organized way to manage test
configurations and executions, making it easier to control the behavior of test suites and tailor
them to specific test requirements.
5.6.5 Dependencies
Dependencies are the connections among various components or modules in a project in the
context of software development. When one module depends on another for functionality, there
is a dependence. Maintaining an orderly, manageable, and scalable codebase requires an
understanding of and ability to manage dependencies.
5.6.6 Utilities
Utility classes in Java are also known as assistance classes. It is an effective way for creating
reusable methods. A utility class can hold code that we often use. In Java, the final and public
keywords are not allowed to be used to create or define the empty utility class. Because object
methods must be generated, the methods of the utility class should be tagged static rather than
abstract. The final keyword forbids subclassing.
5.6.8 Reports
Test reporting provides essential information about the testing process, including
gaps and obstacles, in the context of continuous testing. Teams can postpone the
software release procedure until the issues are repaired, for example, if a test report
reveals numerous unresolved flaws.
The next-to-last phase before a product is released onto the market is software
testing. It involves looking at, analyzing, observing, and rating various parts of a
product; thus, it is essential to provide a report that can highlight the success of a
product. As a TDD framework, TestNG requires an accurate reporting system. To
generate reports in html format, we extended the report dependency in our
TestBaseReport class under the utilities folder by adding it to the pom.xml file.
Additionally, for better comprehension, we included the possibility of taking screenshots
of errors.
Figure 20 Test Base Report Folder
Parallel Testing
Parallel execution was performed to reduce testing time that required multiple browsers running
simultaneously. Test suite xml code was added into testing.xml file to achieve Parallel Testing.
The thread-count field gives us flexibility to run how many tests that we want simultaneously. The
verbose field gives us the report style that we need, such as only info or debug or more detail report. We
can use the verbose level between 1-10.
Regression Testing
Regression testing is a crucial software testing process that verifies that recent
changes or additions to a software application have not adversely affected existing
functionality.
Figure 25 Regression Test Result Smoke Testing
Version Control
GitHub is a web-based service for version control using Git. This feature is extremely useful
to keep track of developers and test engineers working simultaneously in the project.
The Shein website testing project was undertaken to evaluate the functionality, usability,
and overall quality of the Shein e-commerce website. The testing process involved diverse types
of testing, including functional testing, usability testing, performance testing. TestNG was used
as a framework to create a robust and organized test suite for testing the various functionalities of
the Shein website. The TestNG framework allowed us to execute tests in a structured manner,
manage test dependencies, and generate comprehensive test reports. The initiative to test the
Shein website using the TestNG framework was successful overall. We were able to thoroughly
test crucial features, confirm how the program behaved, and offer the development team
insightful feedback. TestNG's automation and organization increased testing productivity and
assisted in spotting potential problems early in the development cycle.
Furthermore, Testing e-commerce websites like Shein can indeed be challenging, primarily
due to the dynamic nature of web applications. Web element locators and page structures tend to
change frequently, making test maintenance a continuous effort. Some of the challenges we
faced during testing Shein include:
1. Dynamic Locators: Web element locators (we used XPath) can change whenever the
website's code is updated or redesigned. This necessitates updating the locators in test scripts,
which can be time-consuming and error prone.
2. Unpredictable Changes: Since e-commerce websites are subject to frequent updates and
improvements, changes can occur without prior notice. We had to update or recreate new test
cases during the project.
3. High Test Maintenance: Frequent changes in web element locators and page structures lead
to high test maintenance overhead. Test cases that were once stable may start failing due to
the changes, demanding regular updates.
4. Data Variability: E-commerce websites handle substantial amounts of dynamic data, such as
product catalogs, prices, and user profiles. Testing with a diverse set of data is crucial to
uncover potential issues related to data handling.
5. Performance Testing: E-commerce websites experience significant traffic during peak
periods, like sales events. Conducting performance testing to assess how the website
performs under heavy load is essential to avoid potential bottlenecks.
Despite all the challenges throughout the testing process, we successfully designed and
executed test cases covering critical aspects of the Shein website, including user registration,
product search, add to cart functionality, checkout process, and account management.
References