When should you use JavaScriptExecutor in Selenium?

When you want to execute JavaScript on the browser :) This was my answer to a question on Quora https://www.quora.com/When-should-I-use-JavaScriptExecutor-in-Selenium-WebDriver/answer/Aaron-Evans JavaScriptExecutor is an interface that defines 2 methods: in Java (and similarly in C#): Object executeScript(String script, Object... args) and Object executeAsyncScript(String script, Object... args) which take as an argument a string representing the JavaScript … Continue reading When should you use JavaScriptExecutor in Selenium?