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.
> 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.
No you are quite right. It is a bug.
What was missing was the browser should have been received by the base constructor and set there so with the fix your code will now look like this:
> 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 }), browser)
> { > }
> }
This also gives you the option of replacing the configured browser with your own at this point. Since you are fixing it to IE I suppose it might be a good idea to just hard code it to Browser.InternetExplorer in this case.
You never needed the second constructor in any case.
I've opened an issue on github for this and I'll push out a new Coypu soon to fix it.
>> 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.
> No you are quite right. It is a bug.
> What was missing was the browser should have been received by the base constructor and set there so with the fix your code will now look like this:
>> 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 }), browser)
>> { >> }
>> }
> This also gives you the option of replacing the configured browser with your own at this point. Since you are fixing it to IE I suppose it might be a good idea to just hard code it to Browser.InternetExplorer in this case.
> You never needed the second constructor in any case.
> I've opened an issue on github for this and I'll push out a new Coypu soon to fix it.
> 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.
> No you are quite right. It is a bug.
> What was missing was the browser should have been received by the base > constructor and set there so with the fix your code will now look like this:
> 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 }), browser) > { > } > }
> This also gives you the option of replacing the configured browser with > your own at this point. Since you are fixing it to IE I suppose it might be > a good idea to just hard code it to Browser.InternetExplorer in this case.
> You never needed the second constructor in any case.
>> 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.
>> No you are quite right. It is a bug.
>> What was missing was the browser should have been received by the base >> constructor and set there so with the fix your code will now look like this:
>> 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 }), browser) >> { >> } >> }
>> This also gives you the option of replacing the configured browser with >> your own at this point. Since you are fixing it to IE I suppose it might be >> a good idea to just hard code it to Browser.InternetExplorer in this case.
>> You never needed the second constructor in any case.