This is my code:
driver.findElement(By.id("input_17")).setAttribute("value", "selected");
Getting the error
"The method setAttribute(String, String) is undefined for the type WebElement" when I try to change Attribute of webelement.
But for "getAttribute
" it is not giving any error.
According to documentation
WebElement
doesn't havesetAttribute
method. But you could do this using JavascriptExecutor: