Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium.WebDriver.ChromeDriver - chromedriver.exe is not being publishing for netcore2.2 target framework

I installed nuget package - Selenium.WebDriver.ChromeDriver 2.46.0.. When I publish (through dotnet publish .Net CLI command) .csproject (target framework - netcore2.2) the chromedriver.exe is not being copying on output/publish folder.. Can you please someone assist me?

like image 750
sanjay kulkarni Avatar asked Mar 05 '19 16:03

sanjay kulkarni


People also ask

How do I add ChromeDriver exe to path?

Go to the terminal and type the command: sudo nano /etc/paths. Enter the password. At the bottom of the file, add the path of your ChromeDriver. Type Y to save.

Where is ChromeDriver in Selenium C#?

Copy Chromedriver.exe into your project's solution / project folder. Add it to the project in visual studio. Right click the file and choose properties. Build Action should be set to 'Content'.

Does Selenium ChromeDriver need Chrome to be installed?

Users provided relevant link to confirm that, "YES" a full Chrome installation is needed in addition to the actual chromedriver.


1 Answers

From the project owner github page:

"chromedriver(.exe)" isn't included in published files on default configuration. This behavior is by design.

If you want to include "chromedriver(.exe)" into published files, please define _PUBLISH_CHROMEDRIVER compilation symbol.

enter image description here

OR

Define PublishChromeDriver property with value to "true" in MSBuild file (.csproj, .vbproj, etc...) to publish the driver file.

<Project ...>
    ...
    <PropertyGroup>
      ...
      <PublishChromeDriver>true</PublishChromeDriver>
      ...
    </PropertyGroup>
...
</Project>

Note: MSBuild property always override the condition of define _PUBLISH_CHROMEDRIVER compilation symbol

like image 69
Hasta Tamang Avatar answered Oct 20 '22 07:10

Hasta Tamang