webdriver - selenium is trowing an error as element is not visble -


i have java script injection send text hidden inputbox. webdriver throwing error element not visible cannot interacted with.

webelement tmpelement= driver.findelement(by.classname("cwd_input")); javascriptexecutor executor = (javascriptexecutor)driver;  executor.executescript(("document.getelementsbyclassname('cwd_input')    [0].click();"),tmpelement);  tmpelement.sendkeys("t"); 

you can set value of input via js. code like:

string scripttoexecute = "document.getelementbyid("mytext").value = 'new value';";  executor.executescript(scripttoexecute); 

Comments

Popular posts from this blog

python - argument must be rect style object - Pygame -

webrtc - Which ICE candidate am I using and why? -

c# - Better 64-bit byte array hash -