Acutest.WebDriver.SelfHeal3 1.0.0

dotnet add package Acutest.WebDriver.SelfHeal3 --version 1.0.0
NuGet\Install-Package Acutest.WebDriver.SelfHeal3 -Version 1.0.0
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="Acutest.WebDriver.SelfHeal3" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Acutest.WebDriver.SelfHeal3 --version 1.0.0
#r "nuget: Acutest.WebDriver.SelfHeal3, 1.0.0"
#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 Acutest.WebDriver.SelfHeal3 as a Cake Addin
#addin nuget:?package=Acutest.WebDriver.SelfHeal3&version=1.0.0

// Install Acutest.WebDriver.SelfHeal3 as a Cake Tool
#tool nuget:?package=Acutest.WebDriver.SelfHeal3&version=1.0.0

SelfHeal


SelfHeal is an implemenation of Selenium WebDriver (3.141.0). Allowing projects to make use of multiple locators when using findElement method. The aim of the project is to allow users who have problems with broken locators to have an altarnative instead of failing the test.

Documenation

1. Implement ILocator interface

using OpenQA.Selenium;
using System;
using System.Collections.Generic;

namespace SelfHeal.LocatorImplementation
{
    public class LocatorImplementation : ILocator
    {

   
         public Dictionary<string, IList<By>> GetLocatorList()
        {
            return new Dictionary<string, IList<By>>()
            {
                { "Default".ToString().Trim(), new List<By>() { By.XPath("//a[@href='/FixCoPortal']") } } 
            };
        }
    }
}

Replace the "Default" string with page object reference.
Example:
From- "Default".ToString().Trim()
To- WebAppTestTargetNavigationBar.FixCoPortalNavigationButton.ToString().Trim()

2. In Hooks file create an instance of ProxyChromeDriver using param WebDriver object and instance of ILocator object.

ChromeOptions option = new ChromeOptions();
option.AddArgument("no-sandbox");

IWebDriver delegatee = new ChromeDriver(option);

ILocator localImpl = new LocatorImplementation();

IWebDriver driver = new ProxyChromeDriver(delegatee, localImpl);

driver.Navigate().GoToUrl("https://www.google.com");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 711 5/30/2022