public void WaintForObject(TipoElementoEnum TipoElemento, String strValue, long timeout) { var wait = new WebDriverWait(Driver, TimeSpan.FromMilliseconds(timeout)); var htmlElement = TipoWebElemento.ObterTipoElemento(TipoElemento, strValue); wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(htmlElement)); }
public static By ObterTipoElemento(TipoElementoEnum TipoElementoEnum, string StrValue) { if (TipoElementoEnum.Equals(TipoElementoEnum.Id)) { return(By.Id(StrValue)); } else if (TipoElementoEnum.Equals(TipoElementoEnum.ClassName)) { return(By.ClassName(StrValue)); } else if (TipoElementoEnum.Equals(TipoElementoEnum.CssSelector)) { return(By.CssSelector(StrValue)); } else if (TipoElementoEnum.Equals(TipoElementoEnum.Name)) { return(By.Name(StrValue)); } else if (TipoElementoEnum.Equals(TipoElementoEnum.LinkText)) { return(By.LinkText(StrValue)); } else if (TipoElementoEnum.Equals(TipoElementoEnum.PartialLinkText)) { return(By.PartialLinkText(StrValue)); } else if (TipoElementoEnum.Equals(TipoElementoEnum.TagName)) { return(By.TagName(StrValue)); } else { return(By.XPath(StrValue)); } }
public void HoverLink(TipoElementoEnum TipoElemento, String strValue) { var elemento = GetIWebElement(TipoElemento, strValue); Actions builder = new Actions(Driver); builder.MoveToElement(elemento).Build().Perform(); }
public void WaintElementToBeClickable(TipoElementoEnum TipoElemento, String strValue) { var htmlElement = TipoWebElemento.ObterTipoElemento(TipoElemento, strValue); var wait = new WebDriverWait(Driver, TimeSpan.FromMilliseconds(Parametros.TIME_OUT)); wait.Until(ExpectedConditions.ElementToBeClickable(htmlElement)); }
public void ClickDropDownIndex(TipoElementoEnum TipoElemento, String strValue, int index) { var elemento = GetIWebElement(TipoElemento, strValue); SelectElement dropDrowSelect = new SelectElement(elemento); dropDrowSelect.SelectByIndex(index); }
public void WaintPresenceOfAllElementsLocatedForObject(TipoElementoEnum TipoElemento, String strValue) { var htmlElement = TipoWebElemento.ObterTipoElemento(TipoElemento, strValue); var wait = new WebDriverWait(Driver, TimeSpan.FromMilliseconds(Parametros.TIME_OUT)); wait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(htmlElement)); }
public void ClickObject(TipoElementoEnum TipoElemento, String strValue) { var elemento = GetIWebElement(TipoElemento, strValue); WaintPresenceOfAllElementsLocatedForObject(TipoElemento, strValue); WaintElementToBeClickable(TipoElemento, strValue); elemento.Click(); }
public String GetPropertyObject(TipoElementoEnum TipoElemento, String strValue, String strProperty) { var htmlElemnet = GetIWebElement(TipoElemento, strValue); var getProperty = htmlElemnet.GetProperty(strProperty); return(Utilitarios.VerificarStringValida(getProperty) ? getProperty.Trim() : ""); }
public int GetRowCount(TipoElementoEnum TipoElemento, string StrValue) { IWebElement tabela = GetIWebElement(TipoElemento, StrValue); List <IWebElement> tr = tabela.FindElements(By.CssSelector("tr")).ToList(); return(Utilitarios.VerificarObjetoValido(tr.Count) ? tr.Count : 0); }
public string GetTextSelectComboBox(TipoElementoEnum TipoElemento, string strValue) { var htmlElemnet = GetIWebElement(TipoElemento, strValue); SelectElement SelectElement = new SelectElement(htmlElemnet); string wantedText = SelectElement.SelectedOption.Text; return(wantedText.Trim()); }
public int GetColumnCount(TipoElementoEnum TipoElemento, string strValue) { IWebElement tabela = GetIWebElement(TipoElemento, strValue); List <IWebElement> td = tabela.FindElements(By.CssSelector("td")).ToList(); return(Utilitarios.VerificarObjetoValido(td.Count) ? td.Count : 0); }
public void ClickDropDown(TipoElementoEnum TipoElemento, String strValue, String conteudo) { var elemento = GetIWebElement(TipoElemento, strValue); SelectElement dropDrowSelect = new SelectElement(elemento); dropDrowSelect.SelectByText(conteudo.Trim()); }
public void ClickDropDownValue(TipoElementoEnum TipoElemento, String strValue, String strPropertyValue) { WaintElementToBeClickable(TipoElemento, strValue); var elemento = GetIWebElement(TipoElemento, strValue); SelectElement dropDrowSelect = new SelectElement(elemento); dropDrowSelect.SelectByValue(strPropertyValue.Trim()); }
public Boolean IsPropertyObjectIguaisVerify(TipoElementoEnum TipoElemento, String strValue, String strProperty, String strPropertyVerify) { if (Utilitarios.VerificarStringValida(GetPropertyObject(TipoElemento, strValue, strProperty))) { return(GetPropertyObject(TipoElemento, strValue.Trim(), strProperty.Trim()).Equals(strPropertyVerify.Trim())); } else { return(false); } }
public void ClickCheckBox(TipoElementoEnum TipoElemento, String strValue, Boolean isCheck) { WaintElementToBeClickable(TipoElemento, strValue); var elemento = GetIWebElement(TipoElemento, strValue); var isElementIsCheck = elemento.Selected; if (!isCheck && isElementIsCheck) { elemento.Click(); } else if (isCheck && !isElementIsCheck) { elemento.Click(); } }
public void CheckFieldEnabled(TipoElementoEnum TipoElemento, string StrValue, bool IsDisabled) { var isDisabledScreen = false; if (IsDisabled) { isDisabledScreen = IsPropertyObjectIguaisVerify(TipoElemento, StrValue, "disabled", "disabled"); } else if (!IsDisabled) { isDisabledScreen = !IsPropertyObjectIguaisVerify(TipoElemento, StrValue, "disabled", "disabled"); } VerificationPointConditional(IsDisabled, isDisabledScreen); }
public void SetCell(TipoElementoEnum TipoElemento, String strValue, int row, int col, String value) { IWebElement tabela = GetIWebElement(TipoElemento, strValue); List <IWebElement> tr = tabela.FindElements(By.CssSelector("tr")).ToList(); List <IWebElement> td = tabela.FindElements(By.CssSelector("td")).ToList(); int rows = tr.Count; int cols = td.Count; for (int x = 0; x < rows; x++) { for (int y = 0; y < cols; y++) { if (x == row && y == col) { td[y].SendKeys(value); } } } }
public string GetCell(TipoElementoEnum TipoElemento, string strValue, int row, int col) { IWebElement tabela = GetIWebElement(TipoElemento, strValue); List <IWebElement> tr = tabela.FindElements(By.CssSelector("tr")).ToList(); List <IWebElement> td = tabela.FindElements(By.CssSelector("td")).ToList(); int rows = tr.Count; int cols = td.Count; for (int x = 0; x < rows; x++) { for (int y = 0; y < cols; y++) { if (x == row && y == col) { var str = td[y].Text.Trim(); return(str); } } } return(""); }
public IWebElement GetIWebElement(TipoElementoEnum TipoElemento, String strValue) { var htmlElement = TipoWebElemento.ObterTipoElemento(TipoElemento, strValue); return(Utilitarios.VerificarObjetoValido(Driver.FindElement(htmlElement)) ? Driver.FindElement(htmlElement) : null); }
public bool VerifyRadioBox(TipoElementoEnum TipoElemento, String strValue) { bool isSelect = GetPropertyObject(TipoElemento, strValue, "checked").Equals("checked"); return(Utilitarios.VerificarObjetoValido(isSelect) ? isSelect : false); }
public bool VerifyCheckBox(TipoElementoEnum TipoElemento, string strValue) { bool isSelect = Utilitarios.VerificarObjetoValido(GetIWebElement(TipoElemento, strValue).Selected) ? GetIWebElement(TipoElemento, strValue).Selected : false; return(isSelect); }
public string GetAttributeObject(TipoElementoEnum TipoElemento, String strValue, String strProperty) { var htmlElemnet = GetIWebElement(TipoElemento, strValue); return(Utilitarios.VerificarStringValida(htmlElemnet.GetAttribute(strProperty).Trim()) ? htmlElemnet.GetAttribute(strProperty).Trim() : ""); }
public void ClearText(TipoElementoEnum TipoElemento, String strValue) { var elemento = GetIWebElement(TipoElemento, strValue); elemento.Clear(); }
public void MoveToElementPage(TipoElementoEnum TipoElemento, String strValue) { var element = GetIWebElement(TipoElemento, strValue); JS.ExecuteScript("arguments[0].scrollIntoView(true);", element); }
public void SetText(TipoElementoEnum TipoElemento, String strValue, String strValueText) { var elemento = GetIWebElement(TipoElemento, strValue); elemento.SendKeys(strValueText.Trim()); }