Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }