title: How to highlight elements by setting some flag
body: <p>Below is the code I am using to highlight the element.</p>
  
  <pre><code>public static void highLightElement(WebDriver driver, WebElement element)
  {
  JavascriptExecutor js=(JavascriptExecutor)driver; 
  
  js.executeScript("arguments[0].setAttribute('style', 'background: yellow; border: 2px solid red;');", element);
  
  try 
  {
  Thread.sleep(1000);
  } 
  catch (InterruptedException e) {
  
  System.out.println(e.getMessage());
  } 
  
  js.executeScript("arguments[0].setAttribute('style','border: solid 2px white');", element); 
  
  }
  
  }
  </code></pre>
  
  <p>Now I am calling this reusable to my code. But I want to use it in such a way that it will highlight elements only if I use some kind of flag (true). My motto is that it will not highlight element in normal execution but if I flag it I can see the highlighted element while debugging.</p>