An extension to Concordion to modify exception message text
Java HTML CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
gradle/wrapper
src
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE.txt
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat

README.md

Build Status Maven Central Apache License 2.0

This Concordion extension provides the capability to modify exception message text. While initially created to remove superfluous debug information from WebDriver exception messages, it could be used for translating exception messages to other languages.

The demo project demonstrates this extension using Concordion with Selenium WebDriver.

Installation

The extension is available from Maven Central.

Introduction

The easiest way to configure is to use the @Extension annotation on an instance field of type ExceptionTranslatorExtension within the fixture class.

For example, the following code configures the extension to remove text from the exception message starting from the string "Debug info:".

        @Extension
        public ConcordionExtension extension =
            new ExceptionTranslatorExtension(new ExampleMessageTranslator());

where ExampleMessageTranslator is:

        public class ExampleMessageTranslator() implements MessageTranslator {

            @Override
            public String translate(String originalMessage) {
                int debugInfoStart = originalMessage.indexOf("Build info:");
                if (debugInfoStart > 0) {
                    return originalMessage.substring(0, debugInfoStart);
                }
                return originalMessage;
            }
        }

Further info