Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium Design Patterns and Best Practices

You're reading from   Selenium Design Patterns and Best Practices Build a powerful, stable, and automated test suite using Selenium WebDriver

Arrow left icon
Product type Paperback
Published in Sep 2014
Publisher
ISBN-13 9781783982707
Length 270 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dima Kovalenko Dima Kovalenko
Author Profile Icon Dima Kovalenko
Dima Kovalenko
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Writing the First Test FREE CHAPTER 2. The Spaghetti Pattern 3. Refactoring Tests 4. Data-driven Testing 5. Stabilizing the Tests 6. Testing the Behavior 7. The Page Objects Pattern 8. Growing the Test Suite A. Getting Started with Selenium Index

Chapter 1. Writing the First Test

 

"Self-education is, I firmly believe, the only kind of education there is."

 
 --Isaac Asimov

In this book, we will simulate my personal experience of testing e-commerce systems. We will start by writing a very simple and crude test case, and we will refactor it and grow it into a stable and reliable test suite. A web store example might not apply to everyone's job, but the examples provided should be general enough to apply to any situation.

Today is our first day on the job; you and I are the sole members of the newly formed Quality Assurance team for the little start-up that sells Valentine's Day cards. It's a small company and the pay is not the greatest; however, just like any small start up, we get some company stock. This means that we can be very rich and famous if the website becomes popular. The website needs to stay operational and bug free, or our customers will never return and I will not be able to purchase that yacht I always wanted.

We know that we are short-staffed and need some automated tests to keep the quality high. However, first we need to convince the owner of the company that test automation is the right direction, instead of just testing everything by hand. We need to provide a cost-effective way to test the website and get quick results!

In this chapter, we will make an argument for using Selenium as our automation tool of choice and write a simple test to show how fast we can start building new tests. We will discuss the following topics along the way:

  • Why you should use Selenium over other tools
  • The Record and Playback pattern
  • The Selenium IDE
  • Recording a test with the Selenium IDE
  • Selenium WebDriver
  • Writing a test with Ruby
  • The Test::Unit testing framework
  • Interactive test debugging
You have been reading a chapter from
Selenium Design Patterns and Best Practices
Published in: Sep 2014
Publisher:
ISBN-13: 9781783982707
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image