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

            MRes.Reset();
            Exception exception = null;

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

                MRes.Set();
            }

                     );
            MRes.Wait();
            if (exception != null)
            {
                throw exception;
            }
        }
Example #2
0
 /// <summary>
 /// Performs a long tap on the element of the specified driver.
 /// </summary>
 /// <param name="driver">The driver to use.</param>
 /// <param name="element">The element to long tap.</param>
 public static void Longtap(IWebDriver driver, IWebElement element)
 {
     if (driver is IHasTouchScreen)
     {
         TouchActions longtap = new TouchActions(driver);
         Point        center  = GetCenter(element);
         longtap.Down(center.X, center.Y);
         longtap.Perform();
         try
         {
             Thread.Sleep(750);
         }
         catch (ThreadInterruptedException)
         {
         }
         longtap.Up(center.X, center.Y);
         longtap.Perform();
     }
     else
     {
         ILocatable   locatable = (ILocatable)element;
         ICoordinates coords    = locatable.Coordinates;
         IMouse       mouse     = ((IHasInputDevices)driver).Mouse;
         mouse.MouseDown(coords);
         try
         {
             Thread.Sleep(750);
         }
         catch (ThreadInterruptedException)
         {
         }
         mouse.MouseUp(coords);
     }
 }
Example #3
0
        /// <summary>
        /// Performs a MouseUp event on the specified element via ILocatable interface.
        /// </summary>
        /// <param name="elementName">Element to operate on.</param>
        public void MouseUp(IWebElement element)
        {
            WaitForElementToBePresent(element);
            ILocatable locatable = (ILocatable)element;

            mouse.MouseUp(locatable.Coordinates);
        }
Example #4
0
        /// <summary>
        /// Presses the left mouse button 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;

            mouse.MouseUp(null);
            return(null);
        }
Example #5
0
        /// <summary>
        /// Drag and drop this widget onto another widget
        /// </summary>
        /// <param name="target">The target widget.</param>
        public virtual void Drop(IWidget target)
        {
            IMouse mouse = ((IHasInputDevices)Driver.WebDriver).Mouse;

            DragOver(target);

            ILocatable targetL = (ILocatable)target.ContentElement;

            mouse.MouseUp(targetL.Coordinates);
        }
Example #6
0
        public void MouseUp(ICoordinates where)
        {
            Location location = Location_(where);

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

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

            Logger.Verbose("MouseUp(): Location is " + mouseLocation_);
            mouse_.MouseUp(where);
        }
Example #7
0
        /// <summary>
        /// Performs a MouseUp event on the specified element via ILocatable interface.
        /// </summary>
        /// <param name="elementName">Element to operate on.</param>
        public void MouseUp(IWebElement element)
        {
            ILocatable locatable = (ILocatable)element;

            mouse.MouseUp(locatable.Coordinates);
        }