Executes JavaScript in the context of the currently selected frame or window. The script fragment provided will be executed as the body of an anonymous function.
Within the script, use document to refer to the current document. Note that local variables will not be available once the script has finished executing, though global variables will persist.
If the script has a return value (i.e. if the script contains a return statement), you can retrieve the value using the result() method:
For an HTML element, this method returns a WebElement
For a decimal, a Double is returned
For a non-decimal number, a Long is returned
For a boolean, a Boolean is returned
For all other cases, a String is returned.
For an array, return a List