public bool InserirNomeECpf(string arg)
        {
            bool   _result = false;
            string cpf     = util.GerarCpf();

            try
            {
                util.WaitForElementVisible(InputNome, 15);
                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);
        }
Exemple #2
0
        public bool PreencherCampos(string[] values)
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputCpf, 15);
                if (InputCpf.Displayed)
                {
                    InputCpf.Click();
                    Thread.Sleep(300);
                    InputCpf.SendKeys(values[0]);
                    Thread.Sleep(300);
                    InputSenha.Click();
                    Thread.Sleep(300);
                    InputSenha.SendKeys(values[1]);
                    Thread.Sleep(300);

                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #3
0
        public bool PesquisarSolicitacao()
        {
            bool   _result = false;
            string Cpf     = UpdateStatusDB.PegarCpf();

            //Cpf = "755.828.204-77";

            try
            {
                ExpectedConditions.ElementToBeClickable(InputCpf);
                Thread.Sleep(4000);
                if (InputCpf.Displayed)
                {
                    InputCpf.Click();
                    Thread.Sleep(300);
                    InputCpf.SendKeys(Cpf);
                    Thread.Sleep(3000);
                    _result = true;
                }
            }
            catch
            {
            }

            return(_result);
        }
Exemple #4
0
        public bool PreencherUsuario(string user)
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputCpf, 45);
                if (InputCpf.Displayed)
                {
                    InputCpf.Click();
                    Thread.Sleep(300);
                    InputCpf.SendKeys(user);
                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
        public bool PreencherDados()
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputNome, 45);
                if (InputNome.Displayed)
                {
                    InputNome.Click();
                    Thread.Sleep(250);
                    InputNome.SendKeys(Massa.nome + " " + Massa.sobrenome);

                    InputCpf.Click();
                    Thread.Sleep(250);
                    //InputCpf.SendKeys(UpdateStatusDB.PegarCpf());

                    InputRg.Click();
                    Thread.Sleep(250);
                    InputRg.SendKeys(util.GerarRg());

                    InputDtaNasc.Click();
                    Thread.Sleep(250);
                    InputDtaNasc.SendKeys(Massa.dtaNasc);

                    InputNMatric.Click();
                    Thread.Sleep(250);
                    InputNMatric.SendKeys(Massa.matricula);

                    Thread.Sleep(500);

                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #6
0
        public bool AddCpf(string cpf)
        {
            bool _result = false;

            try
            {
                ClassDriver.GetInstance().Driver.Navigate().Refresh();

                util.WaitForElementVisible(InputCpf, 30);
                if (InputCpf.Displayed)
                {
                    InputRenda.Clear();
                    InputCpf.Click();
                    InputCpf.SendKeys(cpf);
                    _result = true;
                    Thread.Sleep(500);
                }
            }
            catch
            {
            }
            return(_result);
        }
Exemple #7
0
        public bool PesquisarSolicitacao(string cpf)
        {
            bool _result = false;

            ConsultaDB.Cpf(cpf);
            try
            {
                Thread.Sleep(4000);
                if (InputCpf.Displayed)
                {
                    InputCpf.Click();
                    Thread.Sleep(300);
                    InputCpf.SendKeys(cpf);
                    Thread.Sleep(3000);
                    _result = true;
                }
            }
            catch
            {
            }

            return(_result);
        }
Exemple #8
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
            {
            }
        }