public static void NavigateToPage(string url) { try { DriverFactory.Instance.Navigate().GoToUrl(url); Reporter.AddLogStep("Acessando a página: " + url); } catch { } }
public static void SelectElementByText(this IWebElement element, string text) { try { WaitHelper.WaitTextToBePresentInElement(element, text); new SelectElement(element).SelectByText(text); Reporter.AddLogStep(text); } catch (NoSuchElementException ex) { Reporter.AddLogStep(ex.Message); throw new NoSuchElementException(); } }
public static void TextToBePresentInElementValue(IWebElement element, string text) { try { new WebDriverWait(DriverFactory.Instance, TimeSpan.FromSeconds(Convert.ToInt32(ConfigurationManager.AppSettings["DefaultTimeout"]))).Until(ExpectedConditions.TextToBePresentInElementValue(element, text)); try { Reporter.AddLogStep("Elemento encontrado: [" + element.GetAttribute("id") + "]."); } catch { Reporter.AddLogStep("Elemento encontrado: [" + element.ToString() + "]."); } } catch (NoSuchElementException ex) { Reporter.AddLogStep(ex.Message); throw new NoSuchElementException(); } }