• Register
0 votes
205 views

Problem :

Facing following Selenium Webdriver error
the path to the driver executable must be set by the webdriver.chrome.driver system property
6 5 3
6,930 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

The path of your Chrome Driver is incorrect. And you must set the property before WebDriver initialisation as follows.

System.setProperty("webdriver.chrome.driver","D:\\List_of_Jar\\chromedriver.exe") ;

WebDriver wd =new ChromeDriver(); 

String baseUrl = "https://www.google.com"; 

wd.get(baseUrl);

9 7 4
38,600 points
0 votes

The path to the driver executable must be set by the webdriver.chrome.driver system properly.

Reason:

If you are experienced this error, then error means that you have not told your system where to find your driver executable. Unlike when using the Firefox WebDriver you need to download a driver executable that is specific for chrome and builds the connections part between your Java Selenium program and the chrome Webbrowser.

Solution:

To fix this problem you have to follow these steps;

  • Download the latest Chrome Driver for your operating system. If you are working with windows then choose “chromedriver_win32.zip”
  • Extract the content of the zip file to any place of your computer, that you will remember later.
  • After replacing the location of the chromedriver.exe with the specific location on your computer. Then add the following code to your Selenium program before creating a new instance of ChromeDriver.
System.setProperty("webdriver.chrome.driver","C:/Your/Path/to/chromedriver.exe");

That is the solution to the above problem.

Code sample:

A whole working code sample can look like this;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

/**

 * @author Nils Schuette via frontendtest.org

 */

public class ChromeDriverTest {



            /**

             * @param args

             * @throws InterruptedException

             */

            public static void main(String

              .

            .

}

 

11 5 2
3,890 points

Related questions

0 votes
1 answer 5 views
0 votes
1 answer 11 views
11 views
I am trying to launch Mozilla but still I am getting this error
asked Dec 15, 2020 TeamScript 11.1k points
0 votes
1 answer 14 views
14 views
I am finding a program that will help me to handle multiple windows in Selenium Webdriver.
asked Oct 5, 2020 Daniel Anderson 4k points
0 votes
1 answer 122 views
122 views
Problem : I am trying to learn the Selenium by myself. But now my Sendkeys is not working. Can anybody please help me to fix my issue. My code is as below: WebElement uname = driver.findElement(By.xpath("//*[@id='username']"));      uname.sendKeys("123456"); Below is the error: Exception in ... ip: '192.168.0.103', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_161'
asked Feb 14, 2020 mphil 2.3k points
0 votes
1 answer 18 views
18 views
Problem: I am very new to Selenium and Java both. I am trying to select and get the dropdown value in a Selenium WebDriver using the Java. The HTML Code is as below: <select class="form_input_select bx-def-font" name="Sex[0]"> <option value="Male">Man</option> < ... it only shows _Others Kindly help me to solve above issue. I am unable to fix above issue after working on it for more than 3 days.
asked Jul 9, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 14 views
0 votes
1 answer 83 views
83 views
Problem : I am new to Chown. I am still learning it. I tried to set the EACCESS for the npm and then I ran the Chown command in the terminal to change the owner permission but currently i am totally stuck in following "Sudo : /usr/bin/sudo must be owned by uid 0 and have the setuid bit set" I am using ubuntu14.04 LTS. How to fix this error?
asked Feb 27, 2020 mphil 2.3k points
0 votes
2 answers 1.2K views
1.2K views
Problem : I have the list which has the multiple links under each section. Each section has the same links I need to click the particular link under each section. I have written my code for it but when I execute the code it gives me below error: Exception in thread "main" org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
asked Jan 18, 2020 jwilliam 3.9k points
0 votes
1 answer 9 views
9 views
Problem: I'm new to programming and started with Python about two months ago and am going over Sweigart's Automate the Boring Stuff with Python text. I'm using IDLE and already installed the Selenium module and the Firefox browser. Whenever I tried to run the webdriver function, I get this: from selenium import webdriver browser = webdriver.Firefox()
asked Jan 6 Mashhoodch 6.7k points
0 votes
1 answer 71 views
71 views
Problem: I think my Jenkins would ssh in and execute the commands described in a specific job which is running. Currently I want to run my Selenium Webdriver tests but unfortunately it informs me that I have many errors while trying to launch the firefox. I am also ... 45000 ms. Firefox console output: [testng] Xlib: connection to ":0.0" refused by server [testng] Xlib: No protocol specified
asked Jul 11, 2020 Raphael Pacheco 4.9k points