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
Post a Comment