Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public void Register(ChromeDriver _chrome)
 {
     AjustSendKeys.SendKeysById("name", pessoa.Name, _chrome);
     AjustSendKeys.SendKeysById("phone", pessoa.Phone, _chrome);
     AjustSendKeys.SendKeysById("cpf", pessoa.CPF, _chrome);
     AjustSendKeys.SendKeysById("email", pessoa.Email, _chrome);
     AjustClick.ClickById("form-send", _chrome);
 }
Esempio n. 3
0
 public void Login(ChromeDriver _chrome)
 {
     AjustSendKeys.SendKeysById("cpf", pessoa.CPF, _chrome);
     Thread.Sleep(1000);
     AjustSendKeys.SendKeysById("email", pessoa.Email, _chrome);
     AjustSendKeys.SendKeysById("phone", pessoa.Phone, _chrome);
     AjustClick.ClickById("send-login", _chrome);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public void Register(ChromeDriver _chrome)
 {
     AjustSendKeys.SendKeysById("nome", pessoa.Name, _chrome);
     AjustSendKeys.SendKeysById("email", pessoa.Email, _chrome);
     AjustSendKeys.SendKeysById("empresa", pessoa.Empresa, _chrome);
     AjustSendKeys.SendKeysById("CNPJ", pessoa.Phone, _chrome);
     AjustSendKeys.SendKeysById("telefone", pessoa.CNPJ, _chrome);
     AjustSendKeys.SendKeysById("cidade", pessoa.Cidade, _chrome);
     AjustSendKeys.SendKeysById("estado", pessoa.Estado, _chrome);
     Thread.Sleep(2000);
     AjustClick.ClickById("resposta", _chrome);
     AjustClick.ClickById("btn-salvar", _chrome);
 }
Esempio n. 7
0
 public void AuxFluxo(ChromeDriver chromeDriver)
 {
     try
     {
         pessoa.CPF = service.GetCPF(log);
         chromeDriver.Navigate().GoToUrl(new Constants().Sly_url);
         Thread.Sleep(1000);
         AjustSendKeys.SendKeysById("cpf", pessoa.CPF, chromeDriver);
         AjustClick.ClickById("form-send", chromeDriver);
         Validate(chromeDriver, pessoa);
     }
     catch (Exception e)
     {
     }
 }
Esempio n. 8
0
 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);
     }
 }
Esempio n. 9
0
 public void Email(ChromeDriver _chrome)
 {
     try
     {
         AjustClick.ClickById("btnEmail", _chrome);
         AjustClick.ClickById("btnOutroEmail", _chrome);
         AjustSendKeys.SendKeysById("fatura-formr", pessoa.Email, _chrome);
         AjustClick.ClickById("btnFatura1", _chrome);
         Thread.Sleep(1000);
         _chrome.FindElementByCssSelector("body > div.container > div > div > div.col.l8.offset-l2.s12.m10.offset-m1 > button").Click();
         PagBase.GaveGood(_chrome, pessoa, log);
     }
     catch (Exception)
     {
         PagBase.Error(_chrome, pessoa, log);
     }
 }
Esempio n. 10
0
 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);
     }
 }
Esempio n. 11
0
        public void AlunoOnlineTestMethod()
        {
            chromedriver.Navigate().GoToUrl(urlAlunoOnline);
            AjustSendKeys.SendKeysById("txtnumero_matricula", login, chromedriver);
            AjustSendKeys.SendKeysById("txtsenha_tac", senha, chromedriver);
            AjustClick.ClickById("cmdEnviar", chromedriver);
            var wait = new WebDriverWait(chromedriver, TimeSpan.FromSeconds(120));

            try
            {
                wait.Until(ExpectedConditions.UrlContains(urlEntrada));
                WriteLog.SalvaLog("S");
            }
            catch (Exception)
            {
                WriteLog.SalvaLog("N");
                throw;
            }
        }
Esempio n. 12
0
        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();
                }
            }
        }
Esempio n. 13
0
        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;
            }
        }
Esempio n. 14
0
 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;
     }
 }
Esempio n. 15
0
        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);
        }