public bool ClicarCalendario() { bool _result = false; try { Thread.Sleep(3000); IWebElement IconCalendar = ClassDriver.GetInstance().Driver.FindElement(By.XPath("/html/body/material-docs-app/app-component-sidenav/mat-sidenav-container/mat-sidenav-content/div/div/div/app-component-viewer/div/div/component-overview/doc-viewer/div/div[1]/example-viewer/div/div[2]/datepicker-overview-example/mat-form-field/div/div[1]/div[2]/mat-datepicker-toggle/button")); util.WaitForElementVisible(IconCalendar, 30); if (IconCalendar.Displayed && IconCalendar.Enabled) { IconCalendar.Click(); Thread.Sleep(1000); _result = true; } else { ClassInfo.GetInstance().LogMessage = "Erro ao clicar no calendário!"; } } catch (Exception) { ClassInfo.GetInstance().LogMessage = "Erro ao validar!"; } return(_result); }
public bool ValidarCarregamento() { bool _result = false; try { IWebElement LogoHome = ClassDriver.GetInstance().Driver.FindElement(By.XPath("/html/body/material-docs-app/app-component-sidenav/mat-sidenav-container/mat-sidenav-content/div/component-page-header/div/h1")); util.WaitForElementVisible(LogoHome, 60); if (LogoHome.Displayed) { _result = true; } else { ClassInfo.GetInstance().LogMessage = "Erro ao acessar a aplicação!"; } } catch (Exception) { ClassInfo.GetInstance().LogMessage = "Erro ao validar!"; } return(_result); }