Пример #1
0
        /// <summary>
        /// If we ever need to implement a different kind of click, we can use this extension method. Right now, I have it setup to use javascript clicks
        /// for IE as an example, if we would ever need to do that. However, we set EnableNativeEvents to false in BaseInternetExplorerOptions, which
        /// accomplishes the same thing, so for now, this goes unused.
        /// </summary>
        /// <param name="self"></param>
        /// <param name="Browser"></param>
        public static void Click(this IWebElement self, IWebDriver Browser)
        {
            var element = self as IWebElement;

            // Note, using GetCapabilties is different from the way I coded the BrowserName property derived from the BrowserNames class. I hardcoded IE to have
            // a value of "internetexplorer" (no space) in that class. For the below GetCapabilities built-in selenium way of doing it, it ha a space between the
            // words internet and explorer
            if (Browser.GetCapabilities().BrowserName == "internet explorer")
            {
                JavascriptUtils.Click(Browser, element);
            }
            else
            {
                element.Click();
            }
        }