-1

I am facing issue while running selenium scripts on linux server . Issue is about chrome driver .

Tried to run selenium script on linux server

facing issue in WebDriver driver = new ChromeDriver() step.

  • my error is :Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:125) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:156) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService. – Rohan Doshi Jun 27 '19 at 21:00
  • That is suggesting that there is no executable. Is the correct executable located in the appium > chromdriver node module directory? Executable would be like that seen here: https://chromedriver.storage.googleapis.com/index.html?path=76.0.3809.25/ – Asyranok Jun 27 '19 at 21:15
  • 1
    Please show the relevant code and state the exact problem or error. Also see [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). Here is an example of a Selenium [MCVE with error](https://stackoverflow.com/q/56672936/608639). – jww Jun 27 '19 at 22:09

1 Answers1

0

This should solve your issue : https://stackoverflow.com/a/49022224

You need to download the chrome driver and set property:

System.setProperty("webdriver.chrome.driver", "C:\\path\\to\\chromedriver.exe");
WebDriver driver = new ChromeDriver();

Download chrome driver from here: https://sites.google.com/a/chromium.org/chromedriver/

Shahboz
  • 466
  • 2
  • 10
  • 30
  • I added this still same error , any issue about guava jar file version ? I am using 25.0 – Rohan Doshi Jun 27 '19 at 21:28
  • can you share your code where you're setting the property and where the executable driver is located? – Shahboz Jun 27 '19 at 21:35
  • System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver"); WebDriver driver = new ChromeDriver(); – Rohan Doshi Jun 28 '19 at 13:41
  • my executable driver is located in /usr/bin folder on linux server and i am giving the same path . What can be the issue ? – Rohan Doshi Jun 28 '19 at 14:23
  • I am using below : Google Chrome 75.0.3770.100 ChromeDriver 2.10.267518 Selenium - 3.14 – Rohan Doshi Jun 28 '19 at 15:17
  • Add the file format as well: System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver.exe"); – Shahboz Jun 28 '19 at 16:11
  • Try to put your chromedriver in another location such as desktop and try the absolute path to the driver – Shahboz Jun 28 '19 at 16:12
  • I am trying this on linux server , windows is running fine . Linux will have System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver" – Rohan Doshi Jun 28 '19 at 18:07