0

I try to make an exe file or something that could just open and work on my desktop. It works in Eclipse when I click run. I try to export it as a runnable jar file in Eclipse but it does not work. I guess it maybe the library or chromedriver path problem. Has someone successfully done this before?

package webdriver;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;

public class test {
    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver","chromedriver" );
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.google.com");
    }
}

screenshot-eclipse-project

F. Müller
  • 3,969
  • 8
  • 38
  • 49
James1108
  • 1
  • 2
  • Use IntelliJ instead of Eclipse and then make a gradle project. This allows you to create a 'fat jar' (https://www.baeldung.com/gradle-fat-jar) which can include all your sources – IntoVoid Nov 03 '20 at 19:16
  • Hi james, if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – YourHelper Nov 05 '20 at 22:21

1 Answers1

0

Here are the download link that will give you the jar file : https://www.selenium.dev/downloads/

download them and then in the project create a folder with name : lib and add the jar files inside

YourHelper
  • 703
  • 7
  • 17