Selenium WebDriver.ChromeDriver Nuget package installed, but not working for MSTest

后端 未结 7 505
予麋鹿
予麋鹿 2020-12-17 16:06

I have added the WebDriver.ChromeDriver nuget package to my solution, which contains the ChromeDriver.exe file, required for Selenium WebDriver to run automated tests using

相关标签:
7条回答
  • 2020-12-17 16:48

    I had to use a combination of the answers provided. First, I had to make the build step copy the chromedriver.exe to the output. I used Arrans answer to do this. If you don't want to install VS, I suspect that to you only need to change your project file to include this:

    <ItemGroup>
        <None Update="chromedriver.exe">
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
      </ItemGroup>
    

    It still didn't work. I then had to change my code to use RnDrxs answer by changing my chrome driver to

    new ChromeDriver(".");
    
    0 讨论(0)
提交回复
热议问题