public void FillForm() { try { ContactPage contactPage = new ContactPage(driver); PageFactory.InitElements(driver, contactPage); string[] allLines = fileReaderObj.ReadFile(); //Reading First Line string[] data = allLines[0].Split(","); string email = data[0], ordRef = data[1], filePath = data[2]; contactPage.FillForm(email, ordRef, filePath, "User : "******" , Order Ref : " + ordRef); string msgText = contactPage.GetMsgText(); Assert.IsTrue(msgText.Contains("Your message has been successfully sent to our team.")); } catch (Exception e) { //Taking Screenshot takeScreenShot.takeSnapShot(); Console.WriteLine("Exception in Test"); LogHelper.Write(e.Message); Assert.IsFalse(true); } }