Open martijnburgers opened 7 years ago
Yeah originally my thinking was that sharing wasn't a good idea because the combinations of possible different drivers was large and I didn't know if it was really needed (wasn't sure if it helps with a grid or not).
Since you're the first person to use/ask for features for the remote driver I'll defer to your use cases.
At the moment I'm knee deep in another project, I'm not sure when I will get to this change. If you want to create a PR for it to speed things along that would be cool. If not I'll see what I can do over the next week or two.
No worries.
I am also pretty busy for a new project so I will only be able to file the issues I encounter. We can work from there whenever you or me got more time. I can work around those issues fairly easy so there is no hurry. When I have more time I am happy to help out.
In case you're interested these are the other two projects that I'm currently working.
Grace - Dependency injection container for .net, currently re-writing from the ground up for .netstandard and performance reasons.
SimpleFixture - Data generation library used by SeleniumFixture for creating random data as well as constructing models instances for the PageObject pattern.
I will look into them.
The
RemoteDriverAttribute
doesn't respect theShared
property. It will ignore it by always creating a new driver.In the code:
Unfortunately sub classing it and implementing the methods as follows doesn't work because of the cache implementation. In my scenario I have created a specific attribute for a Chrome remote driver.
The solution to get it to work with the current version of SeleniumFixture is to subclass
RemoteWebDriver
as well and change theCustomChromeRemoteDriverAttribute
toThe shared instance cache key should not only be the driver type because this will not work in case of multiple remote webdrivers with different capabilities.