title: Cucumber DataTable Error - io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to cucumber.api.DataTable
body: <p>Trying to run a scenario with cucumber/selenium/java/intelliJ, but getting an error regarding the DataTable in one of the steps. The dataTable was working fine and converting the arguments for the step correctly before I started using a test runner and changed some things around, but I just can't get this to work.</p>
  
  <p>This is the error:</p>
  
  <pre><code>cucumber.runtime.CucumberException: Could not convert arguments for step [^I enter the following login details:$] defined at 'Steps.MaStepdefs.iEnterTheFollowingLoginDetails(DataTable) in file:/C:/Users/Kristian.Senior/Desktop/CukesReporting/target/test-classes/'.
  It appears you did not register a data table type. The details are in the stacktrace below.
      at cucumber.runner.PickleStepDefinitionMatch.registerTypeInConfiguration(PickleStepDefinitionMatch.java:59)
      at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:44)
      at cucumber.runner.TestStep.executeStep(TestStep.java:63)
      at cucumber.runner.TestStep.run(TestStep.java:49)
      at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
      at cucumber.runner.TestCase.run(TestCase.java:45)
      at cucumber.runner.Runner.runPickle(Runner.java:40)
      at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:146)
      at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
      at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
      at cucumber.api.junit.Cucumber.runChild(Cucumber.java:122)
      at cucumber.api.junit.Cucumber.runChild(Cucumber.java:64)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:131)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  Caused by: io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to cucumber.api.DataTable.
  Please register a DataTableType with a TableTransformer, TableEntryTransformer or TableRowTransformer for cucumber.api.DataTable.
      at io.cucumber.datatable.UndefinedDataTableTypeException.singletonNoConverterDefined(UndefinedDataTableTypeException.java:15)
      at io.cucumber.datatable.DataTableTypeRegistryTableConverter.toSingleton(DataTableTypeRegistryTableConverter.java:106)
      at io.cucumber.datatable.DataTableTypeRegistryTableConverter.convert(DataTableTypeRegistryTableConverter.java:75)
      at io.cucumber.datatable.DataTable.convert(DataTable.java:362)
      at io.cucumber.stepexpression.StepExpressionFactory$3.transform(StepExpressionFactory.java:73)
      at io.cucumber.stepexpression.DataTableArgument.getValue(DataTableArgument.java:19)
      at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:41)
      ... 29 more
  </code></pre>
  
  <p>Here is my scenario:</p>
  
  <pre><code>Feature: LoginFeature
    This deals with logging in
  
    Scenario: Log in with correct username
  
      Given I navigate to the login page
      And I enter the following login details:
        | username | password |
        | cukey    | passwoid |
      And I click the login button
      Then I should land on the newest page
  </code></pre>
  
  <p>Here's my step definitions:</p>
  
  <pre><code>package Steps;
  
  import Base.BaseUtil;
  import Pages.LoginPageObjeks;
  import cucumber.api.DataTable;
  import cucumber.api.PendingException;
  import cucumber.api.java.en.And;
  import cucumber.api.java.en.Given;
  import cucumber.api.java.en.Then;
  import io.github.bonigarcia.wdm.WebDriverManager;
  import org.junit.Assert;
  import org.openqa.selenium.By;
  import org.openqa.selenium.chrome.ChromeDriver;
  
  import java.util.ArrayList;
  import java.util.List;
  
  
  public class MaStepdefs extends BaseUtil {
      private BaseUtil base;
  
      public MaStepdefs(BaseUtil base) {
          this.base = base;
      }
  
      @And("^I click the login button$")
      public void iClickTheLoginButton() throws Throwable {
          LoginPageObjeks page = new LoginPageObjeks(base.Driver);
          page.ClickLogin();
  
      }
  
      @Given("^I navigate to the login page$")
      public void iNavigateToTheLoginPage() throws Throwable {
  
          base.Driver.navigate().to("http://www.executeautomation.com/demosite/Login.html");
  
      }
  
      @And("^I enter the following login details:$")
      public void iEnterTheFollowingLoginDetails(DataTable table) throws Throwable {
  
          List&lt;User&gt; users = new ArrayList&lt;User&gt;();
  
          users = table.asList(User.class);
  
          LoginPageObjeks page = new LoginPageObjeks(base.Driver);
  
          for (User user : users) {
              page.Login(user.username, user.password);
  
              //base.Driver.findElement(By.name("UserName")).sendKeys(user.username);
              //base.Driver.findElement(By.name("Password")).sendKeys(user.password);
  
              Thread.sleep(2000);
  
  
          }
      }
          @Then("^I should land on the newest page$")
          public void iShouldLandOnTheNewestPage () throws Throwable {
              Assert.assertEquals("It's not displayed", base.Driver.findElement(By.id("Initial")).isDisplayed(), true);
          }
  
  
  
      }
  
      class User {
          public String username;
          public String password;
  
          public User(String userName, String passWord) {
              username = userName;
              password = passWord;
          }
      }
  </code></pre>
  
  <p>Here is my pom:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;groupId&lt;/groupId&gt;
      &lt;artifactId&gt;ownCukes&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.5.1&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.19&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;version&gt;4.2.6&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;3.141.59&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
              &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
              &lt;version&gt;3.2.0&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-picocontainer&lt;/artifactId&gt;
              &lt;version&gt;4.2.6&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
              &lt;version&gt;4.2.6&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
              &lt;version&gt;4.2.6&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;info.cukes&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-core&lt;/artifactId&gt;
              &lt;version&gt;1.2.5&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>And here's my TestRunner:</p>
  
  <pre><code>package Runner;
  
  
  import cucumber.api.CucumberOptions;
  import org.junit.runner.RunWith;
  import cucumber.api.junit.Cucumber;
  
  @RunWith(Cucumber.class)
  @CucumberOptions(features = {"src/test/java/features"}, glue = "Steps")
  
  public class TestRunner {
  }
  </code></pre>
  
  <p>I'm not sure what a data table type is or how to register one? I've tried messing around with DataTableType and TypeRegistry but I'm not an expert. Any help would be appreciated, thanks</p>