Sivabalakrishnan
Sivabalakrishnan

Reputation: 515

Robot Framework : ${SPACE} behavior while using it from command line

${SPACE} Directly in Robot file:

but ${SPACE} when we pass a value through cmd line

so my question is,

What is the way to send a value through cmd line to make ${space} replaced to " "(space char)?

you can refer to the image.

enter image description here

Thank you in advance.

Upvotes: 0

Views: 1782

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385970

From the command line you must use command line processing rules. In this case, a single space is what you need to represent a single space. Because the command line uses spaces to separate arguments, you must quote the string so that the space is preserved.

Either of the following will work, and you can use either double quotes or single quotes as long as they are balanced:

robot -v 'cmdstring:New Profile' ...
robot -v cmdstring:'New Profile' ...

Another way if you're using a bash-like shell is to use the backslash to escape the space:

robot -v cmdstring:New\ Profile ...

Upvotes: 2

Related Questions