public void QuitarRepasse() { #region Abrir o Chrome //inicializando o chrome IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://main.safety8.local/#/login?cnpj=72.408.271%2F0001-91"); driver.Manage().Window.Maximize(); System.Threading.Thread.Sleep(3000); #endregion #region Login var cnpj = driver.FindElement(By.Id("cnpj")); cnpj.SendKeys("72408271000191"); System.Threading.Thread.Sleep(10000);//Aguardando a pagina carregar { var elemento = driver.FindElement(By.CssSelector(".logo-login-q")); Actions builder = new Actions(driver); builder.MoveToElement(elemento).ClickAndHold().Perform(); } { var elemento = driver.FindElement(By.CssSelector(".efeitoOverlay")); Actions builder = new Actions(driver); builder.MoveToElement(elemento).Release().Perform(); } driver.FindElement(By.CssSelector(".container-fluid")).Click(); driver.FindElement(By.CssSelector(".ng-scope > .animated")).Click(); { var dropdown = driver.FindElement(By.CssSelector(".ng-scope > .animated")); dropdown.FindElement(By.XPath("/html/body/div[5]/div[2]/div[2]/div/div/div/div/div/div[2]/div[2]/select/option[3]")).Click(); //driver.Quit(); } Login login = new Login(); driver.FindElement(By.CssSelector(".ng-scope > .animated")).Click(); driver.FindElement(By.Id("usuario")).Click(); driver.FindElement(By.Id("usuario")).SendKeys(login.RetornaUsuario()); driver.FindElement(By.Id("senha")).SendKeys(login.RetornaSenha()); driver.FindElement(By.CssSelector(".button-login-q")).Click(); #endregion #region Quitar Repasses System.Threading.Thread.Sleep(8000); //Aguardando a pagina carregar driver.FindElement(By.Id("botaoMenu")).Click(); System.Threading.Thread.Sleep(5000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector("div:nth-child(3) > .menu > .menu-item:nth-child(9) > .menu-span > .ng-binding")).Click(); System.Threading.Thread.Sleep(8000); //Aguardando a pagina carregar IWebElement btnQuitaRep = driver.FindElement(By.XPath("/html/body/div[5]/nav/div[3]/ul/li[18]/a")); MetodosNavega.NavegaScroll(driver, btnQuitaRep); System.Threading.Thread.Sleep(8000); driver.FindElement(By.CssSelector(".menu-item:nth-child(9) > .expandida > .menu > .menu-item:nth-child(4) > .menu-span > .ng-binding")).Click(); System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar driver.FindElement(By.XPath("//*[@id=\"menuEsquerda\"]/div[3]/ul/li[9]/div/ul/li[4]/div/ul/li[2]/a")).Click(); System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar System.Threading.Thread.Sleep(1500); driver.FindElement(By.Id("comboundefined")).Click(); System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar driver.FindElement(By.Id("comboundefined")).SendKeys("francisco"); System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar driver.FindElement(By.LinkText("FRANCISCO")).Click(); System.Threading.Thread.Sleep(2000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector(".btn-default:nth-child(2)")).Click(); System.Threading.Thread.Sleep(2000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector(".btn:nth-child(3)")).Click(); { System.Threading.Thread.Sleep(6000); //Aguardando a pagina carregar var element = driver.FindElement(By.XPath("/html/body/div[7]/div[2]/button[1]")); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar Actions builder = new Actions(driver); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar builder.MoveToElement(element).Perform(); } System.Threading.Thread.Sleep(2000);//Aguardando a pagina carregar driver.FindElement(By.CssSelector(".confirm")).Click(); System.Threading.Thread.Sleep(8000); #endregion IWebElement caixaConfirma = driver.FindElement(By.XPath("/html/body/div[7]/div[2]/button[1]")); if (caixaConfirma.Displayed) { caixaConfirma.Click(); } MetodosNavega.SairPlus(driver); driver.Quit(); }
public void CadastraNegocio() { #region Abrir o Chrome //inicializando o chrome IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://main.safety8.local/#/login?cnpj=72.408.271%2F0001-91"); driver.Manage().Window.Maximize(); System.Threading.Thread.Sleep(3000); #endregion #region Login var cnpj = driver.FindElement(By.Id("cnpj")); cnpj.SendKeys("72408271000191"); { var elemento = driver.FindElement(By.CssSelector(".logo-login-q")); Actions builder = new Actions(driver); builder.MoveToElement(elemento).ClickAndHold().Perform(); } { var elemento = driver.FindElement(By.CssSelector(".efeitoOverlay")); Actions builder = new Actions(driver); builder.MoveToElement(elemento).Release().Perform(); } driver.FindElement(By.CssSelector(".container-fluid")).Click(); driver.FindElement(By.CssSelector(".ng-scope > .animated")).Click(); { var dropdown = driver.FindElement(By.CssSelector(".ng-scope > .animated")); dropdown.FindElement(By.XPath("/html/body/div[5]/div[2]/div[2]/div/div/div/div/div/div[2]/div[2]/select/option[3]")).Click(); //driver.Quit(); } Login login = new Login(); driver.FindElement(By.CssSelector(".ng-scope > .animated")).Click(); driver.FindElement(By.Id("usuario")).Click(); driver.FindElement(By.Id("usuario")).SendKeys(login.RetornaUsuario()); driver.FindElement(By.Id("senha")).SendKeys(login.RetornaSenha()); driver.FindElement(By.CssSelector(".button-login-q")).Click(); #endregion #region Cadastro do Negócio //Central de Negocios System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[2]/div/a[1]/div/div")).Click(); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector(".btn-success")).Click(); //Criando o negocio System.Threading.Thread.Sleep(6000);//Aguardando a pagina carregar driver.FindElement(By.CssSelector(".col-lg-3:nth-child(2) .ng-valid-mask")).Click(); driver.FindElement(By.CssSelector(".col-lg-3:nth-child(2) .ng-valid-mask")).SendKeys("300.300.300-30"); driver.FindElement(By.CssSelector(".col-lg-3:nth-child(3) #comboundefined")).Click(); driver.FindElement(By.CssSelector(".col-lg-8:nth-child(1) .card-body")).Click(); driver.ExecuteJavaScript("window.scroll(0,1000)"); System.Threading.Thread.Sleep(3000); MetodosNavega.NavegaScroll(driver, "//*[@id=\"comboundefined\"]", 2); driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[3]/div[2]/div/div[2]/div[2]/div[1]/vs-editavel3/div/input")).Click(); driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[3]/div[2]/div/div[2]/div[2]/div[1]/vs-editavel3/div/input")).SendKeys("aero"); driver.FindElement(By.LinkText("AERONAUTICO")).Click(); driver.FindElement(By.CssSelector(".col-lg-3:nth-child(3) .empty")).Click(); driver.FindElement(By.CssSelector(".today")).Click(); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).Click(); //driver.ExecuteScript("document.getElementById("combopontos").select()"); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).SendKeys("m"); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).SendKeys("a"); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).SendKeys("t"); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).SendKeys("r"); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).SendKeys("i"); driver.FindElement(By.CssSelector(".col-lg-12 #combopontos")).SendKeys("z"); System.Threading.Thread.Sleep(2000); driver.FindElement(By.LinkText("MATRIZ")).Click(); driver.FindElement(By.Id("combovendedor")).Click(); driver.FindElement(By.Id("combovendedor")).SendKeys("F"); driver.FindElement(By.Id("combovendedor")).SendKeys("R"); driver.FindElement(By.Id("combovendedor")).SendKeys("A"); driver.FindElement(By.Id("combovendedor")).SendKeys("N"); driver.FindElement(By.Id("combovendedor")).SendKeys("C"); driver.FindElement(By.Id("combovendedor")).SendKeys("I"); driver.FindElement(By.Id("combovendedor")).SendKeys("S"); driver.FindElement(By.Id("combovendedor")).SendKeys("C"); driver.FindElement(By.Id("combovendedor")).SendKeys("O"); //driver.FindElement(By.Id("combovendedor")).Click(); System.Threading.Thread.Sleep(2000); driver.FindElement(By.LinkText("FRANCISCO")).Click(); driver.FindElement(By.CssSelector("div:nth-child(2) > .botoes-bottom-verde")).Click(); //js.ExecuteScript("window.scrollTo(0,574)"); //Fecha o navegador #endregion MetodosNavega.SairPlus(driver); driver.Quit(); }
public void LiberarRepasse() { #region Abrir o Chrome //inicializando o chrome IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://main.safety8.local/#/login?cnpj=72.408.271%2F0001-91"); driver.Manage().Window.Maximize(); System.Threading.Thread.Sleep(3000); #endregion #region Login var cnpj = driver.FindElement(By.Id("cnpj")); cnpj.SendKeys("72408271000191"); System.Threading.Thread.Sleep(5000); { var elemento = driver.FindElement(By.CssSelector(".logo-login-q")); Actions builder = new Actions(driver); builder.MoveToElement(elemento).ClickAndHold().Perform(); } { var elemento = driver.FindElement(By.CssSelector(".efeitoOverlay")); Actions builder = new Actions(driver); builder.MoveToElement(elemento).Release().Perform(); } driver.FindElement(By.CssSelector(".container-fluid")).Click(); driver.FindElement(By.CssSelector(".ng-scope > .animated")).Click(); { var dropdown = driver.FindElement(By.CssSelector(".ng-scope > .animated")); dropdown.FindElement(By.XPath("/html/body/div[5]/div[2]/div[2]/div/div/div/div/div/div[2]/div[2]/select/option[3]")).Click(); //driver.Quit(); } Login login = new Login(); driver.FindElement(By.CssSelector(".ng-scope > .animated")).Click(); driver.FindElement(By.Id("usuario")).Click(); driver.FindElement(By.Id("usuario")).SendKeys(login.RetornaUsuario()); driver.FindElement(By.Id("senha")).SendKeys(login.RetornaSenha()); driver.FindElement(By.CssSelector(".button-login-q")).Click(); #endregion #region Liberar Repasse System.Threading.Thread.Sleep(6000); //Aguardando a pagina carregar driver.FindElement(By.Id("botaoMenu")).Click(); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector("div:nth-child(3) > .menu > .menu-item:nth-child(9) > .menu-span > .ng-binding")).Click(); System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector(".menu-item:nth-child(9) > .expandida > .menu > .menu-item:nth-child(4) > .menu-span > .ng-binding")).Click(); System.Threading.Thread.Sleep(4000); //Aguardando a pagina carregar driver.FindElement(By.XPath("//*[@id=\"menuEsquerda\"]/div[3]/ul/li[9]/div/ul/li[4]/div/ul/li[1]/a")).Click(); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[1]/div[3]/form/div[1]/div/div[2]/div[2]/div/div/vs-editavel3/div/label/span/span")).Click(); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.CssSelector(".btn-flat:nth-child(2)")).Click(); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.Id("comboundefined")).Click(); System.Threading.Thread.Sleep(3000); //Aguardando a pagina carregar driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[1]/div[3]/form/div[2]/div/div[2]/div[3]/div[2]/div/vs-editavel3/div/input")).SendKeys("francisco"); driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[1]/div[3]/form/div[2]/div/div[2]/div[3]/div[2]/div/vs-editavel3/div/input")).SendKeys(Keys.Enter); //driver.FindElement(By.Id("comboundefined")).SendKeys("porto"); //System.Threading.Thread.Sleep(3000);//Aguardando a pagina carregar //driver.FindElement(By.CssSelector("strong")).Click(); //System.Threading.Thread.Sleep(3000);//Aguardando a pagina carregar //driver.FindElement(By.Name("frmAutoFormrepasseComissaoLiberacaoRepassesundefined_edt_ramo_codigo")).Click(); //System.Threading.Thread.Sleep(3000);//Aguardando a pagina carregar //driver.FindElement(By.Name("frmAutoFormrepasseComissaoLiberacaoRepassesundefined_edt_ramo_codigo")).SendKeys("aeronautico"); //System.Threading.Thread.Sleep(3000);//Aguardando a pagina carregar //driver.FindElement(By.LinkText("AERONAUTICO")).Click(); //System.Threading.Thread.Sleep(3000);//Aguardando a pagina carregar driver.FindElement(By.CssSelector(".btn-flat:nth-child(2)")).Click(); System.Threading.Thread.Sleep(3000);//Aguardando a pagina carregar IWebElement btnLibera = driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div[3]/div[4]/div[1]/div[4]/div/div/div/button[2]")); MetodosNavega.NavegaScroll(driver, btnLibera); btnLibera.Click(); #endregion MetodosNavega.SairPlus(driver); driver.Quit(); }