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

    • saveElements

      public void saveElements(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
    • saveNodes

      public void saveNodes(PageAwareBy key, List<List<com.epam.healenium.treecomparing.Node>> elementsToSave)
    • 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(String targetPage, List<com.epam.healenium.treecomparing.Node> paths, MetricsDto metricsDto)
      Parameters:
      targetPage - the new HTML page source on which we should search for the element
      paths - source path to locator
      metricsDto - list of metrics data
      Returns:
      a list of candidate locators, ordered by revelance, or empty list if was unable to heal
    • toLocator

      public Optional<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>> toLocator(List<Locator> imitatedLocators, Double score)
    • isHealingEnabled

      public boolean isHealingEnabled()
    • isHealingBacklighted

      public boolean isHealingBacklighted()