Below is the code I'm using to add a border to an input box on a web page:
JavascriptExecutor js=(JavascriptExecutor)driver;
WebElement username= driver.findElement(By.id("email"));
js.executeScript("arguments[0].setAttribute('style','border: solid 2px
red');", username);
However, this code is throwing an error message:
org.openqa.selenium.WebdriverException: unknown error:
arguments[0].setAttribute is not a function
Please note that the web page's tag already contains a style attribute.