Getting error regarding pico container in cucumber framework | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos
10% May Month Discount Avail now

Selenium Training Forum

Getting error regarding pico container in cucumber framework

sumit kalra Post on 13/03/2019

Hi Ashish,

I have already added the pico container jar file in my maven based cucumber project.

Still I am getting the error "class com.qtpselenium.teststeps.loginTest doesn't have an empty constructor. If you need DI, put cucumber-picocontainer on the classpath"

screenshot attached.

below is the code of my


public class loginTest {

WebConnector conn;

public loginTest(WebConnector conn)

@Given("^I open (.*)$")
public void i_open(String browser)
System.out.println("I open-";
driver=new FirefoxDriver();
else if(browser.equals("chrome"))
driver=new ChromeDriver();

@And("^I navigate to (.*)$")
public void i_navigate(String browser)
System.out.println("i navigate to"+browser);

@And("^I type username as (.*) in (.*)$")
public void i_type_username(String username,String usernamefield)
System.out.println("I type username as username in usernamefield");

@And("^I type password as (.*) in (.*)$")
public void i_type_password(String password,String passwordfield)
System.out.println("I type password as username in passwordfield");
@And("^I click on (.*)$")
public void i_click(String button)
System.out.println("I click on"+button);





Demo Reply on 15/03/2019

You need to have the same version of all cucumber-* in your pom.xml