selenium webdriver - The method setAttribute(String, String) is undefined for the type WebElement -
this code:
driver.findelement(by.id("input_17")).setattribute("value", "selected");
getting error
"the method setattribute(string, string) undefined type webelement" when try change attribute of webelement.
but "getattribute
" not giving error.
according documentation webelement
doesn't have setattribute
method. using javascriptexecutor:
javascriptexecutor jsexecutor = (javascriptexecutor) driver; jsexecutor.executescript("document.getelementbyid('input_17').setattribute('value', 'selected')");
Comments
Post a Comment