robotframework - Is it possible to have a variable span multiple lines in robot framework -


i have long regex put variable test with. i'd able put on multiple lines it's not unreadable. saw multiple lines documentation tag. when try formatting, robot seems think list. there way in robot framework?

${example_regex} =      '(?m)setting ip address [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\nsetting mac address [0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}\nsetting ip forwarding kernel options' 

would able write:

${example_regex}   '(?m)setting ip address [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\n                      setting mac address [0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}\n                      setting ip forwarding kernel options' 

unfortunately, robotframework doesn't directly support multiline literal strings. however, can same effect using catenate keyword in test case or keyword join data spread across multiple cells. sure escape backslashes, , set separator character empty string if don't want newlines in data.

for example:

*** test cases *** multiline variable example   ${example_regex}=  catenate  separator=   ...  (?m)setting ip address [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\n   ...  setting mac address [0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}\\n   ...  setting ip forwarding kernel options   log  regex: '${example_regex}' 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -