I have tried this code in eclipse :
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class auto {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "/root/Desktop/jarselenium/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("https://www.easybooking.lk/login");
//driver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);
}
}
On execution I got this error :
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: /root/Desktop/jarselenium/geckodriver.exe
How can i set geckodriver location in ubuntu?
As you are using Linux based System while specifying the absolute path of the GeckoDriver you have to trim the extension part i.e. .exe
part as follows :
System.setProperty("webdriver.gecko.driver", "/root/Desktop/jarselenium/geckodriver");
As you are still seeing the error ensure that :
@Test
as a non-root user.