我尝试制作一个 exe 文件或可以在我的桌面上打开和工作的东西。当我单击运行时,它在 Eclipse 中工作。我尝试在 Eclipse 中将其导出为可运行的 jar 文件,但它不起作用。我想这可能是库或 chromedriver 路径问题。以前有人成功地做到过吗?
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");
}
}