webdriver executing javascript in VB .NET

136 views
Skip to first unread message

Jim Evans

unread,
May 8, 2013, 6:15:30 AM5/8/13
to seleniu...@googlegroups.com
That's not what I see when I look at the online version of the docs for .NET. From there, the signature on the IJavaScriptExecutor interface is:

Function ExecuteScript ( _
script As String, _
ParamArray args As Object() _
) As Object

Thus, you should cast to IJavaScriptExecutor and call ExecuteScript. I haven't done VB.NET in a really long time, but hat would look something like this, if memory serves:

' Assume driver is a valid IWebDriver instance.
Object scriptValue = CType(driver, IJavaScriptExecutor).ExecuteScript("return 'hello world';")

Reply all
Reply to author
Forward
0 new messages