Simplest way to concatenate two strings in robot framework .?

user3170122 picture user3170122 · Oct 3, 2017 · Viewed 37.5k times · Source

Given two strings 'a' , 'b', what is the simplest way to concatenate them and assign to a new variable in robot framework.?

I tried this simple pythonic way, but it didn't work

${var}= 'a' + 'b'

Answer

Oleh Rybalchenko picture Oleh Rybalchenko · Oct 3, 2017

You can use Catenate from BuiltIn.

Example from docs:

${str1} =   Catenate    Hello   world   
${str2} =   Catenate    SEPARATOR=---   Hello   world
${str3} =   Catenate    SEPARATOR=  Hello   world
=>
${str1} = 'Hello world'
${str2} = 'Hello---world'
${str3} = 'Helloworld'