Arguments in javascript to be used with JavascriptExecutor in Selenium script
Signature of Method: Object executeScript(String script, Object... args)
The arguments to the script may be empty or any object. It can be String object, WebElement, etc..
eg:-
- ((JavascriptExecutor)driver).executeScript("arguments[0].click();", loginButton); where "loginButton" is a WebElement.
- ((JavascriptExecutor)driver).executeScript("arguments[0].value=arguments[1]",emailTextField,"qacult"); where "emailTextField" is a WebElement.
Comments
Post a Comment