blob: 9f376f9bc2d3cdb246a84e79dc8d4ba706805a0f [file] [log] [blame]
Patrick Brady89254c12017-10-11 09:50:17 -07001*** Settings ***
2Library Selenium2Library
3Library OperatingSystem
4Library DateTime
5Library String
6##Library HttpLibrary.HTTP
7Library Collections
8
9
10*** Keywords ***
11
12Get Server time
13 [Documentation] Getting server time to update the json request
14 [Arguments] ${RequestFile}
15
16 ${date}= Get Current Date time_zone=local result_format=%Y-%m-%dT%H:%M:%S.%fZ exclude_millis=False
17
18 #updating the request file with the server time
19 ${file_content}= OperatingSystem.Get File ${RequestFile}
20 @{list}= Split to lines ${file_content}
21 ${data}= Get from list ${list} 5
22 @{splitted_string}= Split String ${data} : 1
23 ${time}= Get From List ${splitted_string} 1
24 Log ${time}
25 @{splitted_string_time}= Split String ${time} " 2
26 ${times1}= Get From List ${splitted_string_time} 1
27 Log ${times1}
28 ${replaced_string}= Replace String ${data} ${times1} ${date}
29 @{list1}= Split to lines ${file_content}
30 Remove from list ${list1} 5
31 Insert into list ${list1} 5 ${replaced_string}
32 Remove File ${RequestFile}
33 :FOR ${line} IN @{list1}
34 \ Append to File ${RequestFile} ${line} encoding=UTF-8
35 \ Append to File ${RequestFile} ${\n} encoding=UTF-8
36
37
38
39
40