How to auto reload Excel file during runtime?
Posted: Wed Mar 01, 2017 12:52 pm
Hi,
I have two test cases (say Test Case A and Test Case B) in my Test Suite each referring to the same Data Connector (i.e. same Excel Connector).
In Test Case A I have a code to open the Excel file during runtime, write some value (say '100') in a column named 'strcallID' in this case, save it and close it. Please follow the code below:
var excelApp = new Excel.Application();
excelApp.Visible = true;
excelApp.Workbooks.Open("C:/Work/Automation/TowCall_D3.xlsx");
Excel._Worksheet worksheet = (Excel.Worksheet)excelApp.ActiveSheet;
worksheet.Cells[2,"AS"] = strcallID;
excelApp.ActiveWorkbook.Save();
excelApp.Quit();
In Test Case B when am trying to refer to that new value that has been written by Test Case A, Test Case B is not being able to read that newly written value as Ranorex memory (Data Connector) is still referring to the initial excel. Is there any way (any code) to auto reload the excel file in Ranorex during runtime as I am not being able to run my test cases E2E.
I have two test cases (say Test Case A and Test Case B) in my Test Suite each referring to the same Data Connector (i.e. same Excel Connector).
In Test Case A I have a code to open the Excel file during runtime, write some value (say '100') in a column named 'strcallID' in this case, save it and close it. Please follow the code below:
var excelApp = new Excel.Application();
excelApp.Visible = true;
excelApp.Workbooks.Open("C:/Work/Automation/TowCall_D3.xlsx");
Excel._Worksheet worksheet = (Excel.Worksheet)excelApp.ActiveSheet;
worksheet.Cells[2,"AS"] = strcallID;
excelApp.ActiveWorkbook.Save();
excelApp.Quit();
In Test Case B when am trying to refer to that new value that has been written by Test Case A, Test Case B is not being able to read that newly written value as Ranorex memory (Data Connector) is still referring to the initial excel. Is there any way (any code) to auto reload the excel file in Ranorex during runtime as I am not being able to run my test cases E2E.