/* private Screenshot _screenshot = new Screenshot(); */ public void Create(IWebDriver driver) { var datarow = new Datarow(); _genaralLibrary = new GeneralLibrary(); var excelData = _genaralLibrary.GetExcelData(@"C:\\Input Data\CardDetails.xls", "AccountCreation"); datarow.Col(); var table = excelData.Tables[0]; try { var count = table.Rows.Count; for (var i = 0; i <= count; i++) { var expected = table.Rows[i]["AccountName"].ToString(); var text = table.Rows[i]["Provider"].ToString(); var str3 = table.Rows[i]["ReturnURI"].ToString(); if (driver.Title == "Log On : mopowered.co.uk") { driver.FindElement( By.CssSelector( "html body div#Top.page div#Content div.mainContent div#Main div#LogOnSection.section div.box form#LogOnForm.form div div#EmailControl.control div.input input#Email")) .SendKeys("*****@*****.**"); driver.FindElement( By.CssSelector( "html body div#Top.page div#Content div.mainContent div#Main div#LogOnSection.section div.box form#LogOnForm.form div div#PasswordControl.control div.input input#Password")) .SendKeys("Apple12345"); driver.FindElement(By.Id("LogOn_Action_LogOn")).Click(); } driver.FindElement(By.XPath("//div[@id='IndexMenu']/ul/li/ul/li/a")).Click(); driver.FindElement(By.LinkText("Create")).Click(); driver.FindElement(By.Id("Name")).Clear(); driver.FindElement(By.Id("Name")).SendKeys(expected); driver.FindElement(By.CssSelector("#IndexMenu > ul > li.selected > ul > li > a")).Click(); if (driver.PageSource.Contains("Test Client Account")) { driver.FindElement(By.LinkText("Test Client Account")).Click(); datarow.Newrow("Test Client Tab", "Test Client Tab", "Test Client Account", "PASS", driver ); } new SelectElement(driver.FindElement(By.Id("Provider_Id"))).SelectByText(text); driver.FindElement(By.CssSelector("input.button")).Click(); Thread.Sleep(0x1388); var attribute = driver.FindElement(By.Id("Name")).GetAttribute("Value"); var actual = driver.FindElement(By.Id("Provider_Id")).GetAttribute("Value"); datarow.Newrow("Account Name", expected, attribute, expected == attribute ? "PASS" : "FAIL", driver); datarow.Newrow("Provider", text, actual, text == actual ? "PASS" : "FAIL", driver); var str8 = driver.Title; datarow.Newrow("Details Tab", "Details : mopowered.co.uk", str8, str8 == "Details : mopowered.co.uk" ? "PASS" : "FAIL", driver); driver.FindElement(By.Id("PayProviderCheckOutReturnUri")).Clear(); driver.FindElement(By.Id("PayProviderCheckOutReturnUri")).SendKeys(str3); driver.FindElement(By.CssSelector("input.button")).Click(); Thread.Sleep(0x1388); driver.FindElement(By.LinkText("Payment Provider")).Click(); new Paymentprovider().Provider(driver, datarow); new Notificationtab().Notifications(driver, datarow); } } catch (Exception exception) { var str9 = exception.ToString(); datarow.Newrow("Exception", "Not Expected", str9, "FAIL", driver); datarow.Excelsave("MoPay Account Creation", driver, "*****@*****.**"); } finally { datarow.Excelsave("MoPay Account Creation", driver, "*****@*****.**"); } }