Example #1
0
        /// <summary>
        /// Click on the element
        /// </summary>
        public virtual void Click()
        {
            if (IsDisabled)
            {
                Highlight();
                throw new WebControlException(Driver, "Control is disabled.", this);
            }

            if (!Exists)
            {
                throw new WebControlException(Driver, "Control does not exist.", this);
            }

            try
            {
                RawElement.Click();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("is not clickable at point") && ex.Message.Contains("Other element would receive the click"))
                {
                    //LOG: The element could not be clicked as there is another element which would receive the click

                    ParentRawElement.Click();
                }
                else
                {
                    Highlight();
                    throw new WebControlException(Driver, ex, "Control could not be clicked on", this);
                }
            }
        }
Example #2
0
 public void Click()
 {
     RawElement.Click();
 }