如何在Robot Framework中将Dictionary转换为String或StringBuffer?

ind*_*kar 0 robotframework

我正在尝试将Dictionary转换为String for Regex模式匹配但是为此我们需要字符串或stringbuffer任何想法如何做到这一点?

A. *_*tra 5

BuiltIn库中有一个标准关键字Convert To String,您可以使用它:

*** Test Cases ***
TC
    ${dict}            Create Dictionary    a=1    b=2    c=3
    ${nested_dict}     Create Dictionary    first=${dict}    second=${dict}

    ${string}    Convert To String    ${dict}
    ${nested}    Convert To String    ${nested_dict}
Run Code Online (Sandbox Code Playgroud)