How to highlight an
object like qtp/uft does through selenium and java?
public void
highlightElement(WebDriver driver, WebElement element) {
for (int i = 0; i <
2; i++)
{
JavascriptExecutor js
= (JavascriptExecutor) driver;
js.executeScript("arguments[0].setAttribute('style',
arguments[1]);", element, "color: yellow; border: 2px solid
yellow;");
js.executeScript("arguments[0].setAttribute('style',
arguments[1]);", element, "");
}}
Call the
highlightElement method and pass webdriver and WebElement which you want to
highlight as arguments.
WHEN WE GO FOR DEBUGGING SCRIPT OR FUNCTION IN QTP
ReplyDeleteOR
IN WHICH CONDITION WE GO FOR DEBUGGING SCRIPT OR FUNCTION IN QTP