Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium test project C# not running Chrome [closed]

I request selenium test in running chrome but I encountering an Exception. help me pleass. my code is:

using System;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using OpenQA.Selenium.Support.UI;
using System.Text;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome; 

namespace Acceptance_Test.Trader
{
    [TestFixture]
    public class AcceptenceTestBtcTraderCom
    {
        private IWebDriver _driver;
        private StringBuilder _verificationErrors;
        private string _baseUrl;


        [SetUp]
        public void SetupTest()
        {
            _driver = new ChromeDriver(); // ** exception location is this one.

An exception of type 'OpenQA.Selenium.DriverServiceNotFoundException' occurred in WebDriver.dll but was not handled in user code Additional information: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at chromedriver.storage.googleapis.com/index.html

like image 350
Turgut Kanceltik Avatar asked Aug 13 '14 11:08

Turgut Kanceltik


1 Answers

You need to add the path to the chrome driver:

_driver = new ChromeDriver("C:\\Folder_with_Chrome_driver");

If you have not downloaded the driver, you can find it here.

like image 132
Shahid M Zubair Avatar answered Oct 14 '22 20:10

Shahid M Zubair