TestStack / TestStack.Seleno

Seleno helps you write automated UI tests in the right way by implementing Page Objects and Page Components and by reading from and writing to web pages using strongly typed view models.
http://teststack.github.com/TestStack.Seleno/
MIT License
180 stars 60 forks source link

System.Func not being returned #189

Open revbones opened 9 years ago

revbones commented 9 years ago

Hi, According to the breaking changes document, in version 0.4.55, BrowserFactory was set to return the correct factories for the change in moving from "WithWebDriver" to "WithRemoteWebDriver".

When trying the following code in VB.NET, I get the subsequent error message:

Instance.Run("Portal.UI", 12781, Function(configure) configure.WithRemoteWebDriver(BrowserFactory.Chrome))

Cannot convert type 'OpenQA.Selenium.Chrome.ChromeDriver' to parameter type 'System.Func(Of OpenQA.Selenium.Remote.RemoteWebDriver)'

robdmoore commented 9 years ago

I think the problem here is that Visual Basic doesn't support method group syntax.

I'm not really up to date with Visual Basic so I can't get it to work, but I got close with this:

Dim webDriverFactory As Func(Of RemoteWebDriver) = AddressOf BrowserFactory.Chrome
Instance.Run("", 123, Function(configure) configure.WithRemoteWebDriver(webDriverFactory))

Anyone else out there had much experience with VB and know how to do this?