Not able to run in chrome

+2 votes
package co.tui.co.uk.webdriver.homepage;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class Day1 {

WebDriver driver;

public void invokeBrowser(){

try {

System.setProperty("Webdriver.chrome.driver", "C:\\Users\\extad7\\Downloads\\vAMSHI\\Chrome\\chromedriver.exe");

   driver = new ChromeDriver();

driver.manage().deleteAllCookies();

driver.manage().window().maximize();

driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);

driver.get("https://www.tui.co.uk/");

} catch (Exception e) {

e.printStackTrace();

}

}

public static void main(String[] args) {

Day1 myObj = new Day1();

myObj.invokeBrowser();

}

}

Below is the error.

java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

at com.google.common.base.Preconditions.checkState(Preconditions.java:847)

at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)

at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:33)

at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:139)

at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:335)

at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)

at co.tui.co.uk.webdriver.homepage.Day1.invokeBrowser(Day1.java:15)

at co.tui.co.uk.webdriver.homepage.Day1.main(Day1.java:31)
May 15, 2018 in Selenium by Vamshi
349 views

1 answer to this question.

+2 votes
Best answer

There is a very silly mistake in system set property line. The 'w' of webdriver.chrome.driver should not be in upper case.

Use this:

System.setProperty("webdriver.chrome.driver", "C:\\Users\\extad7\\Downloads\\vAMSHI\\Chrome\\chromedriver.exe");

Instead of this:

System.setProperty("Webdriver.chrome.driver", "C:\\Users\\extad7\\Downloads\\vAMSHI\\Chrome\\chromedriver.exe");
answered May 15, 2018 by king_kenny
• 3,610 points

selected May 16, 2018 by Sudhir
its working.. thanks for your quick response.  will get back to you if i face any issues.

Related Questions In Selenium

0 votes
1 answer

Not able to identify datepicker in chrome for my site "tui.co.uk".

Dear Vamshi, After clicking on the date box ...READ MORE

answered Jun 20, 2018 in Selenium by walter 123
• 240 points
58 views
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,070 points
864 views
0 votes
1 answer

Not able to use “explicit wait” in my code

To wait until the entire data has ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,070 points
70 views
0 votes
1 answer

Can anyone help me that how to run Selenium WebDriver test cases in Chrome?

Download the executable driver from: ChromeDriver Download Before ...READ MORE

answered Mar 29, 2018 in Selenium by nsv999
• 5,070 points
207 views
0 votes
1 answer

Not able to set ChromeDriver to run a TestNG programm

You have not set the system properties ...READ MORE

answered Apr 19, 2018 in Selenium by Meci Matt
• 9,400 points
112 views
0 votes
1 answer

Not able to open a new URL in a new tab in Selenium

There is a bug in ChromeDriver that ...READ MORE

answered May 21, 2018 in Selenium by Meci Matt
• 9,400 points
6,905 views
0 votes
1 answer

Not able to find web element in Span Tag

Try using class selector also. driver.findElement(By.cssSelector(".login-link")).click(); hash is used ...READ MORE

answered Jun 21, 2018 in Selenium by Samarpit
• 5,130 points
1,700 views
0 votes
1 answer
0 votes
1 answer

Not able to run WebDriver test with Google Chrome.

Firefox is just default browser for tests ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,610 points
273 views
0 votes
1 answer