I am facing an issue where my JavaScript code is not executing on my page(s) through Selenium.
Here is the code I am using:
// Setting up a driver instance for Chrome
IWebDriver driver = new ChromeDriver();
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
driver.Manage().Window.Size = new Size(1100, 1100);
driver.Navigate().GoToUrl("http://www.google.com/");
js.ExecuteScript("function reloadScrollBars() { document.documentElement.style.overflow = 'auto'; document.body.scroll = 'yes';} function unloadScrollBars(){ document.documentElement.style.overflow = 'hidden'; document.body.scroll = 'no';}");
I am seeking insights from anyone who might know why this code is not running as expected.