I have trying to pass non English strings as parameters using Cucumber for automation Testing. The language used is Java. But when these strings are passed from feature files to steps definitions, French characters such as 'é' are printed as '?'. Is there a way by which I can pass Non-English characters as parameters?
I am trying to pass the string 'Décoration murale'. But when this is printed in Step Definitions, 'é' is printed as '?' Please see the screenshot attached.
@tag
Feature: String Verifcations
@PassNonEnglishCharacters
Scenario Outline: Verify non English parameters
Given I have my driver ready
Then I print collection "<collection>" name on console
Examples:
| collection |
| Décoration murale |
@Then("^I print collection \"([^\"]*)\" name on console$")
public void i_print_collection_name_on_console(String collection) throws Throwable {
System.out.println("Collection:" +collection);
}
Outcome on Console:
**Collection:D?coration murale**
To my knowledge, Cucumber and Java are using Unicode, which should support the French character you've mentioned. Perhaps there is an issue in the code which this step definition is calling, or with the environment where you are printing out this result? Perhaps a char is being used somewhere instead?