コード例 #1
0
        public bool PreencherEndereco()
        {
            bool _result = false;

            Thread.Sleep(2000);
            try
            {
                if (InputCep.Displayed)
                {
                    InputCep.Click();
                    Thread.Sleep(300);
                    InputCep.SendKeys(massa.cep);
                    Thread.Sleep(300);
                    BtnBuscarEnder.Click();
                    Thread.Sleep(3000);

                    InputNumero.Click();
                    Thread.Sleep(300);
                    InputNumero.SendKeys(massa.numero);
                    Thread.Sleep(300);

                    InputComplemento.Click();
                    Thread.Sleep(300);
                    InputComplemento.SendKeys(massa.complemento);
                    Thread.Sleep(300);

                    InputNomePai.Click();
                    Thread.Sleep(300);
                    InputNomePai.SendKeys(massa.nomePai);
                    Thread.Sleep(300);

                    InputCpfPai.Click();
                    Thread.Sleep(300);
                    InputCpfPai.SendKeys(util.GerarCpf());
                    Thread.Sleep(300);

                    util.ScrollPage(1);

                    InputNomeMae.Click();
                    Thread.Sleep(300);
                    InputNomeMae.SendKeys(massa.nomeMae);
                    Thread.Sleep(300);

                    InputCpfMae.Click();
                    Thread.Sleep(300);
                    InputCpfMae.SendKeys(util.GerarCpf());
                    Thread.Sleep(300);

                    InputDdd.Click();
                    Thread.Sleep(300);
                    InputDdd.SendKeys(massa.ddd);
                    Thread.Sleep(300);

                    InputNumeroTel.Click();
                    Thread.Sleep(300);
                    InputNumeroTel.SendKeys(massa.numTel);
                    Thread.Sleep(300);

                    InputRamal.Click();
                    Thread.Sleep(300);
                    InputRamal.SendKeys(massa.ramal);

                    _result = true;
                }
                else
                {
                }
            }
            catch
            {
            }
            return(_result);
        }
コード例 #2
0
        public bool PreencherEndereco()
        {
            bool _result = false;

            Thread.Sleep(4000);
            try
            {
                if (Campoendereco.Displayed)
                {
                    InputCep.Click();
                    Thread.Sleep(600);
                    InputCep.SendKeys(massa.cep);
                    Thread.Sleep(600);
                    //BtnBuscarEnder.Click();
                    Thread.Sleep(600);

                    InputNumero.Click();
                    Thread.Sleep(600);
                    InputNumero.SendKeys(massa.numero);
                    Thread.Sleep(600);

                    InputComplemento.Click();
                    Thread.Sleep(600);
                    InputComplemento.SendKeys(massa.complemento);
                    Thread.Sleep(600);

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

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

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

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

                    InputNomePai.Click();
                    Thread.Sleep(600);
                    InputNomePai.SendKeys(massa.nomePai);
                    Thread.Sleep(600);

                    InputCpfPai.Click();
                    Thread.Sleep(600);
                    InputCpfPai.SendKeys(util.GerarCpf());
                    Thread.Sleep(600);

                    util.ScrollPage(1);

                    InputNomeMae.Click();
                    Thread.Sleep(600);
                    InputNomeMae.SendKeys(massa.nomeMae);
                    Thread.Sleep(600);

                    InputCpfMae.Click();
                    Thread.Sleep(600);
                    InputCpfMae.SendKeys(util.GerarCpf());
                    Thread.Sleep(600);

                    InputDdd.Click();
                    Thread.Sleep(600);
                    InputDdd.SendKeys(massa.ddd);
                    Thread.Sleep(600);

                    InputNumeroTel.Click();
                    Thread.Sleep(600);
                    InputNumeroTel.SendKeys(massa.numTel);
                    Thread.Sleep(600);

                    InputRamal.Click();
                    Thread.Sleep(600);
                    InputRamal.SendKeys(massa.ramal);
                    Thread.Sleep(600);

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