Esempio n. 1
0
        public bool InserirValores()
        {
            bool _result = false;

            //string path = @"C:\Users\leonardo.barcellos\Desktop\Imagens\teste.jpg";
            util.WaitForElementVisible(InputValor_01, 30);
            try
            {
                if (InputValor_01.Displayed)
                {
                    util.ScrollElementoPage(InputValor_01);

                    InputValor_01.Click();
                    Thread.Sleep(300);
                    InputValor_01.SendKeys("5.000,00");

                    InputValor_02.Click();
                    Thread.Sleep(300);
                    InputValor_02.SendKeys("4.750,00");

                    InicioContrato.Click();
                    Thread.Sleep(300);
                    InicioContrato.SendKeys("01/2019");

                    FinalContrato.Click();
                    Thread.Sleep(300);
                    FinalContrato.SendKeys("12/2021");

                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
                util.ScrollElementoPage(SelectTipo);
                var selectElement = new SelectElement(SelectTipo);
                selectElement.SelectByIndex(1);
                Thread.Sleep(500);

                InputContrato.Click();
                Thread.Sleep(1000);
                //SendKeys.SendWait(path);
                Thread.Sleep(300);
                //SendKeys.SendWait(@"{Enter}");
                Thread.Sleep(500);
                _result = true;
            }
            return(_result);
        }
Esempio n. 2
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);
        }
        public bool ValidarDirecionamentoDocumentos()
        {
            bool _result = false;

            try
            {
                IWebElement Validar = ClassDriver.GetInstance().Driver.FindElement(By.XPath("//h2[text()='Documentos']"));
                util.WaitForElementVisible(Validar, 15);
                if (Validar.Displayed)
                {
                    util.ScrollElementoPage(Validar);
                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
        public bool SelecionarOpResponsavel()
        {
            bool _result = false;

            util.WaitForElementVisible(OpResponsavel, 30);
            util.ScrollElementoPage(OpResponsavel);
            try
            {
                if (OpResponsavel.Displayed)
                {
                    OpResponsavel.Click();
                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }

            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 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
            {
            }
        }
        public bool PreencherContatoEndereco()
        {
            bool _result = false;

            try
            {
                util.WaitForElementVisible(InputDdd, 15);
                if (InputDdd.Displayed)
                {
                    InputDdd.Click();
                    Thread.Sleep(300);
                    InputDdd.SendKeys(massa.ddd);
                    Thread.Sleep(300);
                    InputTel.Click();
                    Thread.Sleep(300);
                    InputTel.SendKeys(massa.numTel);
                    Thread.Sleep(300);
                    InputRamal.Click();
                    Thread.Sleep(300);
                    InputRamal.SendKeys(massa.ramal);
                    Thread.Sleep(300);
                    util.ClickJS(InputCep);
                    Thread.Sleep(300);
                    InputCep.SendKeys(massa.cep);
                    Thread.Sleep(2000);
                    util.ScrollElementoPage(BtnBuscarCep);
                    Thread.Sleep(2000);
                    //BtnBuscarCep.Click();
                    Thread.Sleep(500);
                    util.ScrollElementoPage(InputNumEnder);
                    InputNumEnder.Click();
                    Thread.Sleep(300);
                    InputNumEnder.SendKeys(massa.numero);
                    Thread.Sleep(300);
                    InputComplemento.Click();
                    Thread.Sleep(300);
                    InputComplemento.SendKeys(massa.complemento);

                    Campoendereco.Clear();
                    Campoendereco.Click();
                    Campoendereco.SendKeys("Av Júlio De Castilhos");
                    Thread.Sleep(300);

                    CampoBairro.Clear();
                    CampoBairro.Click();
                    CampoBairro.SendKeys("Centro Histórico");
                    Thread.Sleep(300);

                    CampoCidade.Clear();
                    CampoCidade.Click();
                    CampoCidade.SendKeys("Porto Alegre");
                    Thread.Sleep(300);

                    var selectElement = new SelectElement(SelectUf);
                    selectElement.SelectByIndex(21);

                    _result = true;
                }
            }
            catch
            {
            }
            return(_result);
        }