public static void Logout()
 {
     if (GenericHelper.IsElemetPresent(By.XPath("//div[@id='header']/ul[1]/li[11]/a")))
     {
         ClickButton(By.XPath("//div[@id='header']/ul[1]/li[11]/a"));
         GenericHelper.WaitForWebElementInPage(By.Id("welcome"), TimeSpan.FromSeconds(30));
     }
 }
示例#2
0
        public static IList <string> GetValues(string @locator, int column)
        {
            List <string> list = new List <string>();

            var row = 1;

            while (GenericHelper.IsElemetPresent(By.XPath(GetTableXpath(locator, row, column))))
            {
                list.Add(ObjectRepository.Driver.FindElement(By.XPath(GetTableXpath(locator, row, column))).Text);
                row++;
            }
            return(list);
        }
示例#3
0
        private static IWebElement GetGridElement(string locator, int row, int col)
        {
            var xpath = GetTableXpath(locator, row, col);

            if (GenericHelper.IsElemetPresent(By.XPath(xpath + "//a")))
            {
                return(ObjectRepository.Driver.FindElement(By.XPath(xpath + "//a")));
            }
            else if (GenericHelper.IsElemetPresent(By.XPath(xpath + "//input")))
            {
                return(ObjectRepository.Driver.FindElement(By.XPath(xpath + "//input")));
            }
            else
            {
                return(ObjectRepository.Driver.FindElement(By.XPath(xpath)));
            }
        }