I'm trying to read a Transaction ID from website and put that information in Excel Sheet via Robot Framework by creating the sheet using timestamp in the same file. I have saved the required Transaction ID in a variable, but when i'm trying to put this value to an excel file it is not saving any the changes that I'm doing to the file.
I tried two different things -
1.) First - I tried to create a new sheet in the file to check whether it is getting saved or not. Of course this new sheet did not get created but there are no errors, test case was passed. I have created a keyword which I'm calling with two arguments File_Name and Sheet_Name, they are coming correctly as I checked them after printing on log console
Create New Sheet
[Arguments] ${File_Name} ${Sheet_Name}
Log To Console ${File_Name}
Log To Console ${Sheet_Name}
#Now Open Excel and add the sheet and save it
Open Excel ${File_Name}
Add New Sheet ${Sheet_Name}
sleep 1s
Save Excel Transaction_File.xls
2.) Second - Once I got to knew that new sheet is not getting created in the file, so I thought to try writing the data to existing sheet which gets created by default on creating a new .xls file i.e. Sheet1, Here i'm getting below error - IndexError: list index out of range
Below is the keyword which I have created -
Create Header For New Sheet
[Arguments] ${File_Name} ${Sheet_Name}
#Create a new header
Open Excel ${File_Name}
Log To Console ${File_Name}
Log To Console ${Sheet_Name}
Put String To Cell ${Sheet_Name} 1 2 Sr.No
Put String To Cell ${Sheet_Name} 2 2 Scenario_Name
Put String To Cell ${Sheet_Name} 3 2 Test Case Name
Put String To Cell ${Sheet_Name} 4 2 Status
Put String To Cell ${Sheet_Name} 5 2 Comments/Values
#Now save the changes
Save Excel Transaction_File.xls
Below is the code which I have written in my test suite
*** Variables ***
${File_Name} C:\\Automation\\Automation_Details.xls
${Sheet_Name} Transaction_File.xls
*** Test Cases ***
Create New Sheet ${File_Name} ${Sheet_Name}
Create Header For New Sheet ${File_Name} Sheet1
Also below is the output for Log To Console -
C:\Automation\Automation_Details.xls
Transactions_201908190359
Could you please suggest or point what I'm doing wrong in order to fix this issue related to Data Writing.