public void VerifyTrackerHistory(List <string[]> trackerhistory) { DateTime today = DateTime.Today; string currentdt = today.ToString("dddd, dd MMM, yyyy"); string currentdt1 = String.Format("{0:MM/dd/yy}", today); for (int i = 0; i < trackerhistory.Count; i++) { if (i == 3) { trackerhistory.ElementAt(3)[5] = currentdt; } else if (i == 5) { trackerhistory.ElementAt(5)[5] = currentdt1; } } Thread.Sleep(3000); AppiumKeywords.Swipe(1000, 1562, 100, 1552); CommonTrackers ct = new CommonTrackers(softAssertions); ct.ValidateTrackerHistory(trackerhistory); }