Cucumber + Java
Introduction to Cucumber Installation of CucumberAdding Cucumber dependency to Java project Writing first cucumber test Executing Cucumber tests using Cucumber class Cucumber options Tagging the scenarios Using name option Passing parameters to steps Key – Value pair Datatable Multiple column datatable in Cucumber Scenario Background Scenario outline Running multiple feature files in Cucumber Sharing selenium Webdriver instance using PicoContainer Embedding the screenshot Writing to Cucumber HTML reports Cucumber dependency for using Lambda expressions in Java 8 Cucumber test using Lambda expressionsLambda dependency in cucumber
In Java 8, Lambda expressions were introduced. Cucumber allows you to write step definitions using Lambda expressions. You need to add below dependency to write tests using Lambda expressions.
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java8</artifactId>
<version>1.2.4</version>
<scope>test</scope>
</dependency>
Ensure that JDK version is 1.8.0_51. Otherwise you will get below error. Exception in thread “main” cucumber.runtime.CucumberException: Failed to instantiate class …….CucumberException: java.lang.IllegalArgumentException: Wrong type at constant pool indexWeb development and Automation testing
solutions delivered!!