Exemplo n.º 1
0
        /// <summary>
        ///     ...Description to be added...
        /// </summary>
        /// <param name="driver">The browser, that is represented by an <see cref="IWebDriver" /> instance.</param>
        /// <param name="eventType">The type of the event.</param>
        /// <param name="functionName">The variable name for the function that can be used in the window global object.</param>
        public static void AddEventListener([NotNull] this IWebDriver driver, [NotNull] string eventType,
                                            [NotNull] string functionName)
        {
            if (driver == null)
            {
                throw new ArgumentNullException(nameof(driver));
            }
            if (eventType == null)
            {
                throw new ArgumentNullException(nameof(eventType));
            }
            if (functionName == null)
            {
                throw new ArgumentNullException(nameof(functionName));
            }

            driver.AddEventListenerToElement("document", eventType, functionName);
        }