.NET Core Selenium WebDriver not found .NET Core Selenium WebDriver not found selenium selenium

.NET Core Selenium WebDriver not found


This happens because in .Net Core the NuGet packages are loaded from a global location instead of the packages folder in .NET Framework projects.

You can use the following and it will run correctly:

ChromeDriver driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));


This works for me

        var currentDirectory = Directory.GetCurrentDirectory();        var driverService = ChromeDriverService.CreateDefaultService(currentDirectory);                driverService.Start();        var driver = new ChromeDriver(driverService);


What i did when i had the problem was to set a var:

var driverDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);

And just pass it to ChromeDriver on creation.