Class SelfHealingEngine

java.lang.Object
com.epam.healenium.SelfHealingEngine

public class SelfHealingEngine
extends Object
  • Constructor Details

    • SelfHealingEngine

      public SelfHealingEngine​(@NotNull @NotNull org.openqa.selenium.WebDriver delegate, @NotNull @NotNull com.typesafe.config.Config config)
      Parameters:
      delegate - a delegate driver, not actually SelfHealingDriver instance.
      config - user-defined configuration
    • SelfHealingEngine

      public SelfHealingEngine​(@NotNull @NotNull org.openqa.selenium.WebDriver delegate)
      Used, when client not override config explicitly
      Parameters:
      delegate - webdriver
  • Method Details

    • savePath

      public void savePath​(PageAwareBy by, List<org.openqa.selenium.WebElement> webElements)
      Stores the valid locator state: the element it found and the page.
      Parameters:
      by - the locator
      webElements - the elements while it is still accessible by the locator
    • savePath

      public void savePath​(PageAwareBy by, List<org.openqa.selenium.WebElement> webElements, List<List<com.epam.healenium.treecomparing.Node>> nodesToSave)
      Stores the valid locator state: the element it found and the page.
      Parameters:
      by - the locator
      nodesToSave - the nodes to save
      webElements - the elements while it is still accessible by the locator
    • getNodePath

      public List<com.epam.healenium.treecomparing.Node> getNodePath​(org.openqa.selenium.WebElement webElement)
    • findNewLocations

      public List<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>> findNewLocations​(PageAwareBy by, String targetPage)
    • findNewLocations

      public List<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>> findNewLocations​(PageAwareBy by, String targetPage, Optional<StackTraceElement> optionalElement)
      Parameters:
      by - page aware locator
      targetPage - the new HTML page source on which we should search for the element
      optionalElement - StackTraceElement
      Returns:
      a list of candidate locators, ordered by revelance, or empty list if was unable to heal
    • findNewLocationsByNodes

      public List<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>> findNewLocationsByNodes​(List<com.epam.healenium.treecomparing.Node> nodes, String targetPage)
    • findNodesToHeal

      public List<List<com.epam.healenium.treecomparing.Node>> findNodesToHeal​(PageAwareBy pageBy, StackTraceElement[] stackTrace)
    • save

      public void save​(PageAwareBy key, StackTraceElement[] stackTrace, List<List<com.epam.healenium.treecomparing.Node>> elementsToSave)
    • isHealingEnabled

      public boolean isHealingEnabled()