The problem is that when I open the newly exported system log .csv each time I want my code to start reading from the last row checked when the system log was previously exported i.e. not right from the start (first row) of the exported system log .csv.
What I have tried:-
I have created a global module variable (see global module variable highlighted in yellow below):-
I then pass this global module variable to the User_Code – ‘Check_System_Log_For_Errors‘ method as a parameter. Below is the code for this method:-
Code: Select all
public void Check_System_log_For_Errors(string columnEventTypeLetter, string columnErrorMessageLetter, string startRow)
{
string systemLogName = this.FileName;
int newStartRow;
int startRowConverted = Int32.Parse(startRow);
newStartRow = common_code.Check_System_log_For_Errors(columnEventTypeLetter, columnErrorMessageLetter, startRowConverted, systemLogName);
_startRow = newStartRow.ToString();
}
The problem is that as soon as I add this global parameter to each of my test cases when the test cases run my code will not start at the correct row, infact when the system log .csv file is opened, my code does not select a row at all and it never iterates through any rows. If I remove this global parameter, though my code functions ok i.e. it iterates through each row, but when the second test case is run it starts again from row 1 (and not starting at the last row of the previous run test).
Hope somebody can help please