public void GerarCobrancaAtravesDeImportacaoDeArquivo_7697() { string holder = "A28248"; string filePath = "C:/TestesAutomatizados/TestResults/"; string fileName = "cobranca_por_arquivo" + DateTime.Now.ToString("_dd_MM_yyyy_HH_mm_ss") + ".csv"; string valueBilling = "123,45"; using (var w = new StreamWriter(filePath + fileName)) { w.WriteLine("Título;Sócio;Valor;Data de vencimento;Produto"); w.WriteLine("{0};;{1};{2};Produto Teste Cobranca por Arquivo", holder, valueBilling, DateTime.Now.ToString("dd/MM/yyyy")); w.Flush(); } MultiClubesFunctions McFunctions = new MultiClubesFunctions(); MultiClubesMenus McMenus = new MultiClubesMenus(); var dc = new DesiredCapabilities(); dc.SetCapability("app", @"\\tsidev\Triade\Application\Dev\MultiClubes\System\MultiClubes\MultiClubes.UI.application"); dc.SetCapability("debugConnectToRunningApp", true); RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:9999"), dc); McMenus.AcessarMenuOperacaoFinanceiroCobrancaImportacaoDeCobranca(); driver.FindElement(By.Id("textBoxFileName")).Click(); Keyboard.SendKeys(filePath + fileName); driver.FindElement(By.Id("buttonGenerate")).Click(); McFunctions.WaitForElementLoad(By.Name("OK"), 10); driver.FindElement(By.Name("OK")).Click(); McFunctions.CloseWindow("Importação de cobrança"); McMenus.AcessarMenuOperacaoTituloCentralDeAtendimento(); McFunctions.SearchHolder(holder); McFunctions.AcessarCobrancasAtivas(); McFunctions.WaitForElementLoad(By.Id("listViewDun")); var listViewDunElements = driver.FindElement(By.Id("listViewDun")).FindElements(By.Id("")); int counter = 0; bool importedBillingFound = false; foreach (IWebElement i in listViewDunElements) { if (i.GetAttribute("Name") == DateTime.Now.ToString("dd/MM/yyyy")) { if (listViewDunElements[counter + 3].GetAttribute("Name") == "R$ " + valueBilling) { importedBillingFound = true; break; } } counter++; } McFunctions.CloseWindow("Cobranças ativas"); McFunctions.FinalizarAtendimentoTitulo(); McFunctions.CloseWindow("Central de atendimento"); Assert.IsTrue(importedBillingFound, "Valor da cobrança encontrado nas cobranças ativas"); }