Hey Adrian,
I think I have come across a problem with extending SeleniumWebDriver I have a couple of solutions too.
So heres what I'm running:
public class AdamsWebdriver :SeleniumWebDriver
{
public AdamsWebdriver(Browser browser)
: base(new RemoteWebDriver(new Uri(@"http://10.2.2.48:4444/wd/hub"), new DesiredCapabilities("iexplore", "9", Platform.CurrentPlatform) { IsJavaScriptEnabled = true }))
{
}
protected AdamsWebdriver(IWebDriver webDriver)
: base(new RemoteWebDriver(new Uri(@"http://10.2.2.48:4444/wd/hub"), new DesiredCapabilities("iexplore", "9", Platform.CurrentPlatform) { IsJavaScriptEnabled = true }))
{
}
}
Excuse the silly name, I was jsut testing. So running this code gives an exception as it doesn't set _browser. I can't set _browser and using:
protected new bool NoJavascript
{
get { return false; }
}does not work because it references the one inside SelniumWebDriver. I guess there are a couple of options:
1) Make NoJavascript virtual
2) make _browser overridable
If I am using this incorrectly please let me know but to me it looks like the codes evolved to include browser and this doesn't work with overriding the driver.
Thanks
Adam