コード例 #1
0
        public static ReadOnlyCollection <IWebElement> FindElementsWhenVisible(By by)
        {
            ReadOnlyCollection <IWebElement> elements = null;

            try
            {
                elements = Wait.Until(WaitConditions.ElementsAreDisplayed(_driver.FindElements(by)));
            }
            catch (Exception e)
            {
                _logger.Error($"Driver.FindElementsWhenVisible - Error: {e.Message} occurred for process {TestContext.CurrentContext.WorkerId}");
                throw;
            }
            return(elements);
        }
コード例 #2
0
        public static IWebElement FindElementWhenVisible(By by)
        {
            IWebElement element = null;

            try
            {
                element = Wait.Until(WaitConditions.ElementIsDisplayed(_driver.FindElement(by)));
            }
            catch (Exception e)
            {
                _logger.Error($"Driver.FindElementWhenVisible - Error: {e.Message} occurred for process {TestContext.CurrentContext.WorkerId}");
                throw;
            }
            return(element);
        }