예제 #1
0
        /// <summary>
        /// Check if element is present in page
        /// </summary>
        /// <param name="controlId"></param>
        /// <param name="useSitemapId">By default element id will be picked from sitemaps, false to use the control Id directly</param>
        /// <param name="sourceType">Default mentions the element is of Id type</param>
        /// <param name="retry">True to do a retry to find out the element.</param>
        /// <returns></returns>
        public bool IsElementPresent(string controlId, bool useSitemapId = true, FindType sourceType = FindType.ById, bool retry = true)
        {
            try
            {
                string locator = useSitemapId == true?_siteMapData.GetLocator(controlId, out sourceType) : controlId;

                return(_client.IsElementPresent(locator, sourceType, retry));
            }
            catch
            {
                return(false);
            }
        }