Package com.epam.healenium
Class SelfHealingEngine
java.lang.Object
com.epam.healenium.SelfHealingEngine
public class SelfHealingEngine extends Object
-
Constructor Summary
Constructors Constructor Description SelfHealingEngine(@NotNull org.openqa.selenium.WebDriver delegate)Used, when client not override config explicitlySelfHealingEngine(@NotNull org.openqa.selenium.WebDriver delegate, @NotNull com.typesafe.config.Config config) -
Method Summary
Modifier and Type Method Description List<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>>findNewLocations(PageAwareBy by, String targetPage)List<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>>findNewLocations(PageAwareBy by, String targetPage, Optional<StackTraceElement> optionalElement)List<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>>findNewLocationsByNodes(List<com.epam.healenium.treecomparing.Node> nodes, String targetPage)List<List<com.epam.healenium.treecomparing.Node>>findNodesToHeal(PageAwareBy pageBy, StackTraceElement[] stackTrace)List<com.epam.healenium.treecomparing.Node>getNodePath(org.openqa.selenium.WebElement webElement)booleanisHealingEnabled()voidsave(PageAwareBy key, StackTraceElement[] stackTrace, List<List<com.epam.healenium.treecomparing.Node>> elementsToSave)voidsavePath(PageAwareBy by, List<org.openqa.selenium.WebElement> webElements)Stores the valid locator state: the element it found and the page.voidsavePath(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.
-
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 actuallySelfHealingDriverinstance.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
Stores the valid locator state: the element it found and the page.- Parameters:
by- the locatorwebElements- 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 locatornodesToSave- the nodes to savewebElements- 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 locatortargetPage- the new HTML page source on which we should search for the elementoptionalElement- StackTraceElement- Returns:
- a list of candidate locators, ordered by revelance, or empty list if was unable to heal
-
findNewLocationsByNodes
-
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()
-