Package com.epam.healenium
Class SelfHealingEngine
java.lang.Object
com.epam.healenium.SelfHealingEngine
-
Constructor Summary
ConstructorsConstructorDescriptionSelfHealingEngine(@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 TypeMethodDescriptionList<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>>findNewLocations(String targetPage, List<com.epam.healenium.treecomparing.Node> paths, MetricsDto metricsDto)List<com.epam.healenium.treecomparing.Node>getNodePath(org.openqa.selenium.WebElement webElement)booleanbooleanvoidsaveElements(PageAwareBy by, List<org.openqa.selenium.WebElement> webElements)Stores the valid locator state: the element it found and the page.voidsaveNodes(PageAwareBy key, List<List<com.epam.healenium.treecomparing.Node>> elementsToSave)Optional<com.epam.healenium.treecomparing.Scored<org.openqa.selenium.By>>
-
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
-
saveElements
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
-
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 elementpaths- source path to locatormetricsDto- list of metrics data- Returns:
- a list of candidate locators, ordered by revelance, or empty list if was unable to heal
-
toLocator
-
isHealingEnabled
public boolean isHealingEnabled() -
isHealingBacklighted
public boolean isHealingBacklighted()
-