Actions for Selenium design patterns and best practices : build a powerful, stable, and automated test suite using Selenium WebDriver
Selenium design patterns and best practices : build a powerful, stable, and automated test suite using Selenium WebDriver / Dima Kovalenko ; foreword by Jim Evans ; cover image by Jeremy Segal
- Author
- Kovalenko, Dima
- Published
- Birmingham, England : Packt Publishing, 2014.
- Copyright Date
- ©2014
- Physical Description
- 1 online resource (270 pages) : color illustrations
- Additional Creators
- Evans, Jim and Segal, Jeremy
Access Online
- Series
- Contents
- Cover; Copyright; Credits; Foreword; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Writing the First Test; Choosing Selenium over other tools; Right tool for the right job; Price; Open source; Flexibility; The Record and Playback pattern; Advantages of the Record and Playback pattern; Disadvantages of the Record and Playback pattern; Getting started with the Selenium IDE; Installing the Selenium IDE; Recording our first test; Saving the test; Understanding Selenium commands; Reading Selenese; Comparing Ruby to Selenese, Comparing Selenium commands in multiple languagesWriting a Selenium test in Ruby; Introducing Test::Unit; Introducing asserts; Interactive test debugging; Summary; Chapter 2: The Spaghetti Pattern; Introducing the Spaghetti pattern; Advantages of the Spaghetti pattern; Disadvantages of the Spaghetti pattern; Testing the product review functionality; Starting a product review test; Locating elements on the page; Using a browser''s element inspector; Introducing locator strategies; Using advanced locator strategies; Writing locator strategy code; Using chained selector strategy methods, Using the CSS selectorUsing XPath; Implementing clicks and assertions; Duplicating the product review test; Reasons for failures; The Chain Linked pattern; The Big Ball of Mud pattern; Summary; Chapter 3: Refactoring Tests; Refactoring tests; The DRY testing pattern; Advantages of the DRY testing pattern; Disadvantages of the DRY testing pattern; Moving code into a setup and teardown; Removing duplication with methods; Removing external test goals; Using a method to fill out the review form; Reviewing the refactored code; The Hermetic test pattern; Advantages of the Hermetic test pattern, Disadvantages of the Hermetic test patternRemoving test-on-test dependence; Using timestamps as test data; Extracting the remaining common actions to methods; Reviewing the test-on-test dependency refactoring; Creating generic DRY methods; Refactoring with generic methods; The random run order principle; Advantages of the random run order principle; Disadvantages of the random run order principle; Summary; Chapter 4: Data-driven Testing; Data relevance versus data accessibility; Hardcoding input data; Hiding test data from tests; Choosing the test environment; Introducing test fixtures, and Parsing fixture dataUsing fixture data in the tests; Using fixtures to validate products; Testing the remaining products; Using an API as a source of fixture data; Using data stubs; The default values pattern; Advantages of the default values pattern; Disadvantages of the default values pattern; Merging the default values pattern and the faker library; Implementing faker methods; Updating the comment test to use default values; Summary; Chapter 5: Stabilizing the Tests; Engineering the culture of stability; Running fast and failing fast; Running as often as possible
- Summary
- Whether you are an experienced WebDriver developer or someone who was newly assigned a task to create automated tests, this book is for you. Since the ideas and concepts are described in simple terms, no previous experience in computer coding or programming is required.
- Subject(s)
- Genre(s)
- ISBN
- 9781783982714 (e-book)
1783982713 (e-book)
1783982705
9781783982707 - Note
- Includes index.
View MARC record | catkey: 37435043