public void ContextClick(ICoordinates where)
        {
            var MRes = new ManualResetEventSlim(true);

            MRes.Reset();
            Exception exception = null;

            Task.Run(async() =>
            {
                try
                {
                    await mouse.ContextClick(where).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                MRes.Set();
            }

                     );
            MRes.Wait();
            if (exception != null)
            {
                throw exception;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Performs a ContextClick event on the specified element via ILocatable interface.
        /// </summary>
        /// <param name="elementName">Element to operate on.</param>
        public void MouseContextClick(IWebElement element)
        {
            WaitForElementToBePresent(element);
            ILocatable locatable = (ILocatable)element;

            mouse.ContextClick(locatable.Coordinates);
        }
Beispiel #3
0
        public void ContextClick(ICoordinates where)
        {
            Location location = Location_(where);

            Logger.Verbose("ContextClick(" + location + ")");

            MoveIfNeeded(where);
            AddMouseTrigger_(MouseAction.RightClick);

            Logger.Verbose("ContextClick(): Location is " + mouseLocation_);
            mouse_.ContextClick(where);
        }
Beispiel #4
0
        /// <summary>
        /// Clicks at the last coordinates set for the driver.
        /// </summary>
        /// <returns>This command always returns <see langword="null"/>.</returns>
        public override object Execute()
        {
            IHasInputDevices hasInputDevicesDriver = this.Session.Driver as IHasInputDevices;
            IMouse           mouse = hasInputDevicesDriver.Mouse;

            if (this.leftMouseButton)
            {
                mouse.Click(null);
            }
            else
            {
                mouse.ContextClick(null);
            }

            return(null);
        }
Beispiel #5
0
        /// <summary>
        /// Performs a ContextClick event on the specified element via ILocatable interface.
        /// </summary>
        /// <param name="elementName">Element to operate on.</param>
        public void MouseContextClick(IWebElement element)
        {
            ILocatable locatable = (ILocatable)element;

            mouse.ContextClick(locatable.Coordinates);
        }