gpt4 book ai didi

python - 如何解析Robot Framework中的变量

转载 作者:行者123 更新时间:2023-11-30 23:29:12 24 4
gpt4 key购买 nike

我有一个值为 "x: 647, y: 1174" 的变量,我想将它们解析为两个单独的变量:${x} = 647${y} = 1174

这在机器人框架内可能吗?

最佳答案

String library会帮助你的。

${var}    Set Variable    x: 647, y: 1174
${x} Fetch From Left ${var} , # now x should be "x: 674"
${x} Fetch From Right ${x} ${SPACE} # and now it should be "674"
${y} Fetch From Right ${var} y:${SPACE}

或者编写一个与正则表达式执行相同操作的 python 函数。

关于python - 如何解析Robot Framework中的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21241999/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com