RE: I get error message when I run “First Test Case with Selenium WebDriver”: Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see The latest version can be downloaded from

mogharr Default Asked on September 4, 2016 in Selenium WebDriver.
Add Comment
3 Answers

You have to configure selenium webdriver in your test as follows:

public static WebDriver driver;
System.setProperty(“”,<Path to chrome driver executable file>);
driver=new ChromeDriver();

Default Answered on September 4, 2016.

could you be more specific where exactly to put this code ? So far I have the code below and I cannot move forward with this tutorial

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;

namespace SeleiumWithCSharp
class FirstTestCase
static void Main(string[] args)
IWebDriver driver = new FirefoxDriver();
driver.Url = “”;

on November 8, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.