TestKit.UIShield
1.1.3
dotnet add package TestKit.UIShield --version 1.1.3
NuGet\Install-Package TestKit.UIShield -Version 1.1.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TestKit.UIShield" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TestKit.UIShield --version 1.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TestKit.UIShield, 1.1.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TestKit.UIShield as a Cake Addin #addin nuget:?package=TestKit.UIShield&version=1.1.3 // Install TestKit.UIShield as a Cake Tool #tool nuget:?package=TestKit.UIShield&version=1.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TestKit.UIShield
TestKit.UIShield is a .NET library for automated visual UI testing.
Features
Screenshots
- Take screenshots of individual web elements on a page
- Compare screenshots taken against 'known working' template images
Comparisons
- Allow tolerances between images using expected difference percentages or through color masking on template images
Usage
UIShield adds extension methods to the pre-existing Screenshot class in Selenium.
Basic usage
var templateImage = (Bitmap)Image.FromFile("template.bmp"); // Load our template image
var screenshot = driver.GetScreenshot(); // Take a screenshot with our driver
var result = screenshot.Compare(templateImage); // Get our comparison result
Assert.Less(result.DifferencePercentage, 5); // Make an assertion that the differences are less than 5%
Exporting differences
The DiffImage
- the template image with all detected differences showing as bright green - is provided by the ComparisonResult
class, and can simply be saved out to a file.
var result = screenshot.Compare(templateImage); // Get our comparison result
result.DiffImage.Save("diff.bmp"); // Export our diff image as a bitmap
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net7.0-windows7.0 is compatible. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0-windows7.0
- Selenium.WebDriver (>= 4.9.1)
- System.Drawing.Common (>= 7.0.0)
- TestKit.Licensing (>= 1.0.0)
-
net7.0-windows7.0
- Selenium.WebDriver (>= 4.9.1)
- System.Drawing.Common (>= 7.0.0)
- TestKit.Licensing (>= 1.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.
v1.1.01
- Initial release