예제 #1
0
파일: Form1.cs 프로젝트: SilaC2306/N11
        IWebElement findElement(string param, ByTypes byType)
        {
            By by = By.Id(param);

            switch (byType)
            {
            case ByTypes.Id:
                by = By.Id(param);
                break;

            case ByTypes.Name:
                by = By.Name(param);
                break;

            case ByTypes.ClassName:
                by = By.ClassName(param);
                break;

            case ByTypes.XPath:
                by = By.XPath(param);
                break;

            default:
                by = By.Id(param);
                break;
            }

            return(driver.FindElement(by));
        }
예제 #2
0
파일: Form1.cs 프로젝트: SilaC2306/N11
        bool exist(string param, ByTypes byType)
        {
            try
            {
                findElement(param, byType);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
예제 #3
0
 public static Func <string, By> GetByFunc(this By by)
 {
     return(ByTypes.FirstOrDefault(el => by.ToString().Contains(el.Key)).Value);
 }
예제 #4
0
파일: Form1.cs 프로젝트: SilaC2306/N11
        void sendKeys(string param, ByTypes byType, string value)
        {
            IWebElement element = findElement(param, byType);

            element.SendKeys(value);
        }
예제 #5
0
파일: Form1.cs 프로젝트: SilaC2306/N11
        void click(string param, ByTypes byType)
        {
            IWebElement element = findElement(param, byType);

            element.Click();
        }