I am using Javascript executor to remove readonly attribute but it is giving an error. Cannot read property 'removeAttribute' of null.
I have seen different posts where people confirm that after removing AdBlock from Chrome it worked. I don't know what is AdBlock and how to remove it from Chrome Binary at runtime, so I tried Firefox (Gecko Driver) but it is also throwing the same error.
Code:
driver.get("http://jsfiddle.net/343Rb/"); runJS().executeScript("document.getElementById('myInput').removeAttribute('readonly')"); Browsers I tried: Chrome Binary latest, Firefox (GeckoDriver latest) on Windows 7
Links I went through:
- TypeError: Cannot read property "removeAttribute" of null
- Cannot read property 'removeAttribute' of null: Cant find source of it
- Cannot read property *0* of null
Few posts above are purely JS based so I believe is the reason they are not replying to me.
I am using Selenium 3.0, Windows 7, Firefox, Chrome, Java, Testng