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

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -