Error: Could not instantiate class org.openqa.selenium.chrome.ChromeDriver

Error: Could not instantiate class org.openqa.selenium.chrome.ChromeDriver

这个错误是在运行测试的时候出现的。 我不知道如何解决。他们不会 运行 在浏览器中

Could not instantiate new WebDriver instance of type class 
org.openqa.selenium.chrome.ChromeDriver

代码本身:

package com.automation.correo;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.annotations.Steps;
import pasos.pasoscorreo;

@RunWith(SerenityRunner.class)
public class testcorreo {

@Managed(driver = "chrome", uniqueSession = true)
WebDriver driver;

@Steps
pasoscorreo buyer;

@Test 
public void Ingresar_Gmail_Valida_Correo_NoLeido() throws InterruptedException {

    buyer.Abrir_Gmail();
    buyer.Ingresar_usairio("Ingsisacontreras");
    buyer.Ingresar_password("fdfdfd;");
    buyer.Buscar_correo("Alejandro Rendon ");
    buyer.UsuarioCon_correo();
    buyer.Ultimo_correo();
    buyer.Descripcion_Correo();
    driver.close();

}

我在 serenity-cucumber4-smoketests 的第一次 运行 中遇到了同样的问题。问题出在框架中的 chromedriver.exe 版本中。换成我公司支持的新的后,测试通过了。但是如果没有正确选择驱动程序的路径,可能会出现同样的问题。