Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Selenium Design Patterns and Best Practices
  • Toc
  • feedback
Selenium Design Patterns and Best Practices

Selenium Design Patterns and Best Practices

By : Kovalenko
3.9 (11)
close
Selenium Design Patterns and Best Practices

Selenium Design Patterns and Best Practices

3.9 (11)
By: Kovalenko

Overview of this book

Selenium WebDriver is a global leader in automated web testing. It empowers users to perform complex testing scenarios with its simple and powerful interface. This guide will provide you with all the skills you need to successfully create a functional Selenium test suite. Starting from the very beginning of the Selenium IDE, this book will show you how to transition into a real programing language such as Ruby or Java. You will quickly learn how to improve your code quality with refactoring and the skills needed to plan for the future development of your website to future-proof your test suite. With ample test examples running against a life-like e-commerce store and detailed step-by-step code review and explanations, you will be ready to test any challenge web developers might throw your way. This book is intended for anyone who wants to create a test suite that is easy to maintain by expanding your knowledge until you feel truly confident and comfortable with Selenium.
Table of Contents (11 chapters)
close
10
Index

Refactoring tests


Since this chapter will be focused on refactoring tests, let's first define this term. Refactoring is the act of restructuring your code to improve the internal efficiency, stability, and long-term maintainability without adding or modifying any of the underlying functionalities. At the end of the refactoring session, we should not have any new tests; the only goal is to improve the existing tests.

Since there are no obvious instant results such as having 10 more new tests, refactoring may seem like a waste of time. However, having two tests that do not randomly fail is a lot more productive in the long run than having 12 tests that cannot be relied on. Refactoring your tests is similar to calisthenics; if you don't exercise, you will probably die of a heart attack 20 years before your time. That being said, we will not add any new tests in this chapter. Instead, we will improve the product review tests in Chapter 2, The Spaghetti Pattern.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete