VisionAutomationFramework 3.0.0
dotnet add package VisionAutomationFramework --version 3.0.0
NuGet\Install-Package VisionAutomationFramework -Version 3.0.0
<PackageReference Include="VisionAutomationFramework" Version="3.0.0" />
<PackageVersion Include="VisionAutomationFramework" Version="3.0.0" />
<PackageReference Include="VisionAutomationFramework" />
paket add VisionAutomationFramework --version 3.0.0
#r "nuget: VisionAutomationFramework, 3.0.0"
#:package VisionAutomationFramework@3.0.0
#addin nuget:?package=VisionAutomationFramework&version=3.0.0
#tool nuget:?package=VisionAutomationFramework&version=3.0.0
Vision Automation Framework (VAF)
VAF is a fluent test automation framework for .NET on top of Selenium WebDriver. Waiting for the page, for elements to be visible and interactable is handled for you, so tests read like the steps they describe.
Upgrading from 2.x: see Migrating from 2.x.
Requirements
- A test project for .NET Framework 4.7.2 (or newer 4.x) or .NET 10. .NET 8 and 9 are not
supported: the build stops with error
VAF0001. - Any test framework: NUnit 3 or 4, MSTest, xUnit. VAF does not depend on one.
- Google Chrome, Firefox, or Safari on macOS. Selenium Manager downloads the matching browser driver on the first run, no driver package needed.
- Tested with Chrome and Firefox on Windows. Linux and macOS on .NET 10 are supported by design but not yet tested.
Installation
dotnet add package VisionAutomationFramework
- NuGet picks the lowest Selenium VAF allows (4.45.0). For a newer one, add
Selenium.WebDriverandSelenium.Supportto your project yourself, both with the same version; VAF works with any 4.x from 4.45. - In an old-style project (
packages.config), install through Manage NuGet Packages, so the references toSelenium.WebDriverandSelenium.Supportare added too; a hand-written HintPath to VAF alone does not bring them.
Quick start
using NUnit.Framework;
using VisionAutomationFramework;
using VisionAutomationFramework.Browsers;
using VisionAutomationFramework.Extensions;
public class Tests
{
[Test]
public void OpensExampleDomain()
{
var browser = Testing.On<Chrome>();
try
{
browser.LetsNavigateTo("https://example.com/")
.Should().HaveTitle("Example Domain");
}
finally
{
browser.Scope.Driver.Quit();
}
}
}
With MSTest or xUnit the test is the same, only the attributes differ ([TestMethod], [Fact]).
A failed check throws VafAssertionException, which every test framework reports as a failed test:
VisionAutomationFramework.VafAssertionException : Title on active tab isn't correctly populated
Expected: "Wrong title"
But was: "Example Domain"
The full guide is at https://www.visionautomationframework.com/quick-start-guide.
Settings
Each setting is read from the environment variable VAF_<name> first, then from appSettings in
the test project's app.config. Environment variables also work on .NET 10, where app.config often
does not reach the test run, and in CI.
| Setting | Default | Meaning |
|---|---|---|
ElementWaitTimeout |
10 | Seconds to wait for an element |
LoaderWaitTimeout |
60 | Seconds to wait for a loader to disappear |
DownloadDirectory |
c:\mydownloads on Windows, <temp>/vaf-downloads elsewhere |
Where Chrome and Firefox save downloads |
What's new in 3.0
- .NET 10 alongside .NET Framework 4.7.2, with the same API.
- No test framework dependency. Works with NUnit 3 and 4, MSTest and xUnit. Under MSTest the
TestExecutionContext.IsolatedContextworkaround is no longer needed. - Only Selenium as a dependency (Selenium.WebDriver and Selenium.Support 4.45 or newer 4.x; on .NET 10 also System.Configuration.ConfigurationManager, for app.config).
- Settings from environment variables (
VAF_ElementWaitTimeout, …) or app.config, and a newDownloadDirectorysetting. LetsSaveScreenshotTo(directory, fileName)saves a screenshot anywhere and returns the path, so you can attach it in any test framework.LetsTakeScreenshot()still saves it in the NUnit test directory and attaches it to the NUnit result.LetsSelectOptionFromRightClickMenurefuses to send keys when the browser is not the foreground window, instead of typing into another window. Do not run such tests in parallel. Firefox started from a test run usually does not get the foreground on Windows, so with Firefox this method mostly refuses; it works with Chrome.Testing.On(browser)for a browser you create with settings, e.g. a remote grid or extra arguments:Testing.On(new MyRemoteChrome(gridUrl)).Testing.On<Chrome>()stays for browsers without settings.AndAlso()also after a check, so several checks on one section stay in one chain:.AsLabelText().Should().HaveValue("…").AndAlso().Should().HaveElement<Next>()…- HTML reports are named
VAF_Log_<test name>_<yyyy-MM-dd_HH-mm-ss>.html, so tests that finish in the same minute no longer overwrite each other's report (2.x:VAF_Log_<hh-mm MM-dd-yyyy>.html).
Migrating from 2.x
Most tests recompile unchanged. Check these points:
| 2.x | 3.0 |
|---|---|
| VAF brought NUnit, Newtonsoft.Json and RestSharp into your project | Only Selenium. If your tests use NUnit, Newtonsoft.Json or RestSharp, reference them yourself. |
Failed checks threw NUnit's AssertionException |
They throw VisionAutomationFramework.VafAssertionException. Change catch (AssertionException) in your code. |
LetsTakeScreenshot(TestContext tc, …) with the MSTest v1 TestContext |
var path = browser.LetsSaveScreenshotTo(TestContext.TestResultsDirectory); then TestContext.AddResultFile(path); |
BrowserStack: Testing.On<T>(browserStackOptions), BrowserStackRemoteWebDriver, BrowserStackExtensions, IOSSafari, MobileRemoteDriver, MobileDevice |
Removed (obsolete since 2.1). For a remote grid, implement IBrowserDefinition returning a Selenium RemoteWebDriver, and start it with Testing.On(new YourRemoteBrowser(options)). |
Mobile types: MobileAppActions, MobileAppAssertions, ActionsMobileApp<T>, AppScope, IMobileContext, MobileApp, non-generic ButtonActions / ButtonAssertions |
Removed. They could not be used: there was no way to start a mobile session. |
WinFormApplication, InternetExplorer |
Removed (the first was never implemented; Internet Explorer is retired). |
WebElementAssertionMethods in the global namespace |
In VisionAutomationFramework.Extensions. |
MSTest: new NUnit.Framework.Internal.TestExecutionContext.IsolatedContext(); in [TestInitialize] |
Not needed; remove it. |
Features
- Chrome, Firefox and Safari; your own browsers through
IBrowserDefinition - Pages, sections and elements as small classes with one locator each
- Element-specific actions and assertions (
AsButton(),AsTextInputField(),AsLabelText(), …) - Built-in waits and loader handling
- XML test log with an HTML report
Contact
https://www.visionautomationframework.com/contact
License
MIT — see LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Selenium.Support (>= 4.45.0 && < 5.0.0)
- Selenium.WebDriver (>= 4.45.0 && < 5.0.0)
-
net10.0
- Selenium.Support (>= 4.45.0 && < 5.0.0)
- Selenium.WebDriver (>= 4.45.0 && < 5.0.0)
- System.Configuration.ConfigurationManager (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.0.0 | 34 | 10/1/2026 | |
| 3.0.0-beta.3 | 35 | 9/30/2026 | |
| 3.0.0-beta.2 | 52 | 9/28/2026 | |
| 3.0.0-beta.1 | 74 | 9/27/2026 | |
| 2.1.0 | 83 | 9/27/2026 | |
| 2.0.30 | 391 | 4/7/2025 | |
| 2.0.29 | 318 | 4/7/2025 | |
| 2.0.28 | 255 | 11/19/2024 | |
| 2.0.27 | 267 | 10/28/2024 | |
| 2.0.24 | 255 | 7/29/2024 | |
| 2.0.23 | 300 | 5/29/2024 | |
| 2.0.22 | 285 | 5/29/2024 | |
| 2.0.21 | 292 | 5/28/2024 | |
| 2.0.20 | 311 | 5/16/2024 | |
| 2.0.19 | 560 | 1/4/2024 | |
| 2.0.18 | 693 | 10/26/2023 | |
| 2.0.17 | 628 | 9/13/2023 | |
| 2.0.16 | 604 | 9/12/2023 | |
| 2.0.15 | 782 | 4/28/2023 | |
| 2.0.14 | 787 | 4/11/2023 |
3.0.0: .NET 10 alongside .NET Framework 4.7.2, with the same API. No test framework dependency: failed checks throw VafAssertionException, which NUnit 3 and 4, MSTest and xUnit report as a failed test. Only Selenium as a dependency. Settings from VAF_* environment variables or app.config. New: Testing.On(browser) for a browser created with settings (remote grid, extra arguments); LetsSaveScreenshotTo; AndAlso() also after a check; HTML report named per test; a .NET 5-9 project stops at build with error VAF0001. Removed: BrowserStack, the mobile types, WinFormApplication, InternetExplorer and the MSTest v1 screenshot overload. Upgrading from 2.x: see "Migrating from 2.x" in the README.