Exemple #1
0
 private static void ClickBuy(int index)
 {
     AutoItX.MouseMove(600 + index * 200, 1000, 15);
     AutoItX.MouseDown();
     AutoItX.MouseMove(AutoItX.MouseGetPos().X, AutoItX.MouseGetPos().Y - 200, 15);
     AutoItX.MouseUp();
     Info.store[index].name = ChampionName.None;
 }
Exemple #2
0
        public static void MouseClick(string button, int x, int y, int speed = 3, bool keepPosition = false)
        {
            AutoItX.WinActivate(Addresses.PxgHandle);
            Point oldMousePosition = Cursor.Position;

            AutoItX.MouseMove(x, y, speed);
            AutoItX.MouseDown(button);
            AutoItX.Sleep(15);
            AutoItX.MouseUp(button);
            if (keepPosition)
            {
                AutoItX.MouseMove(oldMousePosition.X, oldMousePosition.Y, speed);
            }
        }
Exemple #3
0
        internal static void HandleDragAndDrop(IWebElement sourceLocator, IWebElement destinationLocator, IWebDriver driver)
        {
            _action = new Actions(driver);
            var dest = destinationLocator.Location;

            AutoItX.MouseMove(150, 250, -1);
            AutoItX.MouseDown("LEFT");
            AutoItX.MouseMove(250, 250, -1);
            AutoItX.MouseUp();

            //_action.Click(sourceLocator)
            //    .MoveByOffset(0, 0)
            //    .ClickAndHold()
            //    .MoveByOffset(250,0)
            //    .Release()
            //    .Build().Perform();
            //_action.DragAndDrop(sourceLocator, destinatinationLocator);
            //_action.MoveToElement(destinatinationLocator).Build().Perform();
            //_action.Release();
        }
Exemple #4
0
        private void SearchAndSelectComboBox(IntPtr mainWindow, IntPtr searchComboBox, string value)
        {
            Rectangle mainWindowPosition = AutoItX.WinGetPos(mainWindow);
            Rectangle refElementPosition = AutoItX.ControlGetPos(mainWindow, searchComboBox);
            int       startX             = mainWindowPosition.X + refElementPosition.X;
            int       startY             = mainWindowPosition.Y + refElementPosition.Y;
            int       elementPossitionX  = startX + 10;
            int       elementPossitionY  = startY + 10;

            AutoItX.MouseMove(elementPossitionX, elementPossitionY);

            AutoItX.MouseClickDrag("LEFT", elementPossitionX, elementPossitionY, elementPossitionX + 100, elementPossitionY + 30, 100);
            AutoItX.MouseDown();
            AutoItX.MouseUp();

            AutoItX.ClipPut(value);
            AutoItX.Send("^v");

            AutoItX.MouseMove(elementPossitionX + 100, elementPossitionY + 70);
            AutoItX.MouseDown();
            AutoItX.MouseUp();

            Thread.Sleep(GetRandomDelay(100)); // stop to make sure the dropdown selected done
        }
Exemple #5
0
 public static void MouseUp(MouseButtons buttons, Point location)
 {
     AutoItX.MouseMove(location.X, location.Y, 0);
     AutoItX.MouseUp(buttons.ToString().ToUpper());
 }
Exemple #6
0
 public void MouseClick(string button = "LEFT")
 {
     AutoItX.MouseDown(button);
     Thread.Sleep(100);
     AutoItX.MouseUp(button);
 }
Exemple #7
0
 public void MouseUp(string button = "LEFT")
 {
     AutoItX.MouseUp(button);
 }
Exemple #8
0
 static public void releaseMouseRight()
 {
     AutoItX.MouseUp("RIGHT");
 }
Exemple #9
0
 static public void releaseMouse()
 {
     AutoItX.MouseUp();
 }