1
votes

I'm trying to create WebDriver wrapper nuget package that will be used in my company with supporting .net core. I added to this package reference to OpenQA.Selenium.Chrome and trying to create new ChromeDriver:

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

When I add my nuget package to test and run it, I've got an error:

The file C:\Users\MyUser\ .nuget\packages\\0.0.0.1\lib\netstandard2.0\chromedriver.exe does not exist

The problem is that the true path to the chromedriver is: c:\Users\MyUser\ .nuget\packages\selenium.chrome.webdriver\2.33.0\driver\

How it could be managed? When you create ChromeDriver from the test project it's easy because it's placed to the bin directory of your project, but what to do in case of nuget package?

1
Have you tried adding Selenium.Chrome.WebDriver to your dependencies in your .nuspec file?Marcel
it doesn't helpDarkNik

1 Answers

1
votes

Actually the best way that I found out it's to add Selenium.Chrome.Webdriver nuget directly to tests and create webdriver like

var driver = new ChromeDriver(Directory.GetCurrentDirectory());

in my nuget package. Unfortunately I didn't know how to resolve it without referencing Chrome.Webdriver nuget to tests