I've managed to implement JavascriptExecutor
successfully, but I'm curious about the reasoning behind using the array "arguments[0]
". Can someone explain this to me?
Check out the code snippet below:
IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;
executor.ExecuteScript("arguments[0].click();", driver.FindElement(locator));