kirti kumbhar
kirti kumbhar

Reputation: 71

Convert list into string in robot framework

I want to convert given list into [u'', u'src', u'kirti', u'lib', u'auto'] string using robot framework /src/kirti/lib/auto/

Upvotes: 3

Views: 10264

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386010

Assuming that the robot list @{data} contains the information you want to join, you can use evaluate along with robot's special syntax for variables to call the python join method:

*** Test Cases ***
Example
    @{data}=  create list  ${empty}  src  kirti  lib  auto
    ${path}=  Evaluate  "/".join($data)
    should be equal  ${path}  /src/kirti/lib/auto

Upvotes: 4

Related Questions