Xping.Sdk
1.0.0-rc2
dotnet add package Xping.Sdk --version 1.0.0-rc2
NuGet\Install-Package Xping.Sdk -Version 1.0.0-rc2
<PackageReference Include="Xping.Sdk" Version="1.0.0-rc2" />
<PackageVersion Include="Xping.Sdk" Version="1.0.0-rc2" />
<PackageReference Include="Xping.Sdk" />
paket add Xping.Sdk --version 1.0.0-rc2
#r "nuget: Xping.Sdk, 1.0.0-rc2"
#:package Xping.Sdk@1.0.0-rc2
#addin nuget:?package=Xping.Sdk&version=1.0.0-rc2&prerelease
#tool nuget:?package=Xping.Sdk&version=1.0.0-rc2&prerelease
About The Project
Xping SDK provides a set of tools to make it easy to write automated tests for Web Application and Web API, as well as troubleshoot issues that may arise during testing. The library provides a number of features to verify that the Web Application is functioning correctly, such as checking that the correct data is displayed on a page or that the correct error messages are displayed when an error occurs.
The library is called Xping, which stands for eXternal Pings, and is used to verify the availability of a server and monitor its content.
You can find more information about the library, including documentation and examples, on the official website https://xping.io.
Getting Started
The library is distributed as a NuGet packages, which can be installed using the .NET CLI command dotnet add package
. Here are the steps to get started:
Installation using .NET CLI
Open a command prompt or terminal window.
Navigate to the directory where your project is located.
Run the following command to install the Xping NuGet package:
dotnet add package Xping.Availability
Once the package is installed, you can start using the Xping library in your project.
using Xping.Sdk.Core.DependencyInjection;
Host.CreateDefaultBuilder()
.ConfigureServices(services =>
{
.AddHttpClientFactory()
.AddTestAgent(agent =>
{
agent.UploadToken = "--- Your Dashboard Upload Token ---";
agent.UseDnsLookup()
.UseIPAddressAccessibilityCheck()
.UseHttpClient()
.UseHttpValidation(response =>
{
Expect(response)
.ToHaveSuccessStatusCode()
.ToHaveHttpHeader(HeaderNames.Server)
.WithValue("Google", new() { Exact = false });
})
});
});
using Xping.Sdk.Core;
using Xping.Sdk.Core.Session;
var testAgent = _serviceProvider.GetRequiredService<TestAgent>();
TestSession session = await testAgent.RunAsync(new Uri("www.demoblaze.com"));
You can also integrate it with your preferred testing framework, such as NUnit, as shown below:
[TestFixtureSource(typeof(XpingTestFixture))]
public class HomePageTests(TestAgent testAgent) : XpingAssertions
{
public required TestAgent TestAgent { get; init; } = testAgent;
[OneTimeSetUp]
public void OneTimeSetUp()
{
TestAgent.UploadToken = "--- Your Dashboard Upload Token ---"; // optional
}
[Test]
public async Task VerifyHomePageTitle()
{
TestAgent.UseBrowserClient()
.UsePageValidation(async page =>
{
await Expect(page).ToHaveTitleAsync("STORE");
});
await using TestSession session = await TestAgent.RunAsync(new Uri("https://demoblaze.com"));
Assert.That(session.IsValid, Is.True, session.Failures.FirstOrDefault()?.ErrorMessage);
}
That’s it! You’re now ready to start automating your web application tests and monitoring your server’s content using Xping.
License
Distributed under the MIT License. See LICENSE
file for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Http.Polly (>= 8.0.1)
- Xping.Sdk.Core (>= 1.0.0-rc2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.