Пример #1
0
        private void DesktopPatternPressingButtons()
        {
            int r = random.Next(1, 3);

            if (!IsCaptchaPartPresent(_captchaActive))
            {
                if (r == 1)
                {
                    LeftPressingDesktop();
                }
                if (r == 2)
                {
                    MiddlePressingDesktop();
                }
                if (r == 3)
                {
                    RightPressingDesktop();
                }
            }
            else
            {
                Parallel.Invoke(

                    () => MethodsLib.CapthcaAlert(),
                    () => Thread.Sleep(120000)

                    );
            }
        }
        private void PressingButtonsPattern()
        {
            int  r            = random.Next(1, 4);
            bool captchaPopUp = _driver.FindElement(_captchaActive).Displayed;

            if (!captchaPopUp)
            {
                if (r == 1)
                {
                    FirstButtonPressing();
                }
                if (r == 2)
                {
                    SecondButtonPressing();
                }
                if (r == 3)
                {
                    ThirdButtonPressing();
                }
                if (r == 4)
                {
                    FourthButtonPressing();
                }
            }
            else
            {
                Parallel.Invoke(

                    () => MethodsLib.CapthcaAlert(),
                    () => Thread.Sleep(120000)

                    );
            }
        }