The .NET team released Preview 2 of .NET Core 2.0 as well as a newer build of Visual Studio Preview 15.3 (Preview 3) yesterday:
https://blogs.msdn.microsoft.com/dotnet/2017/06/28/announcing-net-core-2-0-preview-2/
Here are the downloads for .NET Core 2.0 Preview 2:
One of the big changes for .NET Core 2.0 is the addition of more than 20,000 new APIs to the framework. They are expanding the API list so it’s easier to migrate older apps to .NET Core. They say 2.0 will support 70% of all existing packages in the Nuget repo.
Selenium with .NET Core
Last November (2016), I blogged about how the Selenium team had not yet added support for .NET Core but a community member had forked the code and created a new Nuget package with support. At this time the Selenium team still hasn’t added official support for .NET Core but they may not need to now.
I’m happy to confirm .NET Core 2.0 Preview 2 can successfully run Selenium tests using the official Selenium Nuget packages with no additional changes or unofficial extensions. I have not performed extensive testing by any means but basic UI automation with Selenium definitely works now with the latest preview.
Here is a working solution:
https://github.com/rschiefer/SeleniumInDotNetCore2P2
Core 2.0 compatibility
Its great to see a very tangible example of a pre-existing Nuget package that broke with .NET Core 1.0 now working with 2.0. This goes to show that Microsoft is listening to customers and adjusting their plans accordingly.
I have actually been testing Selenium with each new .NET Core preview that is released and each seemed to get a bit closer to working. .NET Core 2.0 Preview 1, for example, had an issue with finding the System.Security.Permissions API. But that was resolved with Preview 2.
Microsoft provides a very cool API search tool which makes it very easy to research what APIs are available in each version of .NET:
https://docs.microsoft.com/en-us/dotnet/api/?view=netcore-2.0&term=system.security.permissions
Summary
Microsoft is getting closer to a final release of .NET Core 2.0 (target for this fall last I heard) and making good on their promise to increase backwards compatibility of the framework. This will make it far easier for developers to port their legacy code to .NET Core and gain all its benefits (cross-plat, speed, modular, flexible deployment, open source).
Pingback: Selenium with .NET Core–May 1, 2017 Update – dotnet catch
It can’t work on MacOS and Ubuntu
It seems the Selenium.WebDriver still references framework 4.6.1. Is there a way to fix that?
Not sure. I would suggest opening an issue on the Github repo.
Thanks for putting this together, rschiefer!
Had a few questions for you:
I’m finding that Selenium’s performance in .NET Core… leaves a lot to be desired, to say the least. I’m seeing calls to the Selenium APIs take 3+ seconds in .NET Core, where in .NET Framework they were taking around 100 milliseconds.
Is this something you’ve noticed? Any idea what the cause of this is, or if there’s a workaround for it? I’d ask the good folks at Selenium, but I feel a little weird doing so given they don’t officially support .NET Core 🙂
No, I haven’t noticed it but also haven’t used it a lot. I would suggest opening an issue in the .NET Github page. They can probably help. Especially if you have a working example to share.
Looks like the project maintainer himself (and others) are on the case: https://github.com/dotnet/corefx/issues/24104