public void Sms(ChromeDriver _chrome, Pessoa pessoa, log_navegacao log) { try { if (log.idportal == Convert.ToInt32(Portal.SkyAdesao)) { AjustSendKeys.SendKeysById("name", pessoa.Name, _chrome); AjustSendKeys.SendKeysById("phone", pessoa.Phone, _chrome); AjustClick.ClickById("next-step", _chrome); pagebase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); _chrome.Navigate().Back(); } else { AjustClick.ClickById("contact-sms", _chrome); AjustSendKeys.SendKeysById("sms_name", pessoa.Name.ToString(), _chrome); AjustSendKeys.SendKeysById("sms_phone", pessoa.Phone.ToString(), _chrome); AjustClick.ClickById("contact-sms-send", _chrome); AjustClick.ClickByXPath("//*[@id=\"confirmation\"]/div/div/div/input", _chrome); pagebase.GaveGood(_chrome, pessoa, log); } } catch (Exception) { pagebase.Error(_chrome, pessoa, log); } }
public void FullFlow(ChromeDriver chromeDriver) { try { log.idportal = Convert.ToInt32(Portal.sky); log.data_ini = PaginaBase.InserTimeIn(); log.pagina = new Constants().Sly_url; if (!PaginaBase.ValidateNotFound(chromeDriver, log)) { return; } AuxFluxo(chromeDriver); Thread.Sleep(1000); WithDiscount(chromeDriver); EfetuarPagamento(chromeDriver); PaymentMade(chromeDriver); PrevisãoPagamento(chromeDriver); Atendimento(chromeDriver); AjustClick.ClickByXPath("//*[@id=\"index-banner\"]/div[1]/div/div[1]/a/i", chromeDriver); PaginaBase.GaveGood(chromeDriver, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"slide-out\"]/li[6]/a", chromeDriver); } catch (Exception e) { if (e.Message.Equals("Close")) { } else { PaginaBase.Error(chromeDriver, pessoa, log); } throw; } }
public void Atendimento(ChromeDriver _chrome) { try { AjustClick.ClickByXPath("//*[@id=\"fade-1\"]/div[2]/div/a[4]", _chrome); AjustClick.ClickById("contact_chat", _chrome); if (_chrome.Url.Contains("omne/virtual/")) { PaginaBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } log.cpf = pessoa.CPF; for (int i = 0; i < 20; i++) { _chrome.Navigate().Back(); if (_chrome.Url.Contains("enter/options")) { break; } } } catch (Exception e) { PaginaBase.Error(_chrome, pessoa, log); throw; } }
public void Phone(ChromeDriver _chrome, log_navegacao log) { AjustSendKeys.SendKeysById("nome", Name, _chrome); AjustSendKeys.SendKeysById("phone", pessoa.Phone, _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"form-contato\"]/div[3]/button", _chrome); AjustClick.ClickByXPath("/html/body/main/section/div/div[2]/button", _chrome); }
public void FullFlow(ChromeDriver _chrome) { try { log.data_ini = pagebase.InserTimeIn(); log.idportal = Convert.ToInt32(Portal.Net); _chrome.Navigate().GoToUrl(new Constants().ComboNet_url); if (!pagebase.ValidateNotFound(_chrome, log)) { return; } if (_chrome.Url.Equals(new Constants().ComboNet_url)) { //Net HDTV Xpath(_chrome, Net.HDTV, Domain.Enums.Plans.FacilHD); Xpath(_chrome, Net.HDTV, Domain.Enums.Plans.MixHD); Xpath(_chrome, Net.HDTV, Domain.Enums.Plans.TopHD); //NET Virtua Xpath(_chrome, Net.VIRTUA, Domain.Enums.Plans.Virtua5); Xpath(_chrome, Net.VIRTUA, Domain.Enums.Plans.Virtua35); Xpath(_chrome, Net.VIRTUA, Domain.Enums.Plans.Virtua60); Xpath(_chrome, Net.VIRTUA, Domain.Enums.Plans.Virtua120); Xpath(_chrome, Net.VIRTUA, Domain.Enums.Plans.Virtua240); //Net Fone Xpath(_chrome, Net.FONE, Domain.Enums.Plans.Local); Xpath(_chrome, Net.FONE, Domain.Enums.Plans.Brasi21); Xpath(_chrome, Net.FONE, Domain.Enums.Plans.BrasilTotal21); Xpath(_chrome, Net.FONE, Domain.Enums.Plans.MundoTotal21); //Net Combo AjustClick.ClickByXPath("/html/body/main/nav/div/div/div/div/ul[1]/li[4]/a", _chrome); Combos(_chrome, log); //Now AjustClick.ClickByXPath("/html/body/main/nav/div/div/div/div/ul[1]/li[5]/a", _chrome); //Celular //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.GB6); //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.GB8); //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.GB10); //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.GB15); //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.GB30); //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.GB50); //Xpath(_chrome, Net.Celular, Domain.Enums.Plans.Controle); Controle(_chrome, _returnXpath); } pagebase.GaveGood(_chrome, pessoa, log); } catch (Exception e) { log.Exception = e.Message.ToString(); pagebase.Error(_chrome, pessoa, log); throw; } }
public void AuxScheduling(ChromeDriver _chrome) { _chrome.FindElementByCssSelector("body > div.container > div:nth-child(3) > div > div > button:nth-child(2)").Click(); AjustSendKeys.SendKeysById("phone-sms", pessoa.Phone, _chrome); Thread.Sleep(1000); AjustClick.ClickById("send-sms", _chrome); AjustClick.ClickByXPath("/html/body/div[3]/div/div/div[2]/button", _chrome); AjustClick.ClickByXPath("/html/body/div[2]/a/i", _chrome); PagBase.GaveGood(_chrome, pessoa, log); }
public void FullFlow(ChromeDriver _chrome) { try { log.data_ini = pagebase.InserTimeIn(); log.idportal = Convert.ToInt32(Portal.Humana); pessoa.CPF = service.GetCPF(log); pessoa.Phone = pagebase.InsertPhone(); if (_chrome.Url.Equals(new Constants().Humana_url)) { pessoa.Email = "*****@*****.**"; if (!pagebase.ValidateNotFound(_chrome, log)) { return; } Login(_chrome); Thread.Sleep(4000); if (pagebase.ExpectedUrl(_chrome, "pay-info/debt-info")) { NegotiateDebt(_chrome, log); reportpayment(_chrome, log); CustomerService(_chrome, log); } Thread.Sleep(1000); AjustClick.ClickByXPath("/html/body/header/div/div[1]/div[1]/a/i", _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"slide-out\"]/li[4]/a", _chrome); } else if (_chrome.Url.Equals(new Constants().Digital_url)) { log.idportal = Convert.ToInt32(Portal.RecoveryDigital); pessoa.Email = "*****@*****.**"; pagebase.ValidatePage(_chrome, tipo.XPath, "//*[@id=\"main-message\"]/h1", "Não foi possível encontrar a página deste", log, pessoa); Login(_chrome); Thread.Sleep(4000); if (pagebase.ExpectedUrl(_chrome, "pay-info/debt-info")) { NegotiateDebt(_chrome, log); reportpayment(_chrome, log); CustomerService(_chrome, log); } Thread.Sleep(1000); AjustClick.ClickByXPath("/html/body/header/div/div[1]/div[1]/a/i", _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"slide-out\"]/li[4]/a", _chrome); } } catch (Exception e) { pagebase.Error(_chrome, pessoa, log); throw; } }
public void ValidatePayment(ChromeDriver _chrome, log_navegacao log) { try { if (pagebase.ExpectedUrl(_chrome, "pay-info/methods")) { AjustClick.ClickById("btn_pagamento_a_vista", _chrome); if (pagebase.ExpectedUrl(_chrome, "payment-cash")) { PaymentCash(_chrome); } else { pagebase.Fail(); } AjustClick.ClickById("btn_pagamento_parcelado", _chrome); if (_chrome.Url.Contains("payment-parcel")) { if (log.idportal != 8) { AjustClick.ClickByXPath("/html/body/main/section/div/div[2]/table/tbody/tr[1]/td/div/input", _chrome); //WebDriverWait wait = new WebDriverWait(_chrome, TimeSpan.FromSeconds(30)); //wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.XPath(""))); //_chrome.FindElementByCssSelector("#numero-parcelas-send > option:nth-child(2)").Click(); //AjustClick.ClickByXPath("//*[@id=\"register-bank-slip\"]/p[1]/label", _chrome); //AjustClick.ClickByXPath("//*[@id=\"confirmar-parcelamento\"]", _chrome); //AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); } else { AjustClick.ClickByXPath("/html/body/main/section/div/div[2]/table/tbody/tr[1]/td/div/input", _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); } } else { pagebase.Fail(); } } else { pagebase.Fail(); } } catch (Exception e) { pagebase.Error(_chrome, pessoa, log); } }
public void reportpayment(ChromeDriver _chrome, log_navegacao log) { try { _chrome.FindElementByCssSelector("body > main > section > div > div:nth-child(4) > button:nth-child(2)").Click(); _reportpayment(_chrome, log); } catch (Exception) { AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[2]", _chrome); _reportpayment(_chrome, log); } }
public void _reportpayment(ChromeDriver _chrome, log_navegacao log) { Thread.Sleep(1000); if (_chrome.Url.Contains("pay-info/schedule")) { AjustClick.ClickByXPath("//*[@id=\"form-alega-pagamento\"]/div[1]/div/div[1]/img[2]", _chrome); AjustClick.ClickByXPath("//*[@id=\"alega-pagamento-send\"]", _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickById("btn-fechar", _chrome); AjustClick.ClickByXPath("//*[@id=\"form-alega-pagamento\"]/div[2]/button[2]", _chrome); } else { pagebase.Fail(); } }
public void Scheduling(ChromeDriver _chrome) { try { try { PagBase.ExpectedElement(_chrome, "invoice-receive", tipo.Id); { AjustClick.ClickById("invoice-receive", _chrome); IList <IWebElement> div = _chrome.FindElementsByCssSelector("body > div.container > div:nth-child(3) > div > div > button"); foreach (var item in div) { if (item.Text.Equals("SMS")) { item.Click(); } } Thread.Sleep(1000); AjustSendKeys.SendKeysById("phone-sms", pessoa.Phone, _chrome); AjustClick.ClickById("send-sms", _chrome); AjustClick.ClickByXPath("/html/body/div[3]/div/div/div[2]/button", _chrome); AjustClick.ClickByXPath("/html/body/div[2]/a/i", _chrome); PagBase.GaveGood(_chrome, pessoa, log); } } catch (Exception) { AjustClick.ClickById("btnSendValue1", _chrome); AjustClick.ClickByXPath("/html/body/div[3]/div[2]/div/div/div[2]/div[2]/div[2]/div[1]/span[1]/img", _chrome); AjustClick.ClickById("send-date", _chrome); try { PagBase.ExpectedElement(_chrome, "modal-dia-util", tipo.Id); AjustClick.ClickByXPath("//*[@id=\"modal-dia-util\"]/div/div/div/div/div/button", _chrome); AuxScheduling(_chrome); } catch (Exception) { AuxScheduling(_chrome); } } } catch (Exception e) { PagBase.Error(_chrome, pessoa, log); } }
public void NegotiateDebt(ChromeDriver _chrome, log_navegacao log) { try { _chrome.FindElementByCssSelector("body > main > section > div > div:nth-child(4) > button:nth-child(1)").Click(); ValidatePayment(_chrome, log); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"btn_voltar\"]", _chrome); } catch (Exception e) { _chrome.FindElementByCssSelector("body > main > section > div > div:nth-child(3) > button:nth-child(1)").Click(); ValidatePayment(_chrome, log); pagebase.GaveGood(_chrome, pessoa, log);; AjustClick.ClickByXPath("//*[@id=\"btn_voltar\"]", _chrome); } }
public void Payment(ChromeDriver _chrome) { try { AjustClick.ClickById("btnAlegaPagamento", _chrome); _chrome.FindElementByCssSelector("body > div.container > div:nth-child(2) > div > div > div.date-desktop > div:nth-child(2) > div.col.s11.m9.l6.center-align > div:nth-child(1) > span.down.down-day > img").Click(); AjustClick.ClickById("send-date", _chrome); PagBase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("/html/body/div[3]/div/div/div[2]/button", _chrome); Thread.Sleep(1000); AjustClick.ClickByXPath("/html/body/div[2]/a/i", _chrome); } catch (Exception e) { PagBase.Error(_chrome, pessoa, log); } }
public void Atendimento(ChromeDriver _chrome) { try { if (PagBase.ExpectedUrl(_chrome, "atendimento")) { AjustClick.ClickById("btnChat", _chrome); if (PagBase.ExpectedUrl(_chrome, "srvcloo2.callflex.com.br")) { PagBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } else { PagBase.Fail(); } AjustClick.ClickById("btnWhatsApp", _chrome); if (PagBase.ExpectedUrl(_chrome, "api.whatsapp.com")) { PagBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } else { PagBase.Fail(); } AjustClick.ClickById("btnEmail1", _chrome); AjustSendKeys.SendKeysById("email-formr", pessoa.Email, _chrome); AjustClick.ClickById("btnAtendimentoEmail", _chrome); AjustClick.ClickByXPath("/html/body/div[3]/div/div/div[2]/button", _chrome); AjustClick.ClickById("btnAtendimento", _chrome); AjustClick.ClickById("btnLigacao", _chrome); AjustSendKeys.SendKeysById("phone-formr", pessoa.Phone, _chrome); AjustClick.ClickById("btnTelefone", _chrome); AjustClick.ClickByXPath("/html/body/div[3]/div/div/div[2]/button", _chrome); PagBase.GaveGood(_chrome, pessoa, log); } } catch (Exception) { PagBase.Error(_chrome, pessoa, log); } }
public void lotterypayment(ChromeDriver _chrome, string xpath) { Thread.Sleep(1000); _chrome.FindElementByCssSelector(xpath).Click(); try { PaginaBase.ExpectedElement(_chrome, "//*[@id=\"modal-10611\"]/div/h4", tipo.XPath); AjustClick.ClickByXPath("//*[@id=\"modal-10611\"]/div/a/i", _chrome); //add ex informando que esta n pagina receber boleto PaginaBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } catch (Exception) { Thread.Sleep(1000); _chrome.FindElementByCssSelector("#fade-1 > div:nth-child(2) > div > a:nth-child(1)").Click(); AjustClick.ClickByXPath("//*[@id=\"informar-dados\"]/div[2]/div[1]/div[1]/label[1]", _chrome); if (PaginaBase.ExpectedElement(_chrome, "email", tipo.Id)) { _chrome.FindElementByCssSelector("#informar-dados > div.modal-content > div:nth-child(2) > div.col.l12.m12.s12.left-align > label:nth-child(2)").Click(); AjustSendKeys.SendKeysById("email", "*****@*****.**", _chrome); AjustSendKeys.SendKeysById("telefone", "41999999999", _chrome); PaginaBase.GaveGood(_chrome, pessoa, log); _chrome.FindElementByCssSelector("#informar-dados > div.modal-content > div:nth-child(3) > div > button").Click(); if (PaginaBase.ExpectedUrl(_chrome, "return-payment")) { } else { PaginaBase.Fail(); } } else { PaginaBase.Fail(); } for (int i = 0; i < 2; i++) { _chrome.Navigate().Back(); } } }
public void OpenSubtitleTeste() { chromedriver.Navigate().GoToUrl(urlLogin); AjustClick.ClickByClassName("bt-dwl", chromedriver); AjustClick.ClickByClassName("disable_ad", chromedriver); AjustSendKeys.SendKeysByName("user", LoginOs, chromedriver); AjustSendKeys.SendKeysById("password", SenhaOs, chromedriver); AjustClick.ClickByXPath("//*[@id=\"loginform\"]/table/tbody/tr[4]/td/input", chromedriver); var wait = new WebDriverWait(chromedriver, TimeSpan.FromSeconds(60)); try { //wait.Until(ExpectedConditions.ElementIsVisible(d => d.FindElement(By.XPath("//div[@id='timeLeft']")("//*[@id=\"logindetail\"]/a[2]")); WriteLog.SalvaLog("S"); } catch (Exception) { WriteLog.SalvaLog("N"); throw; } }
public void FullFlow(ChromeDriver _chrome) { try { log.data_ini = pagbase.InserTimeIn(); log.idportal = Convert.ToInt32(Portal.Claro); pagbase.InsertPhone(); _chrome.Navigate().GoToUrl(new Constants().Claro_url); if (!pagbase.ValidateNotFound(_chrome, log)) { return; } AjustClick.ClickByXPath("/html/body/div[4]/div[3]/button", _chrome); Thread.Sleep(1000); pagbase.GaveGood(_chrome, pessoa, log); } catch (Exception e) { pagbase.Error(_chrome, pessoa, log); throw; } }
public void Plans(ChromeDriver _chrome, List <string> List) { AjustClick.ClickByXPath(List[1], _chrome); Thread.Sleep(200); //Chat SaveEx(_chrome, log); OpenChat(_chrome, List); for (int i = 0; i < 30; i++) { Thread.Sleep(2000); if (_chrome.Url.Contains("srvcloo2.callflex")) { _social.Chat(_chrome, log); break; } else { OpenChat(_chrome, List); } } //Combos AjustClick.ClickByXPath(List[3], _chrome); }
public void PaymentCash(ChromeDriver _chrome) { if (_chrome.Url.Contains("regularizarecovery.com.br")) { try { AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[1]", _chrome); Thread.Sleep(1000); _chrome.FindElementByCssSelector("#modal-mensagem > div.modal-footer > button").Click(); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); } catch (Exception e) { _chrome.FindElementByCssSelector("body>div.modal-overlay").Click(); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); } } else { try { AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/a", _chrome); Thread.Sleep(1000); AjustClick.ClickByXPath("//*[@id=\"register-bank-slip\"]/p[1]/label", _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"enviar-data-pagamento\"]", _chrome); _chrome.Navigate().Back(); AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[2]", _chrome); } catch (Exception e) { } } }
public void CustomerService(ChromeDriver _chrome, log_navegacao log) { try { if (log.idportal == 8) { AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); _Service(_chrome, log); } else { AjustClick.ClickByXPath("/html/body/main/section/div/div[3]/button[3]", _chrome); _Service(_chrome, log); } } catch (Exception) { if (log.idportal == 8) { AjustClick.ClickByXPath("/html/body/main/section/div/div[4]/button[3]", _chrome); _Service(_chrome, log); } } }
public void _Service(ChromeDriver _chrome, log_navegacao log) { if (pagebase.ExpectedUrl(_chrome, "contact")) { AjustClick.ClickById("btn_contato_chat", _chrome); if (pagebase.ExpectedUrl(_chrome, "virtual/chat/")) { pagebase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } else { pagebase.Fail(); } AjustClick.ClickById("btn_contato_whatsapp", _chrome); Thread.Sleep(1000); socialNetworks.WhatsApp(_chrome, log); if (log.idportal == 8) { IList <IWebElement> button = _chrome.FindElementsByCssSelector("body > main > section > div > div:nth-child(2) > div"); foreach (var item in button) { if (item.Text.Equals("SMS")) { item.Click(); Thread.Sleep(2000); if (_chrome.Url.Contains("sms")) { Phone(_chrome, log); break; } } } IList <IWebElement> button2 = _chrome.FindElementsByCssSelector("body > main > section > div > div:nth-child(2) > div"); foreach (var item in button2) { if (item.Text.Equals("Telegram")) { item.Click(); Thread.Sleep(2000); Telegram(_chrome, log); break; } } } IList <IWebElement> button3 = _chrome.FindElementsByCssSelector("body > main > section > div > div:nth-child(2) > div"); foreach (var item in button3) { if (item.Text.Equals("Facebook")) { item.Click(); Thread.Sleep(2000); if (_chrome.Url.Contains("facebook")) { pagebase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); break; } } } AjustClick.ClickById("btn_contato_ligacao", _chrome); Thread.Sleep(1000); Phone(_chrome, log); AjustClick.ClickById("btn_contato_email", _chrome); if (_chrome.Url.Contains("email")) { AjustSendKeys.SendKeysById("nome", Name, _chrome); AjustSendKeys.SendKeysById("email", pessoa.Email, _chrome); pagebase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("//*[@id=\"form-contato\"]/div[3]/button", _chrome); AjustClick.ClickByXPath("/html/body/main/section/div/div[2]/button", _chrome); } else { pagebase.Fail(); } } else { pagebase.Fail(); } AjustClick.ClickByXPath("/html/body/main/section/div/div[4]/button[1]", _chrome); Thread.Sleep(3000); }
public void MenuPlans(ChromeDriver _chrome, List <string> List) { AjustClick.ClickByXPath(List[0], _chrome); Plans(_chrome, List); _chrome.Navigate().Back(); }
public void Ajust(ChromeDriver _chrome, string element) { AjustClick.ClickByXPath(element, _chrome); }
public void FullFlow(ChromeDriver _chrome) { try { log.idportal = Convert.ToInt32(Portal.atacadao); pessoa.Email = "*****@*****.**"; pessoa.Phone = PagBase.InsertPhone(); log.data_ini = PagBase.InserTimeIn(); pessoa.CPF = service.GetCPF(log); pessoa.DT_Nasc = service.Getdate(pessoa, Portal.atacadao); _chrome.Navigate().GoToUrl(url); if (!PagBase.ValidateNotFound(_chrome, log)) { return; } if (_chrome.Url.Equals(url)) { Thread.Sleep(1000); foreach (var item in pessoa.DT_Nasc) { AjustSendKeys.SendKeysById("dt-nasc", item.ToString(), _chrome); } foreach (var item in pessoa.CPF) { AjustSendKeys.SendKeysById("numb-cpf", item.ToString(), _chrome); } foreach (var item in pessoa.Phone) { AjustSendKeys.SendKeysById("numb-tel", item.ToString(), _chrome); } Thread.Sleep(1000); AjustClick.ClickById("form-send", _chrome); //Solicitar Fatura Thread.Sleep(3000); if (_chrome.Url.Contains("/enter/menu")) { try { PagBase.ExpectedElement(_chrome, "/html/body/div[2]/div[4]/p", tipo.XPath); service.DeleteCPf(pessoa, Portal.atacadao); _chrome.Url = Regex.Replace(_chrome.Url, "com.br/", "com.br/CPF_Encontrado_Invalido."); PagBase.Error(_chrome, pessoa, log); FullFlow(_chrome); } catch (Exception) { if ((PagBase.ExpectedUrl(_chrome, "/enter/menu"))) { Email(_chrome); } else { PagBase.Fail(); } Thread.Sleep(1000); AjustClick.ClickById("btnNegociacao", _chrome); Scheduling(_chrome); Payment(_chrome); SemPrevisao(_chrome); _chrome.Navigate().GoToUrl(url + "/enter/menu"); AjustClick.ClickById("btnAtendimento", _chrome); Atendimento(_chrome); AjustClick.ClickByXPath("/html/body/header/div/div/div[1]/a/i", _chrome); Thread.Sleep(1000); _chrome.FindElementByCssSelector("#slide-out > li:nth-child(4) > a").Click(); PagBase.GaveGood(_chrome, pessoa, log); } } else { Validate(_chrome, pessoa); } } } catch (Exception e) { PagBase.Error(_chrome, pessoa, log); throw; } }
public void SemPrevisao(ChromeDriver _chrome) { try { AjustClick.ClickById("btnSemPrevisao", _chrome); if (PagBase.ExpectedUrl(_chrome, "pay-info/no-date")) { AjustClick.ClickById("financialProblems", _chrome); if (PagBase.ExpectedUrl(_chrome, "atendimento")) { PagBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } } else { PagBase.Fail(); } if (PagBase.ExpectedUrl(_chrome, "pay-info/no-date")) { AjustClick.ClickById("valueDisagree", _chrome); if (PagBase.ExpectedUrl(_chrome, "atendimento")) { PagBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } } else { PagBase.Fail(); } if (PagBase.ExpectedUrl(_chrome, "pay-info/no-date")) { AjustClick.ClickById("anawareInvoice", _chrome); if (PagBase.ExpectedUrl(_chrome, "atendimento")) { PagBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } } else { PagBase.Fail(); } if (PagBase.ExpectedUrl(_chrome, "pay-info/no-date")) { AjustClick.ClickByXPath("/html/body/div[3]/div[3]/div/div/button[4]", _chrome); PagBase.GaveGood(_chrome, pessoa, log); AjustClick.ClickByXPath("/html/body/div[2]/a/i", _chrome); } else { PagBase.Fail(); } if (PagBase.ExpectedUrl(_chrome, "pay-info/no-date")) { AjustClick.ClickById("otherMotive", _chrome); if (PagBase.ExpectedUrl(_chrome, "atendimento")) { PagBase.GaveGood(_chrome, pessoa, log); _chrome.Navigate().Back(); } } else { PagBase.Fail(); } } catch (Exception) { PagBase.Error(_chrome, pessoa, log); } }