2017-05-05 4 views

答えて

3

これもインラインで行うことができます。 {名前} @第3ステップ `において

${SUITE NAME.rsplit('.')[0]} 
5
${the name}= Set Variable ${SUITE NAME} 

# split the output on every . character 
${the name}= Split String ${the name}  separator=. 

# get the last member of the split 
${the name}= Set Variable @{the name}[-1] 

Log To Console  ${the name} # prints testsuitename in your example 

P.S.あなたのスイート名にドットを使用すると、不快になります。

+0

[ - 1]' '@ {名[-1]}それほどではない' –

+0

@OrsuSuniであるべきです。 [個々のリストアイテムにアクセスする](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#list-variables)をチェックすると、リストメンバーにアクセスする形式は、私が書いたのと同じです。 '@'オペランドはリストの展開を行い、スライスは最後の要素を選択します。 '{name [-1]}'は[拡張変数構文](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extended-variable-syntax)の一部です。もし変数が '$'で呼び出されたとして、あなたが提案したように '@'で失敗すると... – Todor

+0

...メンバはリストのようなオブジェクト(文字列)ではないので、展開できません。自由に自分自身をチェックしてください、それは動作しません:) – Todor