Esempio 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="circleName">...Description to be added...</param>
        /// <param name="text">...Description to be added...</param>
        /// <param name="xPosCenter">...Description to be added...</param>
        /// <param name="yPosCenter">...Description to be added...</param>
        public static IWebElement CreateCircle(
            [NotNull] IWebDriver driver,
            [NotNull] string circleName,
            [CanBeNull] string text,
            int xPosCenter,
            int yPosCenter)
        {
            if (driver == null)
            {
                throw new ArgumentNullException(nameof(driver));
            }
            if (circleName == null)
            {
                throw new ArgumentNullException(nameof(circleName));
            }

            var circle = driver.Create().CreateElement(circleName, "div", driver.Body());

            circle.Attributes().Style =
                $"background-color: yellow; position: absolute; left: {xPosCenter - 15}px; top: {yPosCenter - 15}px; height: 24px; width: 24px; border-radius: 50%; border-width: 3px; border-style: solid; z-index: 65535; text-align: center";

            circle.Properties().InnerText = text;

            return(circle);
        }