예제 #1
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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));
        }
예제 #2
0
 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));
     }
 }
예제 #3
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void HoverLink(TipoElementoEnum TipoElemento, String strValue)
        {
            var     elemento = GetIWebElement(TipoElemento, strValue);
            Actions builder  = new Actions(Driver);

            builder.MoveToElement(elemento).Build().Perform();
        }
예제 #4
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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));
        }
예제 #5
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void ClickDropDownIndex(TipoElementoEnum TipoElemento, String strValue, int index)
        {
            var elemento = GetIWebElement(TipoElemento, strValue);

            SelectElement dropDrowSelect = new SelectElement(elemento);

            dropDrowSelect.SelectByIndex(index);
        }
예제 #6
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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));
        }
예제 #7
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void ClickObject(TipoElementoEnum TipoElemento, String strValue)
        {
            var elemento = GetIWebElement(TipoElemento, strValue);

            WaintPresenceOfAllElementsLocatedForObject(TipoElemento, strValue);
            WaintElementToBeClickable(TipoElemento, strValue);
            elemento.Click();
        }
예제 #8
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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() : "");
        }
예제 #9
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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);
        }
예제 #10
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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());
        }
예제 #11
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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);
        }
예제 #12
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void ClickDropDown(TipoElementoEnum TipoElemento, String strValue, String conteudo)
        {
            var elemento = GetIWebElement(TipoElemento, strValue);

            SelectElement dropDrowSelect = new SelectElement(elemento);

            dropDrowSelect.SelectByText(conteudo.Trim());
        }
예제 #13
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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());
        }
예제 #14
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
 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);
     }
 }
예제 #15
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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();
            }
        }
예제 #16
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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);
        }
예제 #17
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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);
                    }
                }
            }
        }
예제 #18
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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("");
        }
예제 #19
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public IWebElement GetIWebElement(TipoElementoEnum TipoElemento, String strValue)
        {
            var htmlElement = TipoWebElemento.ObterTipoElemento(TipoElemento, strValue);

            return(Utilitarios.VerificarObjetoValido(Driver.FindElement(htmlElement)) ? Driver.FindElement(htmlElement) : null);
        }
예제 #20
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public bool VerifyRadioBox(TipoElementoEnum TipoElemento, String strValue)
        {
            bool isSelect = GetPropertyObject(TipoElemento, strValue, "checked").Equals("checked");

            return(Utilitarios.VerificarObjetoValido(isSelect) ? isSelect : false);
        }
예제 #21
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public bool VerifyCheckBox(TipoElementoEnum TipoElemento, string strValue)
        {
            bool isSelect = Utilitarios.VerificarObjetoValido(GetIWebElement(TipoElemento, strValue).Selected) ? GetIWebElement(TipoElemento, strValue).Selected : false;

            return(isSelect);
        }
예제 #22
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        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() : "");
        }
예제 #23
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void ClearText(TipoElementoEnum TipoElemento, String strValue)
        {
            var elemento = GetIWebElement(TipoElemento, strValue);

            elemento.Clear();
        }
예제 #24
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void MoveToElementPage(TipoElementoEnum TipoElemento, String strValue)
        {
            var element = GetIWebElement(TipoElemento, strValue);

            JS.ExecuteScript("arguments[0].scrollIntoView(true);", element);
        }
예제 #25
0
파일: TelaHelper.cs 프로젝트: saviojrc/SCPG
        public void SetText(TipoElementoEnum TipoElemento, String strValue, String strValueText)
        {
            var elemento = GetIWebElement(TipoElemento, strValue);

            elemento.SendKeys(strValueText.Trim());
        }