WebElementExecuteScript Method
Executes a piece of JavaScript in the context of the current element.

Namespace: Selenium
Assembly: Selenium (in Selenium.dll) Version: 2.0.9.0 (2.0.9.0)
Syntax
VB Usage
Dim instance As WebElement
Dim script As String
Dim arguments As Object
Dim returnValue As Object

returnValue = instance.ExecuteScript(script, 
	arguments)

Parameters

script
Type: SystemString
The JavaScript code to execute.
arguments (Optional)
Type: SystemObject
The arguments to the script.

Return Value

Type: Object
The value returned by the script.
Examples
Set element = driver.FindElementById("id")
Debug.Print element.ExecuteScript("return [this.tagName, this.scrollLeft, this.scrollTop];")
See Also