---
title: "Automating All the Things with FinalBuilder"
url: "https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder.md"
canonical: "https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/"
tags: []
author: "Roy Osherove"
description: "Automating All the Things with FinalBuilder: 18 lessons, 1 h 36 min. A free video course by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Automating All the Things with FinalBuilder

[Courses](https://courses.osherove.com/#courses)

18 lessons 1 h 36 min 5 sections

[Start course](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/why-finalbuilder/) [Watch on YouTube playlist](https://www.youtube.com/playlist?list=PLCACKnl1b-cQ)

![](https://courses.osherove.com/img/yt/9FI6h6LWRGg.jpg)

Readable, Maintainable Automation Scripts with FinalBuilder on Windows

## About this course

Roy Osherove teaches automation with [FinalBuilder](https://osherove.com/blog/2005/3/12/cooltool-finalbuilder-30-the-ultimate-build-management-and-a.html "[CoolTool] FinalBuilder 3.0 - the ultimate build management and automation tool (osherove.com)"), a commercial tool he is not affiliated with, and explains why he prefers its visual, readable scripts and its more than a thousand built-in actions to PowerShell or batch files and to the built-in actions of CI servers. After a tour of the FinalBuilder IDE, the course builds a script that runs relative to its project's location and adds variables, file iterators, appending to variables, the debugger, downloading web pages and typed variables. It then covers action lists and action groups, global and local error handling with try catch and try finally, async action groups, invoking other FinalBuilder projects, action properties and action scripts, and running FinalBuilder from MSBuild, TFS or TeamCity.

## Related reading

- [Build and Continuous Integration - Toolgasm achieved](https://osherove.com/blog/2008/8/12/build-and-continuous-integration-toolgasm-achieved.html) · osherove.com

    From the lesson [Getting Around FinalBuilder (Demo)](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/getting-around-finalbuilder-demo/): A 2008 post with his team's main FinalBuilder build tree, where each tab at the top is a small build tree like a function, like the main and on failure tabs shown here.

- [Build Pattern: Extract Script](https://osherove.com/blog/2013/1/19/build-pattern-extract-script.html) · osherove.com

    From the lesson [Reusable Action Lists and Action Groups](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/reusable-action-lists-and-action-groups/): Roy's build pattern for moving a repeated set of actions into one script that takes the differing values as parameters, as this lesson does with an action list and its URL parameter.

- [Build Pattern: Location Agnostic Script](https://pipelinedriven.org/article/2014/3/2/build-pattern-location-agnostic-script) · pipelinedriven.org

    From the lesson [The First Script - Relativity and Variables](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/the-first-script-relativity-and-variables/): Roy's build pattern for scripts that use only relative paths so they run on any machine, as this first script does with the project directory variable.

- [Build Pattern: Fill In the Blanks](https://osherove.com/blog/2013/1/19/build-pattern-fill-in-the-blanks.html) · osherove.com

    From the lesson [Variables that Contain Variables](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/variables-that-contain-variables/): Roy's build pattern against changing a script in many places when one thing changes, by defining variables once, the repetition this lesson removes.

- [Outputting build status from FinalBuilder to TeamCity](https://osherove.com/blog/2009/5/19/outputting-build-status-from-finalbuilder-to-teamcity.html) · osherove.com

    From the lesson [Custom Action Scripts in Powershell & Javascript](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/custom-action-scripts-in-powershell-and-javascript/): Roy's note on sending build status from FinalBuilder to TeamCity by writing text in TeamCity's format to the console, what he uses action scripts for in this lesson.

## Curriculum

Section 1

### Introduction

2 lessons · 25 min

The introduction explains why Roy Osherove uses FinalBuilder rather than PowerShell or batch files or the built-in actions of CI servers: its scripts are visual and readable, they can be versioned with the application, and it has more than a thousand built-in actions. It then tours the FinalBuilder IDE, from the action categories and the project structure to the build log, the action descriptions and break points.

1. [Why FinalBuilder? Duration 9:34](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/why-finalbuilder/)

    Roy Osherove introduces FinalBuilder, a commercial tool he is not affiliated with, and explains why he prefers it to MSBuild, PowerShell or batch files, whose scripts become hard to read and maintain and end up scattered, and finds Visual Build less usable. He likes that it shows the flow of a script visually without the internal details, that scripts can be debugged and that a new person can start changing a build within minutes, and that it has more than a thousand built-in actions, where CI servers have far fewer and their steps are not versioned with the application. He describes where he has found it useful, from compiling and complicated deployments to setting up machines with all their dependencies, letting testers automate installations and UI steps, asking questions in interactive dialogs and sharing custom actions across an organization.

2. [Getting Around FinalBuilder (Demo) Duration 15:02](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/getting-around-finalbuilder-demo/)

    Roy Osherove tours the FinalBuilder IDE: the main and on failure tabs of a project, the action categories on the left, from .NET tools, Amazon EC2 and databases to file sets, flow control, GUI automation, interactive questions, iterators and XML, and the search for actions such as running a DOS command or a PowerShell script. He creates a first one-action project that runs echo hello world, fixes the error it reports, and shows the build log, the editable action descriptions that keep scripts readable, a break point with the watch window, and the FinalBuilder Action Studio, which creates packages of actions.

Section 2

### Iterations and Variables

7 lessons · 32 min

This section builds a first FinalBuilder script that always runs relative to the project's location and uses variables, including macro variables made of other variables, to avoid repetition. It then iterates over a file set to gather the content of several files, appends to a variable in memory, steps through the script in the debugger, downloads a web page whose percent signs must not be expanded, and shows that string variables are faster than variants.

3. [The First Script - Relativity and Variables Duration 10:50](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/the-first-script-relativity-and-variables/)

    Roy Osherove builds a first FinalBuilder project that creates a text file and replaces a placeholder in it with the contents of another file, read into a project variable. He uses the built-in FB project directory variable so that the script always runs relative to where the project is, and refactors the repeated folder name into a generation directory variable, whose value can also be changed from the command line.

4. [Variables that Contain Variables Duration 2:54](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/variables-that-contain-variables/)

    Roy Osherove avoids repeating the same path by creating a full path generation directory variable whose default value is made up of two other variables. He makes it a macro, so that it expands the variable references inside it every time it is used, which gives a hierarchy of variables.

5. [Iterating over Files Duration 8:26](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/iterating-over-files/)

    Roy Osherove gathers the content of several input files into one file with a loop: he defines a file set of the files that start with important and end with .txt, and a file set iterator puts each file name in a variable. The actions he moves under the iterator read each file and append its content to the new file, and he notes that a naming convention for the variables would help. After he replaces the placeholder with an empty string, the result still starts with an empty line.

6. [Fixing the Empty Line - Appending To Variables Duration 2:45](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/fixing-the-empty-line-appending-to-variables/)

    To remove the empty line, Roy Osherove appends the content of each file, with a new line, to a variable named with a v prefix, and replaces the placeholder with that variable once, after the loop. He notes that the script runs a bit slowly, partly because of the virtual machine it runs on and, he guesses, because FinalBuilder also saves the variables to files, but that it is fast enough for the purpose.

7. [Using the Debugger Duration 2:59](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/using-the-debugger/)

    Roy Osherove puts a break point inside the iteration and, in the stopped state, adds watches for the variable that collects the inputs, the full path and the current input file name. He steps through the actions with F10 and watches the values change, which makes complicated scripts easier to debug.

8. [Downloading a Web Page & Using Literal Variables Duration 3:00](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/downloading-a-web-page-and-using-literal-variables/)

    Roy Osherove takes the input from the web with an HTTP get file action that accepts redirects and saves cnn.com to a file. The replacement then fails with could not expand replacement string, because FinalBuilder tries to expand the percent signs in the downloaded HTML as variables, and an exclamation mark before the variable name tells it to read the value without parsing it.

9. [Making Variable Access Faster with Typing Duration 1:01](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/making-variable-access-faster-with-typing/)

    Roy Osherove shows that the types of variables matter for speed: when the content is put into string variables instead of variants, FinalBuilder does not have to figure out what the content is, and access to the variables is usually much faster.

Section 3

### Flow Control & Error Handling

5 lessons · 24 min

This section makes scripts reusable with action lists, which are functions with parameters, and action groups, and it handles errors globally in the on failure tab, which exports the log, and locally with try catch and try finally actions. It also speeds up the downloads with async action groups and runs another FinalBuilder project from within a project.

10. [Reusable Action Lists and Action Groups Duration 5:18](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/reusable-action-lists-and-action-groups/)

     To download several websites without copying actions, Roy Osherove extracts the download action into an action list, a function with a URL string parameter, and calls it with run action list actions for cnn.com and google.com, which he renames with F2 to make them more readable. He wraps the calls in an action group, a hierarchical placeholder for several actions, and notes that action lists let him maintain things in one place and see what the script does rather than how it does it.

11. [Global Error Handling Duration 4:46](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/global-error-handling/)

     Roy Osherove uses the on failure tab, the global error handler, to export the FinalBuilder log to an HTML file in a logs folder when anything fails. The first run cannot export the log because the folder does not exist, so he adds a create directory action before the export, and he shows how a send email action can attach the log file.

12. [Local Error Handling: Try-Catch-Finally Blocks Duration 7:42](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/local-error-handling-try-catch-finally-blocks/)

     Roy Osherove lets a script continue after an error, either with ignore failure on an action or with the try catch and try finally actions of the flow control category, so that a failed download of one page does not stop the others. He extracts the failure handling that he repeated into an action list called from both the catch and on failure, renames it export logs so that the logs are exported no matter what, and discusses grouping the main logic into its own action list or action group.

13. [Speed Things Up with Parallel Async Actions Duration 3:30](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/speed-things-up-with-parallel-async-actions/)

     Roy Osherove downloads several pages at the same time by wrapping the download actions in an async action group, which runs its child actions in multiple threads, with a maximum number of concurrent threads and an optional delay between thread starts. The group is also a sync point, as the action after it starts only when all of its actions finish, and he warns against async action groups for actions that change the same IO or write to the same variable, because of race conditions.

14. [Invoking Other FinalBuilder Projects Duration 3:08](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/invoking-other-finalbuilder-projects/)

     Roy Osherove reuses a whole project by including the calculator UI testing demo project that comes with FinalBuilder in his own project with an include project action, which can also send variables to it and shares the host and environment variables. Once he puts it inside the try, the calculator tests run after the downloads, and their full log is included in the project's own build log.

Section 4

### Advanced Customization

2 lessons · 5 min

This section covers the general and runtime properties of actions, such as retries, log output, output monitors and run conditions, and scripts in JavaScript, PowerShell, Python or VBScript that run while an action executes.

15. [Useful General and Runtime Action Properties Duration 3:47](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/useful-general-and-runtime-action-properties/)

     Roy Osherove goes through the properties of an action: the general tab sets its description, a color and comments, and the runtime tab can enable or disable it, ignore failure, pause after it, retry it when it fails and, for some actions, set a timeout. He also shows how to hide an action's output from the log, for example when it sets passwords, and output monitors, which fail an action when its output contains, or does not contain, a given string, which helps with processes that do not return a nonzero code on failure. Some actions can run as a different user, and a script in JavaScript, Python or PowerShell can set a condition under which the action runs.

16. [Custom Action Scripts in Powershell & Javascript Duration 1:22](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/custom-action-scripts-in-powershell-and-javascript/)

     Roy Osherove shows a relatively unknown feature of FinalBuilder: every action has a script editor, where scripts in JavaScript, PowerShell, Python or VBScript run while the action executes and can use objects such as the action itself. He used it to change the TeamCity status on each action he cared about, by sending log messages in a specific format, but notes that it is usually not recommended because these scripts are relatively hidden.

Section 5

### Orchestrating FinalBuilder with a CI System

2 lessons · 10 min

This section shows how to run FinalBuilder from MSBuild or TFS, with the example MSBuild project that comes with FinalBuilder, and from TeamCity, with a build step that calls the FinalBuilder command line on a project kept in source control.

17. [Invoking FinalBuilder from TFS/MSBuild Duration 1:22](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/invoking-finalbuilder-from-tfs-msbuild/)

     Roy Osherove shows the example that comes with FinalBuilder for running it from MSBuild or TFS: an MSBuild project file uses a task from a DLL included with FinalBuilder to invoke FBCmd.exe with the path of the project file, and can set more properties such as variables. Environment variables are also included in the project by default, so more settings can be passed that way.

18. [Invoking FinalBuilder From TeamCity Duration 8:20](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/invoking-finalbuilder-from-teamcity/)

     Roy Osherove runs a FinalBuilder script from TeamCity: he puts the demo folder in a git repository, with the FinalBuilder zip file (FBZ) at its root so that the build does not need to know the structure of the application, and creates a TeamCity project with a VCS root that points to it. A build configuration with a PowerShell build step calls FBCmd.exe on the agent with the project file as the parameter, after he disables the calculator UI test, because UI tests cannot run from the command line. He shows that variables can be passed on the command line, which overrides their hard-coded values, or as TeamCity parameters of the environment variable type, which never override a local FinalBuilder variable, so he finds the command line safer.


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
