Пример #1
0
        internal static void Click(IWebDriver _driver, IWebElement el)
        {
            By by = null;

            var id = el.GetAttribute("codigo");

            if (id != null && id != "")
            {
                by = By.Id(id);
                WaitElement(by, _driver);
            }
            var         wait    = new WebDriverWait(_driver, TimeSpan.FromSeconds(3));
            IWebElement element = wait.Until(drv => drv.FindElement(by));

            try
            {
                JSUtil.JavaScriptRun(_driver, "document.getElementById('" + id + "').click()");
                JSUtil.PageLoad(_driver);
                JSUtil.AguardeLoad(_driver);
            }
            catch (Exception ex)
            {
                new Sigef.Poc.Ftcapp.Util.LOG.LogUtil().FormaTLogException("Click", ex.GetType().Name, ex.Message);
            }
        }
Пример #2
0
        private static void ConfigIR(IWebDriver driver, string URLPagina)
        {
            if (!SeleniumUtil.IsPaginaConceito(driver))
            {
                if (!CloseIfAlertPresent(driver))
                {
                    JSUtil.PageLoad(driver);
                }
            }
            else
            {
                JSUtil.PageLoad(driver);
            }


            if (!string.IsNullOrEmpty(URLPagina))
            {
                ManagerUtil.MinimizeOtherWindows(driver, URLPagina);
                ManagerUtil.PosicionaJanelaCantoSuperiorDireito(driver);
            }
        }