1 #Robot functions that will be shared also with other tests
5 #Robot function to extract the json object from a file
6 [Arguments] ${file_path}
7 ${json_file}= Get file ${file_path}
8 ${json_object}= Evaluate json.loads('''${json_file}''') json
9 [return] ${json_object}
12 #Robot function to transform the json object to a string
13 [Arguments] ${json_value}
14 ${json_string}= Stringify Json ${json_value}
15 [return] ${json_string}
18 #Robot function to generate a random IP
20 ${numbers}= Evaluate random.sample([x for x in range(1, 256)], 4) random
21 ${generated_ip}= Catenate ${numbers[0]}.${numbers[1]}.${numbers[2]}.${numbers[3]}
22 [return] ${generated_ip}