XPing365.Core
1.0.0-rc1
See the version list below for details.
dotnet add package XPing365.Core --version 1.0.0-rc1
NuGet\Install-Package XPing365.Core -Version 1.0.0-rc1
<PackageReference Include="XPing365.Core" Version="1.0.0-rc1" />
paket add XPing365.Core --version 1.0.0-rc1
#r "nuget: XPing365.Core, 1.0.0-rc1"
// Install XPing365.Core as a Cake Addin #addin nuget:?package=XPing365.Core&version=1.0.0-rc1&prerelease // Install XPing365.Core as a Cake Tool #tool nuget:?package=XPing365.Core&version=1.0.0-rc1&prerelease
About The Project
XPing365 SDK is designed to make eXternal Ping(s) to web applications to verify its availability and monitor its content by scraping data from the web pages. It allows users to parametrize URLs and generate hundrets of different queries.
Getting Started
XPing365 SDK can be installed via the NuGet package manager or .NET CLI. If you need help, please open an issue.
Installation using .NET CLI
dotnet add package XPing365.Core
Usage
In this section you will find 5 steps to start working with XPing 365 SDK. It is a small subset of what's possible with XPing 365 SDK.
- Setup program initialization with the Dependency injection in .NET.
var host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
services.AddHttpClient<IWebDataRetriever, WebDataRetriever>("httpClient", client =>
{
client.BaseAddress = new Uri("http://example.com/");
});
services.AddTransient<IDataParserFactory, DataParserFactory>();
services.AddTransient<IWebDataRetriever, WebDataRetriever>();
})
.Build();
- Declare your page you're going to test
class BasicPage : HtmlSource
{
[XPath("//head/title")]
public string? Title { get; set; }
[XPath("//body/h1")]
public string? Header { get; set; }
[XPath("//body/p")]
public string? Paragraph { get; set; }
}
- Get the
WebDataRetriever
object
var webDataRetriever = host.Services.GetRequiredService<IWebDataRetriever>();
- Fetch the web page content
BasicPage? basicPage = await webDataRetriever.GetFromHtmlAsync<BasicPage>("/basic_page.html");
- Assert your web page
Assert.AreEqaul(HttpStatusCode.OK, basicPage.ResponseCode); // or alternatively check property IsSuccessResponseCode
Assert.IsTrue(basicPage.ResponseSizeInBytes < 150000);
Assert.IsTrue(basicPage.RequestEndTime - basicPage.RequestStartTime <= TimeSpan.FromSeconds(5));
Assert.AreEqual("ExampleTile", basicPage.Title);
Assert.AreEqual("ExampleHeader", basicPage.Header);
Assert.AreEqual("ExampleParagraph", basicPage.Paragraph);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- HtmlAgilityPack (>= 1.11.43)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on XPing365.Core:
Package | Downloads |
---|---|
XPing365.Availability
XPing365 is open source .NET library written in C# that provides a set of tools to make it easy to write automated tests for web applications, as well as troubleshoot issues that may arise during testing. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial beta release of the first XPing365.Core package.