Skip to content

reports error when robot case section headers use other languages #585

@heyinling

Description

@heyinling

since RF 6.0 it supports localization of section headers. For example, I'm writing my case file in Chinese:

*** 设置 ***    # Settings
资源文件    aa.resource


*** 用例 ***    # Test Cases
CASE_00001
    Sleep    5s

I'm using pabot to execute the suite, with arg --language zh-CN. It still reports error invalid section headers:

[ ERROR ] Error in file 'example.robot' on line 1: Unrecognized section header '*** 设置 ***'. Valid sections: 'Settings', 'Variables', 'Test Cases', 'Tasks', 'Keywords' and 'Comments'.

In pabot.py function generate_suite_names_with_builder, when calling TestSuiteBuilder, it didn't pass arg lang even language arg is set in command line. After passing language to TestSuiteBuilder it works as expected:

builder = TestSuiteBuilder(
    included_extensions=settings.extension, rpa=settings.rpa, lang=opts["language"]
)

Hope it can be fixed in next release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions