I recently implemented the "How to handle hidden web elements using the JavaScript executor method".
However, I am still unclear about how the method works.
public static void selectDateByJS(WebDriver driver, WebElement element, String dateVal) {
JavascriptExecutor js = ((JavascriptExecutor) driver);
js.executeScript("arguments[0].setAttribute('value', '" + dateVal + "');", element);
}
Can someone explain what the argument[0]
represents and its significance?