public void DownloadFileTest() { AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); GenericUtils genericUtils = new GenericUtils(TestProgressLogger); try { List <KeyValuePair <string, string> > superUsersData; string superUsersList = ""; string date; TestProgressLogger.StartTest(); //Login as admin -> Click on "Users" menu button genericUtils.DeleteAllFiles(); objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UsersTabBtn(); objAdminCommonFunctions.ClickOnExportButton(); Thread.Sleep(2000); objAdminCommonFunctions.ExportSuperUsers(); Thread.Sleep(3000); date = GenericUtils.GetCurrentTimeWithHyphen(); var path = Directory.GetCurrentDirectory() + "\\DataTest\\Superusers (" + date + ").csv"; superUsersData = genericUtils.ReadDataFromCSV(@path); for (int i = 0; i < superUsersData.Count; i++) { if (superUsersData[i].Key == "UserId") { if (superUsersData[i].Value == "123") { for (int j = i; j < i + 12; j++) { superUsersList = superUsersList + " || " + superUsersData[j].Key + ":" + superUsersData[j].Value; } TestProgressLogger.LogCheckPoint(superUsersList); break; } } } TestProgressLogger.LogCheckPoint("Passed"); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserPassed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), e); throw e; } finally { TestProgressLogger.EndTest(); } }