public bool PreencherMatricula()
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputMatricula, 15);
                if (InputMatricula.Displayed)
                {
                    InputMatricula.Click();
                    Thread.Sleep(300);
                    InputMatricula.SendKeys(massa.percentual);
                    Thread.Sleep(300);
                    //InputPerc.Click();
                    //Thread.Sleep(300);
                    //InputPerc.SendKeys(massa.percentual);
                    //Thread.Sleep(300);
                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
        public bool InserirNomeECpf(string arg)
        {
            bool   _result = false;
            string cpf     = util.GerarCpf();

            try
            {
                util.WaitForElementVisible(InputNome, 45);
                if (InputNome.Displayed)
                {
                    InputNome.Click();
                    Thread.Sleep(300);
                    InputNome.SendKeys(arg);
                    Thread.Sleep(300);
                    InputCpf.Click();
                    Thread.Sleep(300);
                    InputCpf.SendKeys(cpf);
                    //InputCpf.SendKeys("01781619859");
                    Thread.Sleep(2000);

                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
        public void DocsEstudante()
        {
            IWebElement[] list = new IWebElement[] { BtnId01Frente, BtnId01Verso };

            try
            {
                for (int cont = 0; cont < 2; cont++)
                {
                    //string path = "";
                    Thread.Sleep(1500);
                    util.WaitForElementVisible(list[cont], 15);
                    if (list[cont].Displayed)
                    {
                        //path = @"C:\Users\leonardo.barcellos\Desktop\Imagens\teste.jpg";
                        util.ScrollElementoPage(list[cont]);
                        Thread.Sleep(700);
                        list[cont].Click();
                        Thread.Sleep(700);
                        IWebElement enviar = ClassDriver.GetInstance().Driver.FindElement(By.XPath("//div[@class='modal-dialog']//div[1]//div[1]//div[2]//div[1]//div[1]//div[1]//a[1]"));
                        util.ScrollElementoPage(enviar);
                        enviar.Click();
                        Thread.Sleep(700);
                        //SendKeys.SendWait(path);
                        //SendKeys.SendWait(@"{Enter}");
                        Thread.Sleep(700);
                        IWebElement Confirm = ClassDriver.GetInstance().Driver.FindElement(By.XPath("//div[@class='modal-dialog']//div/./div[3]//button[1]"));
                        Thread.Sleep(1000);
                        Confirm.Click();
                    }
                }
            }
            catch
            {
            }
        }
Exemple #4
0
        public bool AcessarTelaLogin()
        {
            bool _result = false;

            util.WaitForElementVisible(BtnEntrar, 30);
            try
            {
                if (BtnEntrar.Displayed)
                {
                    BtnEntrar.Click();
                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
        public bool ClicarSolicitacao()
        {
            bool _result = false;

            Thread.Sleep(5000);
            try
            {
                util.WaitForElementVisible(OptionSolicitacao, 60);
                if (OptionSolicitacao.Displayed)
                {
                    OptionSolicitacao.Click();
                    _result = true;
                }
            }
            catch (Exception)
            {
            }
            return(_result);
        }
        public bool PreencherDadosFiador()
        {
            bool _result = false;

            string rg = util.GerarRg();

            try
            {
                util.WaitForElementVisible(InputRg, 15);
                if (InputRg.Displayed)
                {
                    InputRg.Click();
                    Thread.Sleep(300);
                    InputRg.SendKeys(rg);
                    Thread.Sleep(300);
                    util.ClickJS(RadioNacio);
                    Thread.Sleep(300);
                    InputNomeMae.Click();
                    Thread.Sleep(300);
                    InputNomeMae.SendKeys(massa.nomeMae);
                    Thread.Sleep(300);
                    ListEstCivil.Click();
                    Thread.Sleep(300);
                    var selectElement = new SelectElement(ListEstCivil);
                    selectElement.SelectByIndex(1);
                    ListEstCivil.Click();
                    Thread.Sleep(300);
                    util.ClickJS(RadioUniao);
                    Thread.Sleep(300);
                    SelectProfissao.Click();
                    Thread.Sleep(300);
                    OptProfissao.Click();
                    Thread.Sleep(300);

                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #7
0
        public bool PreencherDadosPessoais()
        {
            bool _result = false;

            util.ScrollElementoPage(InputRg);
            Thread.Sleep(3000);
            string rg = util.GerarRg();

            try
            {
                util.WaitForElementVisible(InputRg, 30);
                if (InputRg.Displayed)
                {
                    Thread.Sleep(300);
                    InputRg.Click();
                    Thread.Sleep(300);
                    InputRg.SendKeys(rg);
                    Thread.Sleep(300);
                    InputDtaNasc.Click();
                    Thread.Sleep(300);
                    InputDtaNasc.SendKeys(massa.dtaNasc);
                    Thread.Sleep(300);
                    RadioMasc.Click();
                    Thread.Sleep(300);
                    RadioNacio.Click();
                    Thread.Sleep(300);
                    ListEstCivil.Click();
                    Thread.Sleep(300);
                    var selectElement = new SelectElement(ListEstCivil);
                    selectElement.SelectByIndex(1);
                    Thread.Sleep(300);
                    RadioUniao.Click();
                    Thread.Sleep(1000);

                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #8
0
        public bool ValidAccessPage()
        {
            bool _result = false;

            try
            {
                IWebElement LogoHome = ClassDriver.GetInstance().Driver.FindElement(By.XPath("//div//a[@class='logo']"));
                util.WaitForElementVisible(LogoHome, 25);
                if (LogoHome.Displayed)
                {
                    _result = true;
                }
                else
                {
                }
            }
            catch (Exception)
            {
            }
            return(_result);
        }
        public bool InserirIntegrantes(string arg)
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputIntegrantes, 45);
                if (InputIntegrantes.Displayed)
                {
                    util.ScrollElementoPage(InputIntegrantes);
                    InputIntegrantes.Click();
                    Thread.Sleep(300);
                    InputIntegrantes.SendKeys(arg);
                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
        public bool InformarEmail(string email)
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputEmail, 30);
                if (InputEmail.Displayed)
                {
                    InputEmail.Click();
                    Thread.Sleep(400);
                    InputEmail.SendKeys(email);

                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #11
0
        public bool AcessarAprovacao()
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(OptAprovacao, 45);
                if (OptAprovacao.Displayed)
                {
                    OptAprovacao.Click();
                    _result = true;
                }
            }
            catch
            {
            }

            return(_result);
        }
Exemple #12
0
        public bool PreencherDadosDependente()
        {
            bool _result = false;

            MassaDeDados.Dependentes.NomeDep = "Leonardo Dependente";
            MassaDeDados.Dependentes.CpfDep  = util.GerarCpf();
            MassaDeDados.Dependentes.RgDep   = util.GerarRg();
            MassaDeDados.Dependentes.DtDep   = "27/10/2006";
            MassaDeDados.Dependentes.MatDep  = util.GerarNumRandom();

            //ConsultaDB.Cpf(MassaDeDados.Dependentes.CpfDep);

            util.WaitForElementVisible(InputNomeDep, 30);
            try
            {
                InputNomeDep.SendKeys(MassaDeDados.Dependentes.NomeDep);
                Thread.Sleep(300);

                InputCpfDep.SendKeys(MassaDeDados.Dependentes.CpfDep);
                Thread.Sleep(300);

                InputRgDep.SendKeys(MassaDeDados.Dependentes.RgDep);
                Thread.Sleep(300);

                InputDtDep.SendKeys(MassaDeDados.Dependentes.DtDep);
                Thread.Sleep(300);

                NumMatricula02.SendKeys(MassaDeDados.Dependentes.MatDep);
                Thread.Sleep(300);

                _result = true;
            }
            catch
            {
            }

            return(_result);
        }
        public bool SelecionarInstituicao(string arg)
        {
            bool _result = false;

            try
            {
                IWebElement Lista = ClassDriver.GetInstance().Driver.FindElement(By.XPath("//div[@id='listaIES_chosen']//a"));
                util.WaitForElementVisible(Lista, 5);

                if (Lista.Displayed)
                {
                    Lista.Click();
                    Thread.Sleep(1000);
                    _result = SelectInstituicao(arg);
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
        public bool ClicarFunil(int arg)
        {
            bool _result = false;

            Thread.Sleep(2500);

            IWebElement[] Element =
            {
                OptSolicitacoesIniciadas,
                OptReprovadosFundacred,
                OptPendenteAnalisefundacred,
                OptPendenteAnaliseIes,
                OptReprovadosIEs,
                OptAprovados,
                OptFilaDeEspera
            };

            switch (arg)
            {
            case 0:
                DadosDB.Funil_SolicitacoesIniciadas = Element[arg].Text;
                break;

            case 1:
                DadosDB.Funil_ReprovadosFundacred = Element[arg].Text;
                break;

            case 2:
                DadosDB.Funil_PendenteAnaliseFundacred = Element[arg].Text;
                break;

            case 3:
                DadosDB.Funil_PendenteAnaliseIes = Element[arg].Text;
                break;

            case 4:
                DadosDB.Funil_ReprovadosIes = Element[arg].Text;
                break;

            case 5:
                DadosDB.Funil_Aprovados = Element[arg].Text;
                break;

            case 6:
                DadosDB.Funil_FilaDeEspera = Element[arg].Text;
                break;
            }
            ;

            util.WaitForElementVisible(Element[arg], 30);

            try
            {
                if (Element[arg].Displayed)
                {
                    Element[arg].Click();
                    Thread.Sleep(500);
                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #15
0
        public void PreencherOsDados(ref string Error, ref bool result)
        {
            Error = "Erro antes dos inputs";

            string mail = util.GerarNumRandom();

            mail = "teste_" + mail + massa.email;
            string cpf = util.GerarCpf();

            ConsultaDB.Cpf(cpf);

            cpf = util.MascaraCpf(cpf);
            var teste = cpf.ToCharArray();

            try
            {
                //MassaDeDados.BKey = "SOLICITACAO " + cpf;
                // UpdateStatusDB.Cpf(cpf);
                //string dt = utils.ClassUtilities.PegarDataHora();
                //string arquivo = @"C:\Users\leonardo.barcellos\Desktop\Fundacred\reg\" + dt + ".txt";
                //StreamWriter Doc = new StreamWriter(arquivo);
                //string line = String.Empty;
                //Doc.WriteLine(DateTime.Now);
                //Doc.WriteLine("CPF: " + cpf);
                //Doc.WriteLine("\r\n\r\n");
                //Doc.Close();

                util.WaitForElementVisible(BtnIniciar, 60);

                if (BtnIniciar.Displayed)
                {
                    BtnIniciar.Click();
                    Thread.Sleep(1000);

                    campoNome.Click();
                    Thread.Sleep(500);
                    campoNome.SendKeys(massa.nome + " " + massa.sobrenome);
                    Thread.Sleep(500);

                    InputCpf.Click();
                    Thread.Sleep(1000);
                    InputCpf.SendKeys(cpf);
                    Thread.Sleep(1000);

                    campoTelefone.Click();
                    Thread.Sleep(500);
                    campoTelefone.SendKeys(massa.telefone);
                    Thread.Sleep(500);

                    campoEmail.Click();
                    Thread.Sleep(500);
                    campoEmail.SendKeys(mail);
                    Thread.Sleep(500);

                    campoEmailConf.Click();
                    Thread.Sleep(500);
                    campoEmailConf.SendKeys(mail);
                    Thread.Sleep(500);

                    campoSenha.Click();
                    Thread.Sleep(500);
                    campoSenha.SendKeys(massa.senha);
                    Thread.Sleep(500);

                    senhaConf.Click();
                    Thread.Sleep(500);
                    senhaConf.SendKeys(massa.senha);
                    Thread.Sleep(500);

                    string Classe = ClassDriver.GetInstance().Driver.FindElement(By.Id("txtCpf")).GetAttribute("class");

                    if (Classe == "input-padrao valid")
                    {
                        Error = Classe;
                    }
                    else
                    {
                        Error  = "Nao pegou CPF - " + Classe;
                        result = false;
                    }

                    string Classe1 = ClassDriver.GetInstance().Driver.FindElement(By.Id("txtEmail")).GetAttribute("class");

                    if (Classe1 == "input-padrao valid")
                    {
                        Error = Classe1;
                    }
                    else
                    {
                        Error  = "Nao pegou email - " + Classe1;
                        result = false;
                    }

                    string Classe2 = ClassDriver.GetInstance().Driver.FindElement(By.Id("txtEmailConfirmar")).GetAttribute("class");

                    if (Classe2 == "input-padrao valid")
                    {
                        Error = Classe2;
                    }
                    else
                    {
                        Error  = "Nao pegou email confirmar - " + Classe2;
                        result = false;
                    }

                    string Classe3 = ClassDriver.GetInstance().Driver.FindElement(By.Id("txtSenha")).GetAttribute("class");

                    if (Classe3 == "input-padrao eyePass valid")
                    {
                        Error = Classe3;
                    }
                    else
                    {
                        Error  = "Não pegou senha - " + Classe3;
                        result = false;
                    }
                }
                else
                {
                    Error  = "Primeiro IF";
                    result = false;
                }
            }
            catch
            {
            }
        }
Exemple #16
0
        public bool InformarRendaInferior()
        {
            bool _result = false;

            var msg   = ClassDriver.GetInstance().Driver.FindElement(By.XPath("//form[@name='formCadastroFiador']//div[@class='row'][3]//div[2]//div[1]//div[1] //div[1]//div[1]//div[2]")).Text;
            var text  = msg.Split(' ');
            var valor = text[8].Replace("R$", "");

            valor = valor.Replace(".", "");
            valor = valor.Replace(",", "");

            var vlr = float.Parse(valor) - 1;

            valor = vlr.ToString();

            try
            {
                util.WaitForElementVisible(InputRenda, 30);
                if (InputRenda.Displayed)
                {
                    InputRenda.Click();
                    InputRenda.Clear();
                    InputRenda.SendKeys(valor);
                    _result = true;
                    Thread.Sleep(500);
                }
            }
            catch
            {
            }
            return(_result);
        }