Automate Application with Specflow and Selenium WebDriver C#

Video description

SpecFlow is a framework that brings Behavior-Driven Development (BDD) into life. It is all about filling the gap between technical people and domain experts. SpecFlow is based on the Gherkin language. So, non-technical people can write executable documentation on their own.

Selenium is a framework that drives browsers (Chrome, Firefox, Opera, and more). In other words, with the power of Selenium, you can write a program that automatically interacts with elements on a web page.

TestStack.White (sometimes, written called teststack white) is a framework drives WinForms and WPF applications.

This course covers:

•Theoretical background behind different types of testing (unit, integration, and acceptance testing)

•SpecFlow: generating steps, running and debugging tests, passing parameters, scenario outlines, data tables, converting parameters, converting data tables, custom conversions, sharing data, categorizing tests, scoped execution, hooks, and other features

•Selenium WebDriver: Locators, XPath locators, CSS locators, interacting with all element types, timeouts (explicit and implicit), locator priorities, picking scenarios to Test, the Page Object design pattern, the Page Object factory, uploading files, and more

•Scraping a live website with Selenium WebDriver

•Selenium Extras: managing a web browser

•TestStack.White and building a WPF app by TDD (with MVVM)

•Appendices: intro to unit testing and test-driven development

What You Will Learn

  • Build end-to-end tests to grow reliable software
  • TestStack.White and building a WPF app by TDD (with MVVM)
  • Appendices: intro to unit testing and Test-Driven Development
  • Automate WPF applications


This course is for middle-level developers who require a proficiency in C#

About The Author

ENGINEERSPOCK EDUCATION LLC: Ilya Fofanov began his career as a postgraduate student participating in the Microsoft ImagineCup contest. He's been working with the .NET platform since 2003 and has been professionally architecting and implementing software for nearly 7 years, primarily based on the .NET platform. He is passionate about building rich and powerful applications using modern technologies. Ilya is a Microsoft-certified specialist in Windows Applications and Service Communication Applications and one of the coordinators of the MskDotNet User Group in Moscow.

Publisher resources

Download Example Code

Table of contents

  1. Chapter 1 : Introduction to Integration and Acceptance Testing
    1. Outline
    2. Types of Tests and TDD
    3. Integration and UI Testing
    4. Are Integration Tests Pure Evil?
    5. Why Write Automated UI-Tests?
    6. What is Acceptance Testing?
    7. Acceptance and UI-Automation Testing Frameworks
    8. Conclusion
  2. Chapter 2 : Introduction to SpecFlow
    1. Outline
    2. Why Use SpecFlow
    3. BDD vs ATDD
    4. SpecFlow Workflow
    5. Overview of SpecFlow
    6. Gherkin. Features and Scenarios
    7. Basics of SpecFlow
    8. Two Approaches to Implementation of Acceptance Tests
    9. Conclusion
  3. Chapter 3 : SpecFlow in Details
    1. Outline
    2. Generating Steps in Details
    3. Overview of Example
    4. Writing the First Test
    5. Running and Debugging Tests
    6. Adding New Cases
    7. Passing Parameters
    8. Scenario Outline
    9. Passing Data Table
    10. Scenario Background
    11. Converting Parameter Types
    12. Converting Tables into Plain Data Structures
    13. Converting Tables into Sets
    14. Custom Conversions
    15. Sharing Data Between Steps
    16. Categorizing Tests by Tags
    17. Scoped Execution
    18. Scoped Binding and Workflow
    19. Hooks Overview
    20. Applying a Hook
    21. Conclusion
  4. Chapter 4 : Introduction to Selenium
    1. Selenium Overview
    2. Demo Web Site
    3. Writing the First Automation Example
    4. Locator Types
    5. XPath Selectors
    6. CSS Selectors
    7. Input, CheckBox, RadioButton, DropDown
    8. Dynamic Nature of Modern Web Sites
    9. Timeouts: Implicit and Explicit
    10. Locators Priority
    11. Which Scenario to Test
    12. SpecFlow and UI-Testing Frameworks
    13. Conclusion
  5. Chapter 5 : Selenium: Scraping a Live Web Site
    1. Outline
    2. Web Site Overview
    3. Setting Up a Project
    4. Sign-In Page
    5. "Page Object" Design Pattern
    6. Enhancing "Page Object" Design Pattern
    7. Refactoring with "Page Object"
    8. Uploading Files - Preparation
    9. Uploading Files - Coding
    10. Conclusion
  6. Chapter 6 : Selenium Extras
    1. Outline
    2. Writing Tests for Different Browsers
    3. Location and Size
    4. Opening Tabs and Windows
    5. Switching and Closing Tabs and Windows
    6. Conclusion
  7. Chapter 7 : TestStack.White and WPF App by TDD
    1. Outline
    2. Application Overview
    3. TestStack.White Overview
    4. Writing Acceptance Tests
    5. Building a Bridge to User Interface Applying "Page Object" Design Pattern
    6. Implementing Acceptance Tests
    7. Implementing ViewModels using TDD. Part 1
    8. Implementing ViewModels using TDD. Part 2
    9. Conclusion
  8. Chapter 8 : Appendix A. Introduction to Unit Testing. Getting Started
    1. Outline
    2. What is a Unit Test?
    3. Unit-Testing Frameworks
    4. First Unit Test
    5. Naming Conventions
    6. Running and Debugging Tests in Visual Studio
    7. Benefits of Unit Testing
    8. Who should write Unit Tests and When?
    9. Programmer's Oath
    10. Exercise: Stack
    11. Solution: Stack
    12. Conclusion
  9. Chapter 9 : Appendix A. Introduction to Unit Testing. NUnit Framework
    1. Outline
    2. Assert. Introduction
    3. Assert. Demo
    4. Arrange-Act-Assert
    5. Running a Test from the Console
    6. SetUp and TearDown
    7. SetUp and TearDown on Higher Levels
    8. Parameterized Tests
    9. Grouping and Ignoring
    10. Code Coverage
    11. Exercise: FizzBuzz
    12. Solution: FizzBuzz
    13. Exercise: Roman Numerals
    14. Solution: Roman Numerals
    15. Conclusion
  10. Chapter 10 : Appendix B. Introduction to TDD. Part 1
    1. Outline
    2. Why we need TDD?
    3. What is TDD?
    4. Red / Green / Refactor
    5. Three Laws of TDD
    6. Changing Requirements and the Safety Net
    7. F.I.R.S.T.
    8. Testing Frameworks and Tools
    9. When TDD Fails?
    10. Conclusion
  11. Chapter 11 : Appendix B. Introduction to TDD. Part 2
    1. Outline
    2. Regular Agile Process in 200 Words
    3. VS and R# Shortcuts
    4. Fibonacci Numbers
    5. Three Main TDD Techniques
    6. Grabbing the Gold
    7. FizzBuzz
    8. Reading Roman Numerals
    9. UpdateableSpin
    10. Continuous Testing
    11. Tic-Tac-Toe (Crosses and Noughts)
    12. Assert First
    13. Demo - Sticks
    14. Conclusion

Product information

  • Title: Automate Application with Specflow and Selenium WebDriver C#
  • Release date: February 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781800208964