What is a JavaScriptExecutor?

JavaScript executor is a Selenium interface which lets you directly interact with HTML DOM of the Web page; in cases where the Selenium commands are unable to perform actions on the Web page Element.


Why JavaScriptExecutor?

Selenium commands commonly fail when there are certain visibility issues(hidden, disabled elements) or because the DOM did not load completely during an AJAX request. We face this issue mostly with Click/Enter action in Testsigma.


To mitigate this issue, we have introduced NLPs that uses JavaScriptExecutor. Examples of JavaScriptExecutor grammar in Testsigma:

  • Enter test data in the field ui identifier using javascript executor
  • Click on ui identifier using javascript executor


Update: You won't have to worry about using JavaScriptExecutor anymore since we have updated the System to automatically trigger JavaScript executor(or directly interact with the DOM) in cases where Selenium is unable to interact with the web element.


Welcome to the era of #SmartTestAutomation!