Selenium tests slow when migrated to .Net Core 2.0

49 views
Skip to first unread message

annika.o...@mecenat.com

unread,
Sep 21, 2017, 4:53:52 AM9/21/17
to Selenium Users
Hi

I have just migrated some test from .NET Framwork to .NET Core 2.0. When running the tests they are so slow when running in .NET Core 2.0 project

Anyone experiencing the same problem? 
Any solution for this? 

Examples addes below. LogInLogOutTest takes 3 sec running in .NET Framework project and 39 sec in the .NET Core project. 

 

Jim Evans

unread,
Sep 21, 2017, 8:07:48 AM9/21/17
to Selenium Users
First, there is no official support for .NET Core in the Selenium .NET bindings. That support is being actively worked on, but hasn’t been released yet.

Second, I strongly suspect that the issue is in the .NET Core implementation of HttpWebRequest. There is an issue with that component in .NET Core 2.0 when using “localhost” instead of an actual IP address in a dual-stack System (one that supports IPv4 and IPv6, as most systems do today). The resolution of “localhost” has an additional delay of >1 second for every call.

The reason that’s important to Selenium is that when you use a local driver (like ChromeDriver or FirefoxDriver), the .NET bindings use, guess what, “localhost” to communicate with the driver. So we are stuck for the moment. Doing DNS resolution manually within the bindings’ source code is a supremely suboptimal solution and one we don’t want to implement.

annika.o...@mecenat.com

unread,
Sep 25, 2017, 5:23:26 AM9/25/17
to Selenium Users
Thanks for your answer.

Regards
Annika
Reply all
Reply to author
Forward
0 new messages