I encountered an error when trying to run the code snippet below:
driver = new ChromeDriver(@"C:\Users\hp\Documents\Driver");
driver.Navigate().GoToUrl("http://demo.guru99.com/v3/");
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
js.ExecuteScript("document.getElementByName('uid').value ='mngr303517'");
js.ExecuteScript("document.getElementByName('password').value='ujudysY'");
js.ExecuteScript("document.getElementByName('btnLogin').click()");
The error occurred at line 3.
document.getElementByName is not a function (Session info: chrome=87.0.4280.141)
What could be causing this issue?