TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • TestNG
  • Tools
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

JBehave

Debug Serenity BDD JBehave project

JBehave

Introduction

In this post, we will learn how to debug a Serenity BDD JBehave project in case of test errors, failures, and exceptions. Note that, this post outlines steps to find the root cause that helps automation beginners in the Serenity project.

Serenity BDD Project was set up using the steps: Install Serenity BDD project using Maven.

Tools used:

  • JDK.
  • Eclipse IDE.
  • Maven.
  • Serenity BDD.
  • JBehave.
  • Selenium WebDriver.

Errors and exceptions in Serenity Project:

Let’s say you are performing a dry run in your IDE. Check the console for the exceptions and stack trace. The first thing you notice is the maven console log build failure.

 

A couple of locations where you can find the errors and exceptions are.

1. You can find the exceptions in Maven build console as shown below:

 

Serenity Reports

2. Serenity story reports under the folder :

{PROJECT_HOME}\target\site\serenity –> index.html

The common indication of some automation project issues or environmental issues is that you would see a high number of failures in the stories.

 

 

Click on the story that has failed.

Drill down to the step where the error has occurred.

Click the View Stack trace button.

Root cause

net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate class org.openqa.selenium.firefox.FirefoxDriver  Exception

 

This exception is caused when the browser driver is not present , or  unsupported version is being used , or some anti virus protected Firefox to be launched etc.

Check maven pom.xml properties , serenity.properties for the version or which browser you are running the tests on. In most cases replace the driver with the latest version from the official Selenium website.

Fix the Error

Let’s replace the Firefox gecko driver with the latest version. After the fix re-run the serenity tests.  The fix worked and tests have run.

 

 

In long run of the project, you can actually take hints from the failures in the tests, Jenkins CI pipeline, recent changes etc.. for finding the root causes. For example,a huge spike in automation failures would point an environmental issue, project issue etc.

On the other hand, isolated one or two story failures, you may need to look at the automation code steps, business logic , story verification behavior etc, .

 

JBehave Tutorials on this website can be found at:
https://www.testingdocs.com/jbehave-framework-tutorial/

For more details on the JBehave framework, visit the official JBehave website at:
http://jbehave.org

Related Posts

Create a New Project Eclipse

JBehave /

Cucumber Java BDD Selenium Framework

JBehave + Serenity Sample Project

JBehave /

JBehave + Serenity Sample Project

Serenity BDD Automation Framework

JBehave /

Serenity BDD Automation Framework

Serenity Maven Artifacts

JBehave /

Serenity Maven Artifacts

Introduction to Serenity BDD

JBehave /

Introduction to Serenity BDD

‹ Adding Stories to JBehave project› Write Step Class for a JBehave Story

Recent Posts

  • Antivirus Products for Windows 11 PC
  • Install CodeBlocks IDE on Windows 11
  • Location Privacy Settings on Windows
  • Windows 11 Virus & Threat Protection
  • Download & Install Python on Windows 11
  • Cumulative Update for Windows 11 Version
  • Test execution speed in Selenium IDE
  • Check Windows 11 Free Upgrade
  • Download IntelliJ IDE on Windows 11
  • New MySQL Connection in Workbench

Back to Top

Automation Tutorials

  • JBehave Tutorial
  • Selenium Tutorial
  • TestNG Tutorial
  • JUnit Tutorial

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version