Forum Discussion
Script is working in eclipes IDE.
I tried following the steps mentioned here - https://support.smartbear.com/readyapi/docs/testing/integrations/selenium/integrate.html
I get the error mentioned above.
---------------------
when I run following script -
import org.openqa.selenium.By;
import org.openqa.selenium.*;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
System.setProperty("webdriver.chrome.drive" , "C:/Users/Desktop/Files/logs/chromedriver.exe");
def driver = new ChromeDriver()
driver.get("http://www.google.com")
------------------------
I get following 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 error at line: 12
- nmrao7 years agoChampion Level 3Hope the "chromedriver.exe" file exist in the specified path as it works in IDE.
Can you try the below instead of above?
System.properties['webdriver.chrome.drive'] = 'C:/Users/Desktop/Files/logs/chromedriver.exe')- sridevihiranya7 years agoOccasional Contributor
Tried the code shared by you, still got the same error(java.lang.IllegalStateException)
- sprice0901617 years agoContributor
System.setProperty("webdriver.chrome.drive" , "C:/Users/Desktop/Files/logs/chromedriver.exe");
You have to use double slashes in your path definition:
System.setProperty("webdriver.chrome.drive" , "C://Users//Desktop//Files//logs//chromedriver.exe");