2

This error comes out when running the test. I do not know how to solve it. they do not run in browser

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

The code itself:

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();

}
Dmitriy Fialkovskiy
  • 3,065
  • 8
  • 32
  • 47
  • 1
    Possible duplicate of [Serenity BDD test cases are not running on Chrome browser](https://stackoverflow.com/questions/31198965/serenity-bdd-test-cases-are-not-running-on-chrome-browser) – Grasshopper Mar 16 '18 at 15:54
  • 1
    @Grasshopper not at all duplicate. Problem here is not discussed there. It is intermittently giving this error. I mean it will continue to run without any problem and suddenly at next it wont launch chrome at all and give this error. – paul Oct 23 '18 at 13:06

1 Answers1

2

I had same issue during the first run of serenity-cucumber4-smoketests. The problem was in the chromedriver.exe version located in the skeleton. After I replaced it to a new one supported by my company, the test had passed. But same issue might happen if the path to the driver is not selected correctly.

gelo3000
  • 36
  • 2