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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -