Add highlight of the element we're trying to click

This commit is contained in:
2023-05-07 19:37:26 -05:00
parent 4fa4268051
commit ca622d3f10
2 changed files with 16 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
@ -261,6 +262,17 @@ public class QSeleniumLib
/*******************************************************************************
**
*******************************************************************************/
public void highlightElement(WebElement element)
{
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].setAttribute('style', 'background: yellow; border: 3px solid red;');", element);
}
@FunctionalInterface
public interface Code<T>
{