Chrome驱动程序在Linux中启动时崩溃

时间:2020-10-26 09:44:34

标签: java linux eclipse selenium google-chrome

package webapp;

//import java.sql.Driver;
//import java.util.*;

//import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class app {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

System.setProperty("webdriver.chrome.driver","/home/ajay/Documents/Driver/chromedriver.exe");
WebDriver driver = new ChromeDriver();

driver.get("https://www.facebook.com/");

driver.get("https://www.facebook.com/");
        
//System.out.println("Hlinux"
        //+"ello");
    }




    }

您好,我正在Eclipse上使用selenium webdriver进行驱动,但是chrome驱动程序已启动,但立即崩溃,请看一下。

1 个答案:

答案 0 :(得分:2)

chromedriver.exe是Windows操作系统的可执行文件。它不会在Linux上运行。从here下载适当的驱动程序。

还请确保已下载的文件设置了适当的执行权限。