Cucumber JVM Exceptions – BDD
- Existing Cucumber Issues Click this link Cucumber JVM Existing Issues
- BUILDING AUTOMATION Framework Using Cucumber Cucumber BDD Framework
- Cucumber Wiki
- Gherkin Language Wiki
- Selenium WebDriver Fwk
Executing the below programs throws the following Exception cucumber.api.PendingException
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
package com.cucumber.pages; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; public class LoginPage { WebDriver driver; @Given("^Open Application and Enter the url$") public void open_Application_and_Enter_the_url() throws Throwable { System.setProperty("webdriver.chrome.driver","chromedriver.exe"); driver = new ChromeDriver(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(90, TimeUnit.SECONDS); driver.get("https://demo.openmrs.org/openmrs/login.htm"); throw new PendingException(); } @When("^Enter user name and password$") public void enter_user_name_and_password() throws Throwable { driver.findElement(By.id("username")).sendKeys("Admin"); driver.findElement(By.id("password")).sendKeys("Admin123"); driver.findElement(By.id("Inpatient Ward")).click(); driver.findElement(By.id("loginButton")).click(); throw new PendingException(); } @Then("^User should be able to see user home screen$") public void user_should_be_able_to_see_user_home_screen() throws Throwable { throw new PendingException(); } } |
Resolution:
Remove throw new PendingException(); from your steps
Exception in thread “main” cucumber.runtime.CucumberException: No backends were found
Resolution :
Add the following dependency in the pom.xml which will resolve the issue.
1 2 3 4 5 6 |
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java --> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java</artifactId> <version>1.2.5</version> </dependency> |