0

我尝试制作一个 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");
    }
}

截图-eclipse-项目

4

1 回答 1

0

这是将为您提供 jar 文件的下载链接: https ://www.selenium.dev/downloads/

下载它们,然后在项目中创建一个名为:lib 的文件夹并在其中添加 jar 文件

于 2020-11-03T19:16:21.130 回答