0

we are working on test automation using Cucumber-Java, Maven in Eclipse IDE below is the code which we are trying to execute but facing issues, kindly help us

I have also change default encoding to UTF-8

Cucumber code

# language: zh-CN

功能: 测试 

场景: 注册负方案

而且 一世 开放 "https://accounts.coursera.org/signup" 网址 在 该 浏览器

Below is the step implementation

@而且("一世 开放 \"([^\"]*)\" 网址 在 该 浏览器")
public void i_go_to_URL_Chinese(String url) {
    try {
        String configuredURL = config.getString(url);
        DriverFactory.getDriver().get(configuredURL);
        System.err.println(DriverFactory.getDriver().getTitle());
    } catch (Exception e) {
        DriverFactory.getDriver().get(url);
    }
}

I am facing errors in the cucumber syntax itself, below are the errors

error in the first line

missing 'Feature:' at '功能:'

error in the last line

required (...)+ loop did not match anything at input ''

How do we configure i18n in eclipse for cucumber-java? Do we need any special setup ? why is not recognizing Chinese script ?

testerBDD
  • 255
  • 3
  • 18
  • can anyone help us on this ??? – testerBDD Oct 26 '15 at 05:24
  • What Eclipse plugin do you use to edit your feature files? It is very likely that that plugin doesn't support Chinese. For example Natural (https://github.com/rlogiacco/Natural/wiki) can only edit files in English syntax (Cf. “Limitations” section). – Sébastien Le Callonnec Oct 26 '15 at 11:39
  • we have cucumber plugin and natural language plugin which helps to create,edit & execute cucumber scripts, cucumber does support Chinese http://cucumber.github.io/api/cucumber/jvm/javadoc/cucumber/api/java/zh_cn/package-summary.html we are able create scripts in English but not in any other language, cucumber claims to have support for more then 30 languages – testerBDD Oct 27 '15 at 05:10
  • Yes, cucumber-jvm *does* support Chinese, and you should still be able to execute the tests outside Eclipse (or in Eclipse without Natural). However, you will get syntax errors in Eclipse when editing the file because Natural doesn't recognize Chinese: its parser has nothing to do with gherkin and cucumber-jvm, it is based on Xtext. – Sébastien Le Callonnec Oct 27 '15 at 07:27
  • Thanks, will try to run outside eclipse and will update the result – testerBDD Oct 27 '15 at 12:16

0 Answers0