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 https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases

mogharr Default Asked on September 4, 2016 in Selenium WebDriver.
Add Comment
3 Answer(s)

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

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

mohamedz 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 = “http://www.demoqa.com”;

on November 8, 2016.
Add Comment

download the geckodriver.exe  and than add the above code.

atuldandin Train Answered on September 26, 2016.
Add Comment

I highly recommend The  Introduction to Selenium WebDriver – Selenium Tutorial: http://blog.testproject.io/2016/03/31/selenium-webdriver-tutorial/

DebbyStone Train Answered on October 13, 2016.
Add Comment

Your Answer

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