ChromeDriver does not exist in Selenium WebDriver C# test script

前端 未结 10 664
南旧
南旧 2021-02-01 02:24

I have come across a few people with the same issue that seemed to have solved the problem with System.addProperty(\"webdriver.chrome.driver\", \".../chromedriver.exe\");<

10条回答
  •  星月不相逢
    2021-02-01 02:40

    This is the error i see: OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable.

    I resolved this problem by specifying the 'testsettings' argument in the command to run the unit tests.

    E.g.

    E:\Development\SampleProject\SampleProject.MvcWebApp\SampleProject.MvcWebApp.JavaScriptUnitTests\JavaScriptUnitTests\bin\Debug>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:JavaScriptUnitTests.dll /category:"JavaScriptUnitTests" /testsettings:..\..\..\Local.Testsettings /resultsfile:..\..\..\..\..\MsTestResults\SampleProject.MvcWebApp.JavaScript.Tests.trx
    

    I use "/testsettings:......\Local.Testsettings" because the Local.testsettings file is 4 levels higher than the level where I am executing this command. You should change it accordingly.

    This is the command used in ccnet.config file

    
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe
        SampleProject.MvcWebApp\SampleProject.MvcWebApp.JavaScriptUnitTests\JavaScriptUnitTests\bin\Debug
        /testcontainer:JavaScriptUnitTests.dll /category:"JavaScriptUnitTests" /testsettings:..\..\..\Local.Testsettings /resultsfile:..\..\..\..\..\MsTestResults\SampleProject.MvcWebApp.JavaScript.Tests.trx
        0
    
    

提交回复
热议问题