QF-Test - The Tutorial
213 pages
English

QF-Test - The Tutorial

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
213 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

QF-Test - The Tutorial
Version 3.4M2
Karlheinz Kellerer, Martin Moser, Michael Lehto, Magnus Lindström
1Quality First Software GmbH
Copyright c 2002-2011 Quality First Software GmbH
March 9, 2011
1http://www.qfs.de i
Contents
I Java testing with QF-Test 1
1 Introduction [5 min] 2
2 Working with a Sample Test-suite [30-45 min] 3
2.1 Before you start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Starting QF-Test and Loading the Test-suite . . . . . . . . . . . . . . . . 3
2.3 Starting the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Clickstream Test-case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 A Few Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6 Text Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.7 Checking a Radio Button . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.8 Stopping the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.9 The Complete Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.10 Report Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3 Creating a Test-suite [45-60 min] 21
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Starting the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Adding a Clickstream Test . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4 ...

Sujets

Informations

Publié par
Nombre de lectures 854
Langue English
Poids de l'ouvrage 3 Mo

Extrait

QF-Test - The Tutorial Version 3.4M2 Karlheinz Kellerer, Martin Moser, Michael Lehto, Magnus Lindström 1Quality First Software GmbH Copyright c 2002-2011 Quality First Software GmbH March 9, 2011 1http://www.qfs.de i Contents I Java testing with QF-Test 1 1 Introduction [5 min] 2 2 Working with a Sample Test-suite [30-45 min] 3 2.1 Before you start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Starting QF-Test and Loading the Test-suite . . . . . . . . . . . . . . . . 3 2.3 Starting the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.4 Clickstream Test-case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.5 A Few Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.6 Text Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.7 Checking a Radio Button . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.8 Stopping the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.9 The Complete Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.10 Report Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Creating a Test-suite [45-60 min] 21 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2 Starting the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.3 Adding a Clickstream Test . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.4 Building a Test-suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.5 Adding a Text-Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.6 Checking Business Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4 Using the Debugger [30-45 min] 36 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 CONTENTS ii 4.2 Starting the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 4.3 The Debugger Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.4 The Current Node versus the Selected Node . . . . . . . . . . . . . . . . 39 4.5 Stepping Through a Test or Sequence . . . . . . . . . . . . . . . . . . . 40 4.6 Skipping Execution of Nodes . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.7 Setting Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.8 Resolving Run-Time Problems . . . . . . . . . . . . . . . . . . . . . . . . 45 4.9 Jump to Run Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5 Writing a Procedure [30-45 min] 48 5.1 Getting Started with a New Suite . . . . . . . . . . . . . . . . . . . . . . . 48 5.2 Create the Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.3 Add a Check Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.4 About Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.5 The Try/Catch Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.6 Complete the Selection Logic . . . . . . . . . . . . . . . . . . . . . . . . 56 5.7 Making the Procedure More Usable . . . . . . . . . . . . . . . . . . . . . 57 5.8 Calling the . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6 Creating a Generalized Procedure [30-45 min] 61 6.1 Creating a Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.2 Move the Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.3 Create the Deselect Procedure . . . . . . . . . . . . . . . . . . . . . . . 62 6.4 Call the Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.5 Creating an All-Purpose Procedure . . . . . . . . . . . . . . . . . . . . . 64 6.6 Setting a Default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.7 The If/Else Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.8 Calling the All-Purpose Procedure . . . . . . . . . . . . . . . . . . . . . . 67 6.9 Documenting the Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.10 Saving your Test-suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7 Modularization [30-45 min] 71 7.1 Creating the Driver Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 CONTENTS iii 7.2 What Belongs Where . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.3 Creating a Test Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . 73 7.4 Calling a Procedure in the Utility Suite . . . . . . . . . . . . . . . . . . . . 73 7.5 Adding an Include . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.6 Modularization for Multiple SUTs . . . . . . . . . . . . . . . . . . . . . . . 75 8 The Standard Library [30-45 min] 77 8.1 The SUT For Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 8.2 The Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 8.3 Selected Packages and Procedures . . . . . . . . . . . . . . . . . . . . . 82 8.3.1 The Checkbox Package . . . . . . . . . . . . . . . . . . . . . . . 82 8.3.2 The Combobox/Combo Packages . . . . . . . . . . . . . . . . . 83 8.3.3 The General Packages . . . . . . . . . . . . . . . . . . . . . . . . 83 8.3.4 The List Packages . . . . . . . . . . . . . . . . . . . . . . . . . . 83 8.3.5 The Menu Package . . . . . . . . . . . . . . . . . . . . . . . . . . 83 8.3.6 The Popup Menu Package . . . . . . . . . . . . . . . . . . . . . . 85 8.3.7 The SWT/Sash Package . . . . . . . . . . . . . . . . . . . . . . . 86 8.3.8 The Table Package . . . . . . . . . . . . . . . . . . . . . . . . . . 86 8.3.9 The Table/Selection Package . . . . . . . . . . . . . . . . . . . . 86 8.3.10 The Tabbedpane/CTabfolder Package . . . . . . . . . . . . . . . 87 8.3.11 The Text Package . . . . . . . . . . . . . . . . . . . . . . . . . . 87 8.3.12 The Tree Package . . . . . . . . . . . . . . . . . . . . . . . . . . 88 8.3.13 The Cleanup Package . . . . . . . . . . . . . . . . . . . . . . . . 90 8.3.14 The Swing/Filechooser Utility Package . . . . . . . . . . . . . . . 92 8.3.15 The Swing/Optionpane Utility Package . . . . . . . . . . . . . . . 95 8.3.16 The SWT/FileDialog Package . . . . . . . . . . . . . . . . . . . . 97 8.3.17 The SWT/ColorDialog Package . . . . . . . . . . . . . . . . . . . 97 8.3.18 The SWT/DirectoryDialog Package . . . . . . . . . . . . . . . . . 97 8.3.19 The SWT/Instrument Package . . . . . . . . . . . . . . . . . . . 98 8.3.20 The AWT/Menu Package . . . . . . . . . . . . . . . . . . . . . . 98 8.3.21 The Run-log Package . . . . . . . . . . . . . . . . . . . . . . . . 98 8.3.22 The Run-log.Screenshots Package . . . . . . . . . . . . . . . . . 98 CONTENTS iv 8.3.23 The Shellutils Package . . . . . . . . . . . . . . . . . . . . . . . . 99 8.3.24 The Utils Package . . . . . . . . . . . . . . . . . . . . . . . . . . 99 8.3.25 The Database Package . . . . . . . . . . . . . . . . . . . . . . . 100 8.3.26 The Check Package . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.3.27 The Databinder Package . . . . . . . . . . . . . . . . . . . . . . 100 8.3.28 The Web Package . . . . . . . . . . . . . . . . . . . . . . . . . . 101 9 Managing Complex GUI Components [30-45 min] 102 9.1 The SUT For Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 9.2 One-Dimensional Complex Components . . . . . . . . . . . . . . . . . . 104 9.3 Two-Dimensionalx . . . . . . . . . . . . . . . . . . 107 9.4 Item Nodes versus Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.5 The Importance of Uniqueness . . . . . . . . . . . . . . . . . . . . . . . 109 9.6 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 10 It’s time to start your own Application [5min] 112 II Web testing with QF-Test 113 11 Introduction [5 min] 114 12 Working with a Sample Test-suite [30-45 min] 115 12.1 Starting QF-Test and Loading the Test-suite . . . . . . . . . . . . . . . . 115 12.2 Starting the browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 12.3 Clickstream Test-case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 12.4 A Few Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 12.5 Text Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 12.6 Checking a Radio Button . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 12.7 Stopping the Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 12.8 The Complete Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 12.9 Report Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 13 Creating a Test-suite [45-60 min] 134 CONTENTS v 13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 13.2 Starting the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 13.3 Adding a Clickstream Test . . . . . . . . . . . . . . . . . . . . . . . . . . 144 13.4 Building a Test-suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 13.5 Adding a Text Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 14 Further reading [5 min] 151 III Advanced features of QF-Test 152 15 Introduction [5 min] 153 16 The Demo Application [5 min] 154 17 Data driven Testing: Running one Test-case with different test data [30-45 min] 156 17.1 Situation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 17.2 Traditional way of implementing data driven testing . . . . . . . . . . . . 157 17.3 Data driver concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 17.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 18 Dependencies: Automatically ensuring correct prerequisites for each Test- case [60 min] 165 18.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 18.2 Ensuring prerequisites . . . . . . . . . . . . . .
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents