Im trying to execute jquery from selenium to change the visibility of a object, I have the next code but it's not working, does anybody knows the error?
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
js.ExecuteScript(
"document.querySelector('input[type='file']').style.display = 'block';"
);
The problem were the quotes, I've already fixed:
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
js.ExecuteScript(
@"document.querySelector('input[type=""file""]').style.display = 'block';"
);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.