1141 NET test automation recipes

389 196 0
1141  NET test automation recipes

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

...6633FM.qxd 4/3/06 1:54 PM Page i NET Test Automation Recipes A Problem-Solution Approach James D McCaffrey www.it-ebooks.info .NET Test Automation Recipes Copyright © 2012 by James D McCaffrey... writing lightweight software test automation in a NET environment If you develop, test, or manage NET software, you should find this book useful Before NET, writing test automation was often as difficult... level NET programming Advantages of Lightweight Test Automation The automation techniques in this book are intended to complement, not replace, other testing paradigms, such as manual testing, test- driven

Ngày đăng: 11/07/2018, 16:00

Từ khóa liên quan

Mục lục

  • Cover

    • Contents at a Glance

    • Contents

    • About the Author

    • About the Technical Reviewer

    • Acknowledgments

    • Introduction

      • Unknown

        • What This Book Is About

        • Who This Book Is For

        • Advantages of Lightweight Test Automation

        • Coding Issues

        • Contents of This Book

        • Using the Code in This Book

  • API Testing

    • 1.0 Introduction

    • 1.1 Storing Test Case Data

      • Problem

      • Design

      • Solution

      • Comments

    • 1.2 Reading Test Case Data

      • Problem

      • Design

      • Solution

      • Comments

    • 1.3 Parsing a Test Case

      • Problem

      • Design

      • Solution

      • Comments

    • 1.4 Converting Data to an Appropriate Data Type

      • Problem

      • Design

      • Solution

      • Comments

    • 1.5 Determining a Test Case Result

      • Problem

      • Design

      • Solution

      • Comments

    • 1.6 Logging Test Case Results

      • Problem

      • Design

      • Solution

      • Comments

    • 1.7 Time-Stamping Test Case Results

      • Problem

      • Design

      • Solution

      • Comments

    • 1.8 Calculating Summary Results

      • Problem

      • Design

      • Solution

      • Comments

    • 1.9 Determining a Test Run Total Elapsed Time

      • Problem

      • Design

      • Solution

      • Comments

    • 1.10 Dealing with null Input/null Expected Results

      • Problem

      • Design

      • Solution

      • Comments

    • 1.11 Dealing with Methods that Throw Exceptions

      • Problem

      • Design

      • Solution

      • Comments

    • 1.12 Dealing with Empty String Input Arguments

      • Problem

      • Design

      • Solution

      • Comments

    • 1.13 Programmatically Sending E-mail Alerts on Test Case Failures

      • Problem

      • Design

      • Solution

      • Comments

    • 1.14 Launching a Test Harness Automatically

      • Problem

      • Design

      • Solution

      • Comments

    • 1.15 Example Program: ApiTest

  • Reflection-Based UI Testing

    • 2.0 Introduction

    • 2.1 Launching an Application Under Test

      • Problem

      • Design

      • Solution

      • Comments

    • 2.2 Manipulating Form Properties

      • Problem

      • Design

      • Solution

      • Comments

    • 2.3 Accessing Form Properties

      • Problem

      • Design

      • Solution

      • Comments

    • 2.4 Manipulating Control Properties

      • Problem

      • Design

      • Solution

      • Comments

    • 2.5 Accessing Control Properties

      • Problem

      • Design

      • Solution

      • Comments

    • 2.6 Invoking Methods

      • Problem

      • Design

      • Solution

      • Comments

    • 2.7 Example Program: ReflectionUITest

  • Windows-Based UI Testing

    • 3.0 Introduction

    • 3.1 Launching the AUT

      • Problem

      • Design

      • Solution

      • Comments

    • 3.2 Obtaining a Handle to the Main Window of the AUT

      • Problem

      • Design

      • Solution

      • Comments

    • 3.3 Obtaining a Handle to a Named Control

      • Problem

      • Design

      • Solution

      • Comments

    • 3.4 Obtaining a Handle to a Non-Named Control

      • Problem

      • Design

      • Solution

      • Comments

    • 3.5 Sending Characters to a Control

      • Problem

      • Design

      • Solution

      • Comments

    • 3.6 Clicking on a Control

      • Problem

      • Design

      • Solution

      • Comments

    • 3.7 Dealing with Message Boxes

      • Problem

      • Design

      • Solution

      • Comments

    • 3.8 Dealing with Menus

      • Problem

      • Design

      • Solution

      • Comments

    • 3.9 Checking Application State

      • Problem

      • Design

      • Solution

      • Comments

    • 3.10 Example Program: WindowsUITest

  • Test Harness Design Patterns

    • 4.0 Introduction

    • 4.1 Creating a Text File Data, Streaming Model Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 4.2 Creating a Text File Data, Buffered Model Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 4.3 Creating an XML File Data, Streaming Model Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 4.4 Creating an XML File Data, Buffered Model Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 4.5 Creating a SQL Database for Lightweight Test Automation Storage

      • Problem

      • Design

      • Solution

      • Comments

    • 4.6 Creating a SQL Data, Streaming Model Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 4.7 Creating a SQL Data, Buffered Model Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 4.8 Discovering Information About the SUT

      • Problem

      • Solution

      • Comments

    • 4.9 Example Program: PokerLibTest

  • Request-Response Testing

    • 5.0 Introduction

    • 5.1 Sending a Simple HTTP GET Request and Retrieving the Response

      • Problem

      • Design

      • Solution

      • Comments

    • 5.2 Sending an HTTP Request with Authentication and Retrieving the Response

      • Problem

      • Design

      • Solution

      • Comments

    • 5.3 Sending a Complex HTTP GET Request and Retrieving the Response

      • Problem

      • Design

      • Solution

      • Comments

    • 5.4 Retrieving an HTTP Response Line-by-Line

      • Problem

      • Design

      • Solution

      • Comments

    • 5.5 Sending a Simple HTTP POST Request to a Classic ASP Web Page

      • Problem

      • Design

      • Solution

      • Comments

    • 5.6 Sending an HTTP POST Request to an ASP.NET Web Application

      • Problem

      • Design

      • Solution

      • Comments

    • 5.7 Dealing with Special Input Characters

      • Problem

      • Design

      • Solution

      • Comments

    • 5.8 Programmatically Determining a ViewState Value and an EventValidation Value

      • Problem

      • Design

      • Solution

      • Comments

    • 5.9 Dealing with CheckBox and RadioButtonList Controls

      • Problem

      • Design

      • Solution

      • Comments

    • 5.10 Dealing with DropDownList Controls

      • Problem

      • Design

      • Solution

      • Comments

    • 5.11 Determining a Request-Response Test Result

      • Problem

      • Design

      • Solution

      • Comments

    • 5.12 Example Program: RequestResponseTest

  • Script-Based Web UI Testing

    • 6.0 Introduction

    • 6.1 Creating a Script-Based UI Test Harness Structure

      • Problem

      • Design

      • Solution

      • Comments

    • 6.2 Determining Web Application State

      • Problem

      • Design

      • Solution

      • Comments

    • 6.3 Logging Comments to the Test Harness UI

      • Problem

      • Design

      • Solution

      • Comments

    • 6.4 Verifying the Value of an HTML Element on the Web AUT

      • Problem

      • Design

      • Solution

      • Comments

    • 6.5 Manipulating the Value of an HTML Element on the Web AUT

      • Problem

      • Design

      • Solution

      • Comments

    • 6.6 Saving Test Scenario Results to a Text File on the Client

      • Problem

      • Design

      • Solution

      • Comments

    • 6.7 Saving Test Scenario Results to a Database Table on the Server

      • Problem

      • Design

      • Solution

      • Comments

    • 6.8 Example Program: ScriptBasedUITest

  • Low-Level Web UI Testing

    • 7.0 Introduction

    • 7.1 Launching and Attaching to IE

      • Problem

      • Design

      • Solution

      • Comments

    • 7.2 Determining When the Web AUT Is Fully Loaded into the Browser

      • Problem

      • Design

      • Solution

      • Comments

    • 7.3 Manipulating and Examining the IE Shell

      • Problem

      • Design

      • Solution

      • Comments

    • 7.4 Manipulating the Value of an HTML Element on the Web AUT

      • Problem

      • Design

      • Solution

      • Comments

    • 7.5 Verifying the Value of an HTML Element on the Web AUT

      • Problem

      • Design

      • Solution

      • Comments

    • 7.6 Creating an Excel Workbook to Save Test Scenario Results

      • Problem

      • Design

      • Solution

      • Comments

    • 7.7 Saving Test Scenario Results to an Excel Workbook

      • Problem

      • Design

      • Solution

      • Comments

    • 7.8 Reading Test Results Stored in an Excel Workbook

      • Problem

      • Design

      • Solution

      • Comments

    • 7.9 Example Program: LowLevelUITest

  • Web Services Testing

    • 8.0 Introduction

    • 8.1 Testing a Web Method Using the Proxy Mechanism

      • Problem

      • Design

      • Solution

      • Comments

    • 8.2 Testing a Web Method Using Sockets

      • Problem

      • Design

      • Solution

      • Comments

    • 8.3 Testing a Web Method Using HTTP

      • Problem

      • Design

      • Solution

      • Comments

    • 8.4 Testing a Web Method Using TCP

      • Problem

      • Design

      • Solution

      • Comments

    • 8.5 Using an In-Memory Test Case Data Store

      • Problem

      • Design

      • Solution

      • Comments

    • 8.6 Working with an In-Memory Test Results Data Store

      • Problem

      • Design

      • Solution

      • Comments

    • 8.7 Example Program: WebServiceTest

  • SQL Stored Procedure Testing

    • 9.0 Introduction

    • 9.1 Creating Test Case and Test Result Storage

      • Problem

      • Design

      • Solution

      • Comments

    • 9.2 Executing a T-SQL Script

      • Problem

      • Solution

      • Comments

    • 9.3 Importing Test Case Data Using the BCP Utility Program

      • Problem

      • Design

      • Solution

      • Comments

    • 9.4 Creating a T-SQL Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 9.5 Writing Test Results Directly to a Text File from a T-SQL Test Harness

      • Problem

      • Design

      • Solution

      • Comments

    • 9.6 Determining a Pass/Fail Result When the Stored Procedure Under Test Returns a Rowset

      • Problem

      • Design

      • Solution

      • Comments

    • 9.7 Determining a Pass/Fail Result When the Stored Procedure Under Test Returns an out Parameter

      • Problem

      • Design

      • Solution

      • Comments

    • 9.8 Determining a Pass/Fail Result When the Stored Procedure Under Test Does Not Return a Value

      • Problem

      • Design

      • Solution

      • Comments

    • 9.9 Example Program: SQLspTest

  • Combinations and Permutations

    • 10.0 Introduction

    • 10.1 Creating a Mathematical Combination Object

      • Problem

      • Design

      • Solution

      • Comments

    • 10.2 Calculating the Number of Ways to Select

    • Items from

    • Items

      • Problem

      • Design

      • Solution

      • Comments

    • 10.3 Calculating the Successor to a Mathematical Combination Element

      • Problem

      • Design

      • Solution

      • Comments

    • 10.4 Generating All Mathematical Combination Elements for a Given

    • and

      • Problem

      • Design

      • Solution

      • Comments

    • 10.5 Determining the mth Lexicographical Element of a Mathematical Combination

      • Problem

      • Design

      • Solution

      • Comments

    • 10.6 Applying a Mathematical Combination to a String Array

      • Problem

      • Design

      • Solution

      • Comments

    • 10.7 Creating a Mathematical Permutation Object

      • Problem

      • Design

      • Solution

      • Comments

    • 10.8 Calculating the Number of Permutations of Order

      • Problem

      • Design

      • Solution

      • Comments

    • 10.9 Calculating the Successor to a Mathematical Permutation Element

      • Problem

      • Design

      • Solution

      • Comments

    • 10.10 Generating All Mathematical Permutation Elements for a Given

      • Problem

      • Design

      • Solution

      • Comments

    • 10.11 Determining the kth Lexicographical Element of a Mathematical Permutation

      • Problem

      • Design

      • Solution

      • Comments

    • 10.12 Applying a Mathematical Permutation to a String Array

      • Problem

      • Design

      • Solution

      • Comments

    • 10.13 Example Program: ComboPerm

  • ADO.NET Testing

    • 11.0 Introduction

    • 11.1 Determining a Pass/Fail Result When the Expected Value Is a DataSet

      • Problem

      • Design

      • Solution

      • Comments

    • 11.2 Testing a Stored Procedure That Returns a Value

      • Problem

      • Design

      • Solution

      • Comments

    • 11.3 Testing a Stored Procedure That Returns a Rowset

      • Problem

      • Design

      • Solution

      • Comments

    • 11.4 Testing a Stored Procedure That Returns a Value into an

    • Parameter

      • Problem

      • Design

      • Solution

      • Comments

    • 11.5 Testing a Stored Procedure That Does Not Return a Value

      • Problem

      • Design

      • Solution

      • Comments

    • 11.6 Testing Systems That Access Data Without Using a Stored Procedure

      • Problem

      • Design

      • Solution

      • Comments

    • 11.7 Comparing Two DataSet Objects for Equality

      • Problem

      • Design

      • Solution

      • Comments

    • 11.8 Reading Test Case Data from a Text File into a SQL Table

      • Problem

      • Design

      • Solution

      • Comments

    • 11.9 Reading Test Case Data from a SQL Table into a Text File

      • Problem

      • Design

      • Solution

      • Comments

    • 11.10 Example Program: ADOdotNETtest

  • XML Testing

    • 12.0 Introduction

    • 12.1 Parsing XML Using XmlTextReader

      • Problem

      • Design

      • Solution

      • Comments

    • 12.2 Parsing XML Using XmlDocument

      • Problem

      • Design

      • Solution

      • Comments

    • 12.3 Parsing XML with XPathDocument

      • Problem

      • Design

      • Solution

      • Comments

    • 12.4 Parsing XML with XmlSerializer

      • Problem

      • Design

      • Solution

      • Comments

    • 12.5 Parsing XML with a DataSet Object

      • Problem

      • Design

      • Solution

      • Comments

    • 12.6 Validating XML with XSD Schema

      • Problem

      • Design

      • Solution

      • Comments

    • 12.7 Modifying XML with XSLT

      • Problem

      • Design

      • Solution

      • Comments

    • 12.8 Writing XML Using XmlTextWriter

      • Problem

      • Design

      • Solution

      • Comments

    • 12.9 Comparing Two XML Files for Exact Equality

      • Problem

      • Design

      • Solution

      • Comments

    • 12.10 Comparing Two XML Files for Exact Equality, Except for Encoding

      • Problem

      • Design

      • Solution

      • Comments

    • 12.11 Comparing Two XML Files for Canonical Equivalence

      • Problem

      • Design

      • Solution

      • Comments

    • 12.12 Example Program: XmlTest

  • Index

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan